/* =====================================================================
   📄 SHARED SUB-PAGE STYLES (Headers & Titles)
   ===================================================================== */

/* The Frosted Glass Container for Subpage Titles */
.header { 
    text-align: center; 
    background: var(--card-bg); 
    padding: 35px 20px; 
    border-radius: 16px; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.05); 
    margin-bottom: 30px; 
    margin-top: 10px; /* Reduced top margin since there's no avatar */
    transition: background 0.3s, border-color 0.3s;
    -webkit-backdrop-filter: blur(12px); 
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
}

/* The Actual Page Title (<h1>) */
.header h1 {
    font-size: 2.4em;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 10px;
    letter-spacing: 1px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Soft drop shadow */
}

/* Glowing text effect for the title in Dark Mode */
body.dark-mode .header h1 {
    text-shadow: 0 2px 10px rgba(255, 136, 179, 0.3);
}

/* The Subtitle/Description (<p>) */
.header p {
    font-size: 1.1em;
    color: var(--text-color);
    margin: 0;
    font-weight: 500;
}

/* --- Songlist --- */
.controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.search-bar { padding: 12px; width: 100%; max-width: 400px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1em; background: var(--card-bg); color: var(--text-color); }
.song-table-wrapper { background: var(--card-bg); border-radius: 12px; padding: 20px; overflow-x: auto; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
th { background-color: var(--th-bg); color: var(--text-muted); }
tbody tr { transition: all 0.2s ease-in-out; position: relative; }
tbody tr:hover { background-color: var(--hover-bg); transform: scale(1.01) translateY(-2px); box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08); z-index: 2; }
tbody tr:hover td { border-bottom-color: transparent; }
.song-name { cursor: pointer; color: #007bff; font-weight: 500; transition: color 0.2s; }
body.dark-mode .song-name { color: #5ea8ff; }
.song-name:hover { color: var(--primary-color); text-decoration: underline; }
.copy-hint { font-size: 0.85em; color: #28a745; margin-left: 8px; font-weight: bold; pointer-events: none; }

/* --- Jigsaw --- */
.stats-bar { display: flex; justify-content: space-around; font-size: 1.2em; font-weight: bold; margin-bottom: 15px; color: var(--text-color); }
.difficulty-selector { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.difficulty-selector .btn { background: transparent !important; color: var(--primary-color) !important; border: 2px solid var(--primary-color); margin: 5px; }
.difficulty-selector .btn:hover, .difficulty-selector .btn.active { background: var(--primary-color) !important; color: #fff !important; }
.puzzle-board { width: 100%; max-width: 500px; aspect-ratio: 2 / 3; margin: 0 auto; position: relative; border: 3px solid var(--primary-color); border-radius: 8px; overflow: hidden; touch-action: none; }
.puzzle-piece { position: absolute; background-image: url('./jigsaw-source.webp'); background-repeat: no-repeat; background-size: cover; transition: left 0.15s ease-out, top 0.15s ease-out; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); display: block; }
.puzzle-piece.empty { opacity: 0; pointer-events: none; }

/* --- Trivia --- */
.trivia-container { background: var(--card-bg); padding: 40px; border-radius: 16px; border: 1px solid var(--border-color); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); text-align: center; }
.question-text { font-size: 1.5em; font-weight: bold; color: var(--text-color); margin-bottom: 30px; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.option-btn { background: transparent; color: var(--primary-color); border: 2px solid var(--primary-color); padding: 15px; border-radius: 10px; cursor: pointer; font-size: 1.1em; font-weight: 600; transition: all 0.2s; }
.option-btn:hover:not(.disabled) { background: var(--hover-bg); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255, 102, 153, 0.2); }
.option-btn.disabled { pointer-events: none; }
.option-btn.correct { background: #28a745 !important; border-color: #28a745 !important; color: white !important; box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important;}
.option-btn.incorrect { background: #dc3545 !important; border-color: #dc3545 !important; color: white !important; box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4) !important;}
.option-btn.is-answer { background: #007bff !important; border-color: #007bff !important; color: white !important; }
.progress-container { background: rgba(0, 0, 0, 0.1); height: 6px; border-radius: 10px; margin-bottom: 30px; overflow: hidden; }
body.dark-mode .progress-container { background: rgba(255, 255, 255, 0.1); }
.progress-bar { height: 100%; background: var(--primary-color); width: 0%; transition: width 0.3s ease; }

/* Custom Action Button for Trivia */
.trivia-action-btn {
    background: transparent !important; color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important; padding: 15px;
    font-size: 1.2em; border-radius: 10px; transition: all 0.2s ease;
}
.trivia-action-btn:hover { background: var(--primary-color) !important; color: #fff !important; box-shadow: 0 5px 15px rgba(255, 102, 153, 0.3); }

/* Mobile Adjustments */
@media (max-width: 768px) {
    body { padding: 10px; }
    .top-bar { top: 10px; right: 10px; }
    .header { padding: 20px 15px; margin-top: 50px; }
    .streams-container { flex-direction: column; }
    .options-grid { grid-template-columns: 1fr; }
    .song-table-wrapper { padding: 10px; -webkit-overflow-scrolling: touch; }
    table { min-width: 500px; }
    td:nth-child(2) { white-space: normal; min-width: 180px; }
}