body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1e1e1e;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

.blur-overlay {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
    opacity: 0.7;
}

.header-top {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 20px;
}

/* Feedback & Versioning Styles */
.feedback-submission {
    margin-bottom: 30px;
    padding: 20px;
}

.feedback-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feedback-card {
    background: #2d2d2d;
    border-radius: 12px;
    padding: 20px;
    border-left: 5px solid #7f8c8d;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.2s;
}

.feedback-card:hover {
    transform: translateY(-3px);
}

.feedback-card.type-bug { border-top: 3px solid #e74c3c; }
.feedback-card.type-suggestion { border-top: 3px solid #3498db; }
.feedback-card.type-improvement { border-top: 3px solid #2ecc71; }

.feedback-card.status-pending { border-left-color: #f1c40f; background: rgba(241, 196, 15, 0.03); }
.feedback-card.status-approved { border-left-color: #3498db; background: rgba(52, 152, 219, 0.03); }
.feedback-card.status-rejected { border-left-color: #e74c3c; background: rgba(231, 76, 60, 0.03); }
.feedback-card.status-completed { border-left-color: #2ecc71; background: rgba(46, 204, 113, 0.03); }

.admin-reply {
    margin-top: 10px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    border-right: 4px solid #f1c40f;
}

.status-rejected .admin-reply { border-right-color: #e74c3c; }
.status-approved .admin-reply { border-right-color: #3498db; }
.status-completed .admin-reply { border-right-color: #2ecc71; }

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.badge.type-suggestion { background: rgba(52, 152, 219, 0.15); color: #3498db; border-color: rgba(52, 152, 219, 0.3); }
.badge.type-bug { background: rgba(231, 76, 60, 0.15); color: #e74c3c; border-color: rgba(231, 76, 60, 0.3); }
.badge.type-improvement { background: rgba(46, 204, 113, 0.15); color: #2ecc71; border-color: rgba(46, 204, 113, 0.3); }
.badge.type-other { background: rgba(149, 165, 166, 0.15); color: #95a5a6; border-color: rgba(149, 165, 166, 0.3); }

.badge.status-pending { background: rgba(241, 196, 15, 0.15); color: #f1c40f; border-color: rgba(241, 196, 15, 0.3); }
.badge.status-approved { background: rgba(52, 152, 219, 0.15); color: #3498db; border-color: rgba(52, 152, 219, 0.3); }

.criteria-list li {
    margin-bottom: 3px;
    transition: color 0.3s;
}
.criteria-list li.valid {
    color: #2ecc71;
}
.criteria-list li.invalid {
    color: #e74c3c;
}
.toggle-password:hover {
    color: #ecf0f1 !important;
}
.badge.status-rejected { background: rgba(231, 76, 60, 0.15); color: #e74c3c; border-color: rgba(231, 76, 60, 0.3); }
.badge.status-completed { background: rgba(46, 204, 113, 0.15); color: #2ecc71; border-color: rgba(46, 204, 113, 0.3); }

/* Admin Feedback List Specific Styles */
.admin-feedback-card {
    margin-bottom: 20px;
    background: #2d2d2d;
    border-radius: 12px;
    padding: 20px;
    border-left: 5px solid #7f8c8d;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-feedback-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.admin-feedback-card.status-pending { border-left-color: #f1c40f; }
.admin-feedback-card.status-approved { border-left-color: #3498db; }
.admin-feedback-card.status-rejected { border-left-color: #e74c3c; }
.admin-feedback-card.status-completed { border-left-color: #2ecc71; }

.feedback-content p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.feedback-content small {
    color: #bdc3c7;
    font-style: italic;
}

.admin-reply {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #444;
    font-size: 0.9rem;
}

.admin-reply strong {
    color: #f1c40f;
    display: block;
    margin-bottom: 5px;
}

.justification {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 0.85rem;
}

.feedback-date {
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* Admin Specific */
.admin-feedback-manager {
    margin-top: 40px;
}

.response-form {
    margin-top: 15px;
    display: grid;
    gap: 10px;
}

/* Versioning Layout */
.versioning-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.versioning-main {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.versioning-sidebar {
    flex: 1;
}

@media (max-width: 900px) {
    .versioning-layout {
        flex-direction: column;
    }
}

.release-note-item {
    padding: 15px 0;
}

.rn-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.rn-version {
    font-weight: bold;
    color: #f1c40f;
    font-size: 1.2rem;
}

.rn-date {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.rn-title {
    margin: 0 0 10px 0;
    color: #fff;
}

.rn-content {
    line-height: 1.6;
    color: #e0e0e0;
}

.rn-divider {
    border: 0;
    border-top: 1px solid #444;
    margin: 10px 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    min-width: 500px;
    table-layout: auto;
}

.scrollable-history-container {
    max-height: 1500px; /* Approximately 50 rows */
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #333;
    border-radius: 4px;
    -webkit-overflow-scrolling: touch;
}

.results-container, #variation-table-container, .user-list-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.scrollable-history-container .admin-table thead th {
    position: sticky;
    top: 0;
    background-color: #2d2d2d;
    z-index: 10;
    box-shadow: inset 0 -1px 0 #333;
}

.admin-table th, .admin-table td {
    padding: 8px;
    border-bottom: 1px solid #333;
    text-align: left;
}

.admin-table th {
    color: #3498db;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-form input, .admin-form select {
    background-color: #1e1e1e;
    border: 1px solid #444;
    color: white;
    padding: 8px;
    border-radius: 4px;
}

hr {
    border: 0;
    border-top: 1px solid #333;
    margin: 1.5rem 0;
}

.view {
    width: 100%;
    height: auto;
    box-sizing: border-box;
}

/* Home View Styles */
#home-view {
    display: block;
    background: linear-gradient(135deg, #121212 0%, #1e1e1e 100%);
}

.home-container.full-width {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    text-align: center;
    background: radial-gradient(circle at center, rgba(52, 152, 219, 0.1) 0%, transparent 70%);
}

.hero-content {
    max-width: 1200px;
    width: 100%;
}

.club-stats-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.stat-bubble {
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid rgba(241, 196, 15, 0.3);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    color: #f1c40f;
}

.landing-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 50px;
}

.info-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.info-card h4 {
    margin-top: 0;
    color: #3498db;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.info-card p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #bdc3c7;
}

.membership-callout {
    margin-top: 60px;
    padding: 30px;
    background: rgba(241, 196, 15, 0.05);
    border-radius: 15px;
    border: 1px dashed #f1c40f;
}

.membership-callout h3 {
    color: #f1c40f;
    margin-top: 0;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    margin-bottom: 1rem;
    color: #fff;
    font-weight: 800;
    letter-spacing: -1px;
}

.tagline {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    color: #3498db;
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.features-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 5rem;
}

.feature-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.feature-item h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.feature-item p {
    color: #95a5a6;
    line-height: 1.6;
}

.cta-btn {
    display: inline-block;
    background: #3498db;
    color: white;
    border: none;
    padding: 20px 50px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
    box-sizing: border-box;
    width: 100%;
    max-width: 400px;
}

.cta-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(52, 152, 219, 0.4);
}

/* Menu Section */
.menu-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.menu-header h2 {
    font-size: 2rem;
    margin: 0;
    color: #fff;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.menu-card {
    background-color: #252526;
    border-radius: 12px;
    padding: 2rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.menu-card:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    background-color: #2d2d2d;
    border-color: #3498db;
}

.menu-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.card-content h2 {
    margin-bottom: 0.5rem;
    color: #fff;
}

.card-content p {
    color: #95a5a6;
    line-height: 1.4;
}

.card-badge-legacy {
    display: inline-block;
    background-color: #e67e22;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
    margin-top: 1rem;
}

/* Selection View Styles */
.selection-container {
    width: 98%;
    max-width: 1800px;
    margin: 20px auto;
}

.admin-full-width {
    max-width: none;
    width: calc(100% - 40px);
    margin: 20px;
}

.view-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
}

.view-header h1 {
    margin: 0;
    font-size: 2rem;
    color: #3498db;
}

#pgn-selection-view {
    overflow-y: visible;
}

.pgn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    align-items: start;
    padding-bottom: 50px;
}

/* Les catégories de premier niveau prennent toute la largeur */
.pgn-grid > .user-category-details {
    grid-column: 1 / -1;
    height: auto;
}

/* Les catégories imbriquées (sous-catégories) sont des cartes par défaut */
.category-content .user-category-details {
    grid-column: span 1;
    height: auto;
    border: 1px solid #444;
}

/* Quand on ouvre une sous-catégorie, elle prend toute la largeur pour afficher son contenu */
.category-content .user-category-details[open] {
    grid-column: 1 / -1;
    background: rgba(52, 152, 219, 0.05);
    border-color: #3498db;
}

.user-category-summary {
    padding: 15px;
    cursor: pointer;
    display: flex;
    flex-direction: column; /* Mode carte par défaut */
    align-items: center;
    gap: 10px;
    list-style: none;
    transition: background 0.2s;
    text-align: center;
}

/* Mode ligne pour les catégories de premier niveau ou ouvertes */
.pgn-grid > .user-category-details > .user-category-summary,
.user-category-details[open] > .user-category-summary {
    flex-direction: row;
    text-align: left;
    background: rgba(52, 152, 219, 0.1);
}

.user-category-summary:hover {
    background: rgba(52, 152, 219, 0.15);
}

.user-category-summary::-webkit-details-marker {
    display: none;
}

.cat-info {
    display: flex;
    flex-direction: column;
}

.cat-name {
    font-weight: bold;
    color: #3498db;
    font-size: 1rem;
}

.cat-desc {
    font-size: 0.75rem;
    color: #95a5a6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-content {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    border-top: 1px solid #333;
}

#lessons-list .category-content {
    grid-template-columns: 1fr;
}

.user-pgn-card {
    display: flex;
    flex-direction: column; /* Icone au dessus */
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    gap: 10px;
    width: auto;
    text-align: center;
    margin: 0;
    min-height: 120px;
}

.pgn-info {
    display: flex;
    flex-direction: column;
}

.pgn-name {
    font-weight: bold;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.manual-move-entry {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.manual-move-entry input {
    flex: 1;
    background: #252526;
    border: 1px solid #444;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.flex-1 {
    flex: 1;
}

.move-list-editor {
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-content: flex-start;
}

.editor-move-item {
    padding: 2px 6px;
    background: #333;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.editor-move-item:hover {
    background: #444;
}

.editor-move-item.active {
    background: #3498db;
    color: white;
}

.move-number {
    color: #888;
    margin-right: 3px;
    font-weight: normal;
}

.variation-container {
    border-left: 2px solid #555;
    margin-left: 10px;
    padding-left: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: 100%;
}

.move-comment-input {
    width: 100%;
    margin-top: 5px;
    background: #252526;
    border: 1px solid #444;
    color: #e0e0e0;
    padding: 4px;
    font-size: 0.8rem;
}

.diagram-move-list {
    margin: 15px 0;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.8;
    width: 100%;
    box-sizing: border-box;
}

.lesson-move-node {
    cursor: pointer;
    padding: 1px 4px;
    border-radius: 3px;
    transition: background 0.2s;
}

.lesson-move-node:hover {
    background: rgba(52, 152, 219, 0.3);
}

.lesson-move-node.active {
    background: #3498db;
    color: white;
}

.lesson-move-comment {
    color: #95a5a6;
    font-style: italic;
    font-size: 0.9rem;
    margin: 0 4px;
}

.lesson-variation {
    color: #bdc3c7;
    font-size: 0.9rem;
}

.full-tree-container {
    background: #252526;
    padding: 0 !important;
}

#variation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto;
    min-width: 600px;
}

#variation-table th, #variation-table td {
    border: 1px solid #333;
    padding: 8px;
    text-align: center;
}

#variation-table th {
    background: #2d2d2d;
    color: #3498db;
    font-weight: bold;
}

.line-label {
    background: #2d2d2d;
    font-weight: bold;
    color: #888;
    text-align: left !important;
    min-width: 100px;
}

.move-pair-cell {
    padding: 0 !important;
    min-width: 60px;
    vertical-align: middle;
}

.white-move-sub, .black-move-sub {
    padding: 4px 8px;
    cursor: pointer;
    transition: background 0.2s;
    height: 20px;
    line-height: 20px;
}

.white-move-sub {
    border-bottom: 1px solid #333;
    background: rgba(255,255,255,0.02);
}

.white-move-sub:hover, .black-move-sub:hover {
    background: rgba(52, 152, 219, 0.3);
}

.white-move-sub.current, .black-move-sub.current {
    background: #3498db !important;
    color: white !important;
    font-weight: bold;
}

.main-line-row {
    background: rgba(46, 204, 113, 0.05);
}

.active-line {
    background: rgba(52, 152, 219, 0.15) !important;
}

.active-move {
    background: #3498db !important;
    color: white !important;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
    border-radius: 4px;
    z-index: 1;
}

.variation-line-row.active-line .line-label {
    color: #f1c40f;
    border-left: 4px solid #f1c40f;
}

.main-line-row.active-line .line-label {
    color: #2ecc71;
    border-left: 4px solid #2ecc71;
}

.move-comment {
    color: #95a5a6;
    font-style: italic;
    font-weight: normal;
    font-size: 0.85rem;
    margin-left: 8px;
}
.ql-toolbar.ql-snow {
    background-color: #f0f0f0;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}
.ql-container.ql-snow {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.pgn-card {
    background-color: #252526;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.pgn-card:hover {
    border-color: #3498db;
    background-color: #2d2d2d;
    transform: scale(1.02);
}

.pgn-card .icon {
    font-size: 2.5rem;
}

.pgn-card span {
    font-weight: bold;
    color: #e0e0e0;
    text-align: center;
}

/* Admin & Login Styles */
.login-container {
    max-width: 400px;
    width: 90%;
    margin: 100px auto;
    background-color: #252526;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.form-group label {
    color: #bdc3c7;
    font-size: 0.9rem;
}

.form-group input {
    background-color: #1e1e1e;
    border: 1px solid #444;
    color: white;
    padding: 10px;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.primary-btn, .action-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.2s;
}

.primary-btn:hover, .action-btn:hover {
    background-color: #2980b9;
}

.small-btn {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.text-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: auto;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.admin-card {
    background-color: #252526;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #333;
    text-align: left;
    margin-bottom: 20px;
}

.admin-card h3 {
    margin-top: 0;
    color: #3498db;
}

/* Admin Layout & Hierarchy */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.tab-btn {
    background: #252526;
    border: 1px solid #444;
    color: #95a5a6;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #2d2d2d;
    color: #e0e0e0;
}

.tab-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.admin-layout {
    display: block;
    min-height: calc(100vh - 220px);
}

.tab-content {
    display: none;
    min-height: 400px;
}

.tab-content.active {
    display: block;
}

.admin-column {
    flex: 1;
    overflow-y: visible;
    min-width: 0; /* Prevent flex overflow */
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.hint {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-bottom: 15px;
}

.hierarchy-root {
    min-height: 200px;
}

.category-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 10px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.toggle-icon {
    cursor: pointer;
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    margin-right: 5px;
    font-size: 0.8rem;
    color: #95a5a6;
    transition: color 0.2s;
}

.toggle-icon:hover {
    color: #3498db;
}

.category-item.collapsed .subcategory-list {
    display: none;
}

.category-title {
    font-weight: bold;
    color: #3498db;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-controls {
    display: flex;
    gap: 5px;
}

.subcategory-list {
    margin-left: 20px;
    margin-top: 10px;
    padding: 10px;
    border-left: 2px dashed #444;
    min-height: 20px;
}

.pgn-item {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.lesson-item {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.pgn-item-title {
    font-size: 0.9rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
}

#zoom-modal {
    align-items: flex-start;
    padding: 20px 0;
}

.modal-content {
    background: #252526;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    border: 1px solid #444;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-content.large-modal {
    max-width: 950px;
    width: 95%;
    max-height: 90vh;
}

/* Lesson Card Actions - Simple & Clean */
.pgn-card.lesson-card-interactive {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 15px 20px !important;
    background: #252526 !important;
    border: 1px solid #333 !important;
    border-radius: 12px !important;
    transition: background-color 0.2s, border-color 0.2s !important;
    text-align: left;
    gap: 20px;
    height: auto !important;
    min-height: unset !important;
}

.pgn-card.lesson-card-interactive:hover {
    background-color: #2d2d2d !important;
    border-color: #444 !important;
    transform: none !important;
    box-shadow: none !important;
}

.pgn-card.lesson-card-interactive .pgn-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.pgn-card.lesson-card-interactive .pgn-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: #3e3e42;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
    margin-bottom: 4px;
    border: 1px solid #444;
}

.pgn-card.lesson-card-interactive .pgn-desc {
    font-size: 0.8rem;
    color: #b0b0b0;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lesson-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 140px;
    flex-shrink: 0;
}

.view-lesson-btn, .direct-train-btn {
    width: 100%;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 300;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    text-transform: none;
}

.view-lesson-btn {
    color: #3498db;
    border-color: rgba(52, 152, 219, 0.3);
}

.view-lesson-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: #3498db;
    color: white;
}

.direct-train-btn {
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.3);
}

.direct-train-btn:hover {
    background: rgba(46, 204, 113, 0.1);
    border-color: #2ecc71;
    color: white;
}

@media (max-width: 700px) {
    .pgn-card.lesson-card-interactive {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 20px !important;
    }
    .lesson-card-actions {
        width: 100%;
        margin-top: 15px;
    }
    .pgn-card.lesson-card-interactive .pgn-name {
        margin: 0 0 8px 0;
    }
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

textarea {
    background-color: #1e1e1e;
    border: 1px solid #444;
    color: white;
    padding: 10px;
    border-radius: 4px;
    min-height: 100px;
    resize: vertical;
}

/* SortableJS Styles */
.sortable-ghost {
    opacity: 0.4;
    background-color: #3498db !important;
}

.sortable-drag {
    background-color: #2d2d2d !important;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #3498db;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.container-full {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
    width: 100%;
}

header {
    background-color: #252526;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

header h1 {
    margin: 0;
    font-size: 1.2em;
    color: #3498db;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.controls select, .controls button {
    background-color: #333;
    color: white;
    border: 1px solid #444;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.controls button:hover {
    background-color: #444;
}

.controls button.active {
    background-color: #3498db;
    border-color: #2980b9;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#board-section {
    width: 450px;
    padding: 15px;
    background-color: #252526;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-right: 1px solid #333;
    flex-shrink: 0;
}

#board {
    width: 100%;
}

.board-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    background-color: #2d2d2d;
    padding: 10px;
    border-radius: 4px;
}

.board-controls button {
    background-color: #333;
    color: white;
    border: 1px solid #444;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.board-controls button:hover {
    background-color: #444;
}

.board-controls button.active {
    background-color: #3498db;
    border-color: #2980b9;
}

.color-select {
    display: flex;
    gap: 2px;
}

.info-panel {
    flex: 1;
    min-height: 150px;
    background-color: #2d2d2d;
    padding: 12px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    font-size: 0.9em;
}

#status {
    font-weight: bold;
    color: #3498db;
}

#status.error-msg {
    color: #e74c3c;
}

#move-history {
    font-family: monospace;
    color: #bdc3c7;
    font-size: 0.9em;
}

#comment-box {
    font-style: italic;
    color: #ecf0f1;
}

#table-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: #1e1e1e;
    overflow: hidden;
}

/* Training Layout for Openings Page */
.training-layout.openings-layout {
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 30px;
    overflow-y: auto;
}

.trainer-top-section {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
}

.trainer-board-container {
    flex: 0 0 600px;
    background: #252526;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
}

.trainer-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-width: 380px;
}

.training-layout.openings-layout #table-section {
    width: 100%;
    max-width: none;
    flex: none;
    padding: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background-color: transparent;
}

.training-layout.openings-layout .board-controls {
    background: #2d2d2d;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.training-layout.openings-layout .info-panel {
    background: #2d2d2d;
    padding: 25px;
    border-radius: 12px;
    flex: 1;
    min-height: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-left: 4px solid #3498db;
}

/* Responsiveness for Openings Page */
@media (max-width: 1100px) {
    .trainer-top-section {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .trainer-board-container {
        flex: 0 0 auto;
        width: 100%;
        max-width: 600px;
        padding: 15px;
    }

    .trainer-sidebar {
        width: 100%;
        max-width: 600px;
        min-width: 0;
    }
}

@media (max-width: 600px) {
    .training-layout.openings-layout {
        padding: 10px;
        gap: 15px;
    }

    .trainer-top-section {
        padding: 10px;
    }

    .trainer-board-container {
        padding: 10px;
        border-radius: 8px;
    }

    .training-layout.openings-layout #table-section {
        padding: 15px 5px;
    }

    #variation-table {
        font-size: 0.8rem;
    }
}

/* Réduction de la largeur des colonnes de coups */
.training-layout.openings-layout #variation-table th,
.training-layout.openings-layout #variation-table td {
    padding: 4px;
    min-width: 50px;
}

.training-layout.openings-layout .move-pair-cell {
    min-width: 50px;
}

.training-layout.openings-layout .white-move-sub, 
.training-layout.openings-layout .black-move-sub {
    padding: 2px 4px;
    font-size: 0.85rem;
}

#variation-table-container {
    flex: 1;
    overflow: auto;
    border: 1px solid #333;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

th {
    position: sticky;
    top: 0;
    background-color: #333;
    z-index: 10;
    padding: 8px;
    border: 1px solid #444;
    min-width: 80px;
}

th:first-child {
    width: 40px;
    min-width: 40px;
}

td {
    border: 1px solid #444;
    padding: 0;
    vertical-align: top;
    min-width: 80px;
}

.line-label {
    background-color: #252526;
    text-align: center;
    vertical-align: middle;
    font-weight: bold;
    color: #3498db;
    font-size: 0.8em;
}

.empty-cell {
    background-color: #1a1a1a;
}

.move-cell {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.move-entry {
    padding: 4px;
    cursor: pointer;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    transition: background 0.1s;
    border-bottom: 1px solid #333;
}

.move-entry.empty {
    cursor: default;
}

.move-entry:not(.empty):hover {
    background-color: #3498db;
    color: white;
}

.move-entry.highlight {
    background-color: #e67e22 !important;
    color: white;
    font-weight: bold;
}

tr.active-row {
    background-color: rgba(230, 126, 34, 0.1) !important;
}

.move-entry.white-move {
    background-color: #2d2d2d;
}

.move-entry.black-move {
    background-color: #252526;
}

.row-main {
    border-left: 4px solid #3498db;
    background-color: rgba(52, 152, 219, 0.05);
}

.row-variation {
    border-left: 4px solid #95a5a6;
    background-color: rgba(149, 165, 166, 0.05);
}

.move-entry.main-line {
    font-weight: bold;
}

.move-entry.variation {
    font-style: italic;
    opacity: 0.8;
}

.comment-tooltip {
    color: #3498db;
    font-size: 1.2em;
    margin-left: 5px;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.error-msg {
    animation: shake 0.5s;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flex-1 {
    flex: 1;
}

#lesson-modal-title {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.large-modal {
    width: 95%;
    max-width: 1400px;
    height: 95vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}


#lesson-form {
    display: flex;
    flex-direction: column;
}


.lesson-blocks-container {
    flex: 1;
    overflow-y: visible;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.blocks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.blocks-header h4 {
    margin: 0;
    color: #3498db;
}

.blocks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 200px;
}

.lesson-block {
    background: #252526;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 15px;
    position: relative;
    cursor: default;
}

.lesson-block:hover {
    border-color: #3498db;
}

.block-handle {
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: move;
    background: #3498db;
    color: white;
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
    display: none;
}

.lesson-block:hover .block-handle {
    display: block;
}

.block-controls {
    display: flex;
    gap: 10px;
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #333;
}

.block-type-label {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #95a5a6;
}

.btn-remove-block {
    background: transparent;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2rem;
}

.block-content textarea {
    width: 100%;
    background: #1e1e1e;
    border: 1px solid #444;
    color: #e0e0e0;
    padding: 10px;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
}

/* 2 Columns Block */
.columns-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.column-drop-zone {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed #444;
    border-radius: 6px;
    min-height: 100px;
    padding: 10px;
}

.column-drop-zone .lesson-block {
    margin-bottom: 10px;
}

/* Diagram Block in Editor */
.diagram-preview {
    display: flex;
    gap: 20px;
    align-items: center;
}

.diagram-thumbnail {
    width: 150px;
    height: 150px;
    background: #000;
}

.diagram-info {
    flex: 1;
}

.diagram-label {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #3498db;
    margin-bottom: 10px;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(52, 152, 219, 0.2);
    padding-bottom: 5px;
}

.user-diagram-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 30px auto;
    background: #2d2d2d;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #444;
    width: 560px;
    min-width: 560px;
    max-width: 95%;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.zoom-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(52, 152, 219, 0.8);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.diagram-turn-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: bold;
}

.turn-circle {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid #fff;
}

.turn-circle.white { background: #fff; }
.turn-circle.black { background: #000; }

.move-message {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    min-height: 1.5em;
    width: 100%;
    box-sizing: border-box;
}

.move-message.success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.move-message.error {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.move-message.info {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.diagram-interaction-zone {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
}

.diagram-editor-modal {
    max-width: 900px;
}

.diagram-editor-layout {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 30px;
}

.piece-palette {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    margin-top: 15px;
    background: #2d2d2d;
    padding: 10px;
    border-radius: 4px;
}

.palette-piece {
    font-size: 2rem;
    cursor: pointer;
    text-align: center;
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 4px;
    transition: all 0.2s;
}

.palette-piece:hover {
    background: #3498db;
    border-color: #fff;
}

.palette-piece.active {
    background: #3498db;
    border-color: #fff;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.delete-tool {
    grid-column: span 2;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawing-palette {
    margin-top: 15px;
    background: #2d2d2d;
    padding: 10px;
    border-radius: 4px;
}

.drawing-tools {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.draw-tool {
    flex: 1;
    font-size: 1.2rem;
    padding: 5px;
    background: #1e1e1e;
    border: 1px solid #444;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.draw-tool:hover {
    background: #444;
}

.draw-tool.active {
    background: #3498db;
    border-color: #fff;
}

.drawing-colors {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.draw-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
}

.draw-color:hover {
    transform: scale(1.1);
}

.draw-color.active {
    border-color: #fff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* SVG layer for arrows and markers */
.chessboard-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.marker-square {
    position: absolute;
    box-sizing: border-box;
    border: 3px solid;
    pointer-events: none;
    z-index: 4;
}

.marker-square.red { border-color: rgba(231, 76, 60, 0.8); }
.marker-square.green { border-color: rgba(46, 204, 113, 0.8); }
.marker-square.blue { border-color: rgba(52, 152, 219, 0.8); }
.marker-square.yellow { border-color: rgba(241, 196, 15, 0.8); }

/* QCM Editor */
.qcm-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qcm-options-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.qcm-option-item {
    display: flex;
    gap: 10px;
    align-items: center;
}

.themes-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    background: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
    max-height: 300px;
    overflow-y: auto;
}

.themes-checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.themes-checkbox-grid label:hover {
    background: rgba(52, 152, 219, 0.1);
}

/* User View Blocks are now defined at the end of the file for priority */
.user-block-text {
    line-height: 1.8;
    font-size: 1.2rem;
    color: #ecf0f1;
}

.user-block-text p {
    margin-bottom: 20px;
}

.user-block-text h2, .user-block-text h3 {
    color: #f1c40f;
    margin-top: 0;
    margin-bottom: 15px;
}

.zoom-container {
    background: #1e1e1e;
    width: 95vw;
    height: auto;
    min-height: 95vh;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 40px;
    position: relative;
    border-radius: 12px;
    border: 1px solid #444;
}

.close-zoom-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
}

.zoom-info-panel {
    width: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.user-board {
    width: 500px;
    height: 500px;
    max-width: 100%;
}

.diagram-caption {
    font-style: italic;
    color: #95a5a6;
    text-align: center;
}

.user-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.user-qcm-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.user-qcm-options label {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #2d2d2d;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
}

.user-qcm-options label:hover {
    background: #3d3d3d;
}

.move-indicator {
    margin-left: 10px;
    font-weight: bold;
    color: #3498db;
}

/* Variation Table Professional Grid Styles */
.line-label-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 5px;
}

.play-line-btn {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
}

.play-line-btn:hover {
    background: #2ecc71;
}

.play-line-btn:active {
    transform: scale(0.95);
}

.move-pair-cell {
    padding: 0 !important;
}

.white-move-sub, .black-move-sub {
    padding: 4px 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-size: 0.9em;
    min-height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.white-move-sub {
    background-color: #2d2d2d;
    border-bottom: 1px solid #3d3d3d;
}

.black-move-sub {
    background-color: #252526;
}

.white-move-sub:hover, .black-move-sub:hover {
    background-color: #3498db;
    color: white;
}

.white-move-sub.active-move, .black-move-sub.active-move {
    background-color: #e67e22 !important;
    color: white;
    font-weight: bold;
}

/* --- PROFILE & GOALS --- */
.profile-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.profile-card {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    max-width: 100%;
    box-sizing: border-box;
}

.profile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: #333;
    border-radius: 6px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    font-size: 0.8rem;
    color: #95a5a6;
}

.goal-item {
    background: #333;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.goal-item.completed {
    border-left: 4px solid #2ecc71;
    background: #2c3e50;
}

.goal-info {
    flex: 1;
}

.goal-title {
    font-weight: bold;
    font-size: 1rem;
}

.goal-desc {
    font-size: 0.85rem;
    color: #bdc3c7;
    margin-bottom: 8px;
}

.goal-progress-bar {
    height: 8px;
    background: #252526;
    border-radius: 4px;
    overflow: hidden;
}

.goal-progress-fill {
    height: 100%;
    background: #3498db;
    transition: width 0.3s ease;
}

.goal-item.completed .goal-progress-fill {
    background: #2ecc71;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
}

.status-badge.success { background: #2ecc71; color: white; }
.status-badge.warning { background: #f39c12; color: white; }
.status-badge.danger { background: #e74c3c; color: white; }
.status-badge.fail { background: #e74c3c; color: white; }

.app-footer {
    background: #1e1e1e;
    color: #95a5a6;
    padding: 20px;
    text-align: center;
    font-size: 0.85rem;
    border-top: 1px solid #3d3d3d;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.app-footer p {
    margin: 5px 0;
}

.app-footer a {
    color: #3498db;
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* Adjust main content areas to not be hidden by footer and cookie banner */
.selection-container, .home-container, .login-container {
    padding-top: 20px;
    padding-bottom: 40px;
}

main {
    padding-bottom: 40px;
}

#home-view, #lessons-selection-view, #pgn-selection-view, #user-profile-view, #admin-dashboard-view, #trainer-view, #lesson-view {
    padding-top: 80px; /* Space for fixed top-nav */
    padding-bottom: 40px;
    box-sizing: border-box;
    min-height: 100vh;
}

/* Ensure trainer view takes into account the footer in its flex layout */
.container-full {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    padding-bottom: 40px;
    box-sizing: border-box;
}

/* Adjustments for the view padding when top-nav is active */
.top-nav:not(.hidden) ~ .view {
    padding-top: 60px;
    min-height: calc(100vh - 60px);
    padding-bottom: 40px;
    box-sizing: border-box;
}

:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --sidebar-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-nav {
    position: fixed;
    top: 5vh;
    left: 0;
    width: var(--sidebar-width);
    height: 90vh;
    background-color: #1e1e1e;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    z-index: 1001;
    box-shadow: 6px 0 30px rgba(0,0,0,0.5);
    padding: 10px 0;
    gap: 2px;
    transition: var(--sidebar-transition);
    overflow-y: auto;
    overflow-x: visible;
    border-radius: 0 24px 24px 0;
    border: 1px solid rgba(255,255,255,0.05);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.side-nav::-webkit-scrollbar {
    width: 4px;
}

.side-nav::-webkit-scrollbar-track {
    background: transparent;
}

.side-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.side-nav::-webkit-scrollbar-thumb:hover {
    background: #3498db;
}

.side-nav-group-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 4px 15px;
    flex-shrink: 0;
}

.side-nav.collapsed .side-nav-group-separator {
    margin: 6px 0;
    width: 30px;
    background: rgba(255, 255, 255, 0.15);
}

.side-nav-group-title {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: #555;
    margin: 6px 15px 2px 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.side-nav.collapsed .side-nav-group-title {
    display: none;
}

.side-nav.collapsed {
    width: var(--sidebar-collapsed-width);
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
}

.side-nav-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #ecf0f1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px auto;
    transition: all 0.3s ease;
    font-size: 1rem;
    flex-shrink: 0;
    position: relative;
}

.side-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.side-nav-item {
    color: #bdc3c7;
    text-decoration: none;
    margin: 1px 10px;
    padding: clamp(4px, 0.6vh, 8px) 15px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    transition: all 0.2s ease;
    border-radius: 10px;
    box-sizing: border-box;
    position: relative;
    font-size: clamp(0.7rem, 1.4vh, 0.9rem);
    font-weight: 500;
    flex-shrink: 0;
}

.side-nav.collapsed .side-nav-item {
    justify-content: center;
    padding: clamp(4px, 0.6vh, 8px) 0;
    margin: 2px 0;
    width: 44px;
    height: 44px;
}

.side-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #3498db;
    transform: translateX(4px);
}

.side-nav.collapsed .side-nav-item:hover {
    transform: scale(1.1) translateX(0);
}

.side-nav-item.active {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.side-nav-item span:first-child {
    font-size: clamp(0.9rem, 2vh, 1.1rem);
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-nav-item span:last-child {
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.side-nav.collapsed .side-nav-item span:last-child {
    display: none;
}

.side-nav-spacer {
    flex-grow: 1;
}

/* Tooltips when collapsed - CSS removed for JS tooltips to avoid clipping */
.side-nav.collapsed .side-nav-item::after,
.side-nav.collapsed .side-nav-toggle::after {
    display: none;
}

.side-nav.collapsed .side-nav-item::before,
.side-nav.collapsed .side-nav-toggle::before {
    display: none;
}

/* Base tooltip style (re-used for JS) */
.global-tooltip {
    position: fixed;
    background: #1e1e1e;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.global-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.global-tooltip::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent #1e1e1e transparent transparent;
}

/* Page content adjustment */
@media (min-width: 1151px) {
    .side-nav:not(.hidden) ~ .view,
    .side-nav:not(.hidden) ~ .container-full,
    .side-nav:not(.hidden) ~ div.container-full,
    .side-nav:not(.hidden) ~ main.view {
        padding-left: var(--sidebar-width) !important;
        transition: padding-left 0.3s ease;
    }

    .side-nav:not(.hidden).collapsed ~ .view,
    .side-nav:not(.hidden).collapsed ~ .container-full,
    .side-nav:not(.hidden).collapsed ~ div.container-full,
    .side-nav:not(.hidden).collapsed ~ main.view {
        padding-left: var(--sidebar-collapsed-width) !important;
    }

    .side-nav:not(.hidden) ~ .view,
    .side-nav:not(.hidden) ~ .container-full {
        width: auto !important;
    }
}

.account-info {
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.account-info p {
    margin: 5px 0;
}

#lichess-details p {
    margin: 3px 0;
    color: #ecf0f1;
}

#lichess-details strong {
    color: #3498db;
}

.lichess-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.lichess-stat-box {
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lichess-stat-label {
    font-size: 0.7rem;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lichess-stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
}

.rating-history-container, .activity-container {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 10px;
}

.activity-item {
    padding: 8px 0;
    border-bottom: 1px solid #333;
    font-size: 0.85rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-date {
    color: #95a5a6;
    font-size: 0.75rem;
    margin-right: 10px;
}

.activity-text {
    color: #e0e0e0;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #333;
}

.history-points {
    color: #2ecc71;
    font-weight: bold;
}

.history-points.negative {
    color: #e74c3c;
}

.status-badge.lichess-link {
    background-color: #3498db;
    cursor: pointer;
}

.status-badge.lichess-none {
    background-color: #95a5a6;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 900px) {
    main {
        flex-direction: column;
        overflow-y: visible;
    }

    #board-section {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
        border-right: none;
        border-bottom: 1px solid #333;
        flex-shrink: 1;
    }

    #table-section {
        height: auto;
        overflow: visible;
        min-height: 400px;
    }

    .diagram-editor-layout {
        grid-template-columns: 1fr;
    }

    .user-diagram-container {
        min-width: 0;
        width: 95%;
        padding: 15px;
    }

    .zoom-btn {
        top: 10px;
        right: 10px;
        padding: 5px 8px;
        font-size: 0.9rem;
    }

    .zoom-container {
        flex-direction: column;
        padding: 20px;
        overflow-y: visible;
    }

    .zoom-info-panel {
        width: 100%;
    }

    .user-board {
        width: 100% !important;
        max-width: 400px;
        height: auto !important;
    }

    .diagram-interaction-zone {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .diagram-interaction-zone button {
        width: 100%;
    }

    .diagram-move-list {
        font-size: 0.85rem;
        line-height: 1.6;
        padding: 8px;
    }
}

@media (max-width: 600px) {
    .nav-welcome {
        display: none;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .menu-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-tabs {
        flex-wrap: wrap;
    }

    .large-modal {
        width: 100%;
        height: 100%;
        padding: 10px;
    }

    .hero-section {
        padding: 40px 15px;
    }

    .cta-btn {
        padding: 15px 30px;
        width: 100%;
    }
}

/* --- COOKIE BANNER --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #2c3e50;
    color: #ecf0f1;
    z-index: 9999;
    padding: 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
    border-top: 2px solid #3498db;
}

.cookie-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cookie-content h3 {
    margin: 0;
    color: #3498db;
}

.cookie-options {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
}

.cookie-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.cookie-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    border: none;
    transition: all 0.2s;
}

.cookie-btn.primary {
    background-color: #27ae60;
    color: white;
}

.cookie-btn.primary:hover {
    background-color: #2ecc71;
}

.cookie-btn.secondary {
    background-color: #3498db;
    color: white;
}

.cookie-btn.secondary:hover {
    background-color: #2980b9;
}

.cookie-btn.text {
    background: transparent;
    color: #bdc3c7;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .cookie-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .cookie-actions {
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
    }
}

/* Dashboard Intro & Features Guide */
.dashboard-intro {
    background: rgba(44, 62, 80, 0.4);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border-left: 5px solid #3498db;
    text-align: left;
}

.dashboard-intro h3 {
    margin-top: 0;
    color: #3498db;
}

.features-guide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.guide-item {
    font-size: 0.95rem;
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
}

.guide-item.highlight {
    border: 1px solid rgba(241, 196, 15, 0.3);
    background: rgba(241, 196, 15, 0.05);
}

.guide-item.highlight strong {
    color: #f1c40f;
}

.dashboard-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 800px) {
    .dashboard-stats-overview {
        grid-template-columns: 1fr;
    }
}

/* Stats Visual Grid & Charts */
.stats-visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .stats-visual-grid {
        grid-template-columns: 1fr;
    }
}

.chart-container-card {
    min-height: 350px;
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chart-wrapper {
    flex-grow: 1;
    position: relative;
    height: 300px;
}

.chart-container-card canvas {
    width: 100% !important;
    height: 100% !important;
}

.strength-weakness-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .strength-weakness-grid {
        grid-template-columns: 1fr;
    }
}

.sw-card {
    background: #252526;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #333;
}

.sw-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sw-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sw-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #333;
}

.sw-item:last-child {
    border-bottom: none;
}

.sw-theme {
    font-weight: bold;
    color: #e0e0e0;
}

.sw-value {
    font-family: monospace;
    font-weight: bold;
}

.sw-value.strength {
    color: #2ecc71;
}

.sw-value.weakness {
    color: #e74c3c;
}

.progress-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.progress-stat-card {
    background: #252526;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #333;
}

.progress-stat-card .value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}

.progress-stat-card .label {
    color: #95a5a6;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.scroll-nav {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.scroll-btn {
    background: #3498db;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.scroll-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.scroll-btn.bottom {
    background: #2c3e50;
}

.scroll-btn.bottom:hover {
    background: #34495e;
}

/* Tab Styles */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.tab-link {
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    color: #bdc3c7;
    transition: all 0.2s;
}

.tab-link.active {
    background: #3498db;
    color: white;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.profile-layout-new {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

@media (max-width: 900px) {
    .profile-layout-new {
        grid-template-columns: 1fr;
    }
}
.leaderboard-intro {
    margin-bottom: 20px;
    color: #bdc3c7;
    font-style: italic;
}

.session-stats-body {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin: 30px 0;
}

.session-stat-card {
    flex: 1;
    background: #2d2d2d;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #444;
}

.session-stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #2ecc71;
    margin-bottom: 5px;
}

.session-stat-label {
    font-size: 0.9rem;
    color: #95a5a6;
}

.user-pgn-card.lesson-card-interactive {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
}

.lesson-visual {
    width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    border-radius: 8px 0 0 8px;
}

.lesson-visual::after {
    content: '';
    position: absolute;
    right: 0;
    top: 7.5%;
    height: 85%;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.pgn-card.lesson-card-interactive .pgn-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 15px 20px;
    align-items: flex-start;
}

.lesson-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 140px;
    flex-shrink: 0;
    padding: 15px;
    justify-content: center;
}

.lesson-progress-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
    align-items: center;
}

.status-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.completed {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-badge.pending {
    background: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.3);
}

.stat-item {
    font-size: 0.8rem;
    color: #95a5a6;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    padding: 2px 6px;
    border-radius: 4px;
}

.review-suggestion {
    font-size: 0.8rem;
    color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    margin-top: 4px;
    border: 1px dashed rgba(243, 156, 18, 0.3);
    width: fit-content;
}

.recommendations-section {
    max-width: 1200px;
    margin: 0 auto 30px auto;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.recommendation-card {
    background: #252526;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.recommendation-card:hover {
    transform: translateY(-3px);
    background: #2d2d2d;
    border-color: #3498db;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.rec-icon {
    font-size: 1.8rem;
    background: rgba(52, 152, 219, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rec-content {
    flex-grow: 1;
}

.rec-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.rec-diff {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
    font-weight: 600;
}

.badge-easy { background: rgba(46, 204, 113, 0.15); color: #2ecc71; border: 1px solid rgba(46, 204, 113, 0.3); }
.badge-normal { background: rgba(52, 152, 219, 0.15); color: #3498db; border: 1px solid rgba(52, 152, 219, 0.3); }
.badge-hard { background: rgba(231, 76, 60, 0.15); color: #e74c3c; border: 1px solid rgba(231, 76, 60, 0.3); }

.rec-status {
    font-size: 0.8rem;
    color: #95a5a6;
}

/* Goals */
.goal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #3498db;
}

.goal-item.completed {
    border-left-color: #2ecc71;
}

.goal-info {
    display: flex;
    flex-direction: column;
}

.goal-title {
    font-weight: bold;
    color: #fff;
}

.goal-desc {
    font-size: 0.85rem;
    color: #95a5a6;
}

.goal-progress-bar {
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin-bottom: 5px;
    overflow: hidden;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0;
    transition: width 0.5s ease;
}

/* --- PROFILE PAGE STYLES --- */
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-main {
    flex: 1;
}

.profile-card {
    background: #252526;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.profile-card h3 {
    margin-top: 0;
    color: #3498db;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    text-align: center;
}

.stat-item {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #f1c40f;
}

.stat-label {
    font-size: 0.8rem;
    color: #95a5a6;
    text-transform: uppercase;
}

.profile-header-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.profile-info-main h1 {
    margin: 0;
    font-size: 2rem;
    color: #fff;
}

.profile-info-main p {
    margin: 5px 0 0 0;
    color: #bdc3c7;
}

.profile-stats-summary {
    display: flex;
    gap: 40px;
}

.summary-item {
    text-align: center;
}

.summary-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #f1c40f;
}

.summary-label {
    font-size: 0.85rem;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-badge.error {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

@media (max-width: 800px) {
    .profile-header-stats {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .profile-stats-summary {
        width: 100%;
        justify-content: space-around;
        gap: 10px;
    }
}

#lesson-content-display {
    width: 100% !important;
    max-width: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 30px;
    box-sizing: border-box;
}

/* User View Blocks */
.user-block {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: #252526;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid #3d3d3d;
    border-left: 6px solid #3498db;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.user-block.nested-block {
    padding: 15px !important;
    margin-bottom: 15px !important;
    border-left: 2px solid #444 !important;
    background: rgba(255,255,255,0.03) !important;
    box-shadow: none !important;
    border-radius: 8px !important;
}

.user-block-diagram {
    text-align: center;
}

.chessboard, #board, #puzzle-board, #diagram-editor-board, .board-b72b1, .square-55d63 {
    touch-action: none !important;
    -webkit-user-select: none;
    user-select: none;
}

.highlight-square {
    box-shadow: inset 0 0 5px 5px #f1c40f !important;
    background-color: rgba(241, 196, 15, 0.3) !important;
}

.user-diagram-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin: 20px auto !important;
    width: 560px !important;
    min-width: 560px !important;
    max-width: 95% !important;
    box-sizing: border-box !important;
}

.user-columns {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 30px !important;
    align-items: flex-start !important;
}

.user-column {
    flex: 1;
    min-width: 0;
}

@media (max-width: 1000px) {
    .user-columns {
        grid-template-columns: 1fr !important;
    }
}

/* --- PRINT STYLES (A4) --- */
@media print {
    @page {
        size: A4;
        margin: 1.5cm;
    }

    body {
        background-color: white !important;
        color: black !important;
        padding-bottom: 0 !important;
    }

    .top-nav, 
    .app-footer, 
    .scroll-nav, 
    .header-left button,
    #lesson-leaderboard-section,
    .app-cookie-banner,
    .view-header button,
    .nav-btn,
    .icon-btn,
    button {
        display: none !important;
    }

    #lesson-view {
        padding-top: 0 !important;
        height: auto !important;
        background: white !important;
        display: block !important;
        overflow: visible !important;
        position: static !important;
    }

    .container-full {
        height: auto !important;
        display: block !important;
        padding-bottom: 0 !important;
    }

    main {
        background: white !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    #lesson-content-display {
        color: black !important;
        max-width: 100% !important;
    }

    h1, h2, h3, h4, h5, h6 {
        color: black !important;
        page-break-after: avoid;
    }

    p, .lesson-block {
        page-break-inside: avoid;
        margin-bottom: 15px;
    }

    .user-columns {
        display: block !important;
    }

    .user-columns > div {
        width: 100% !important;
        margin-bottom: 20px;
    }

    .diagram-container, .user-board {
        page-break-inside: avoid;
        margin: 20px auto;
        border: 1px solid #ccc !important;
        background: #f9f9f9 !important;
    }

    /* Inverting chessboard pieces for better printing if needed, 
       but standard pieces are usually fine. 
       Ensuring background of board is light. */
    .cg-wrap {
        background-color: #f0f0f0 !important;
    }

    .quill-editor, .ql-editor {
        color: black !important;
        background: transparent !important;
        padding: 0 !important;
    }

    .ql-tooltip {
        display: none !important;
    }
}


/* --- MOBILE HEADER & SANDWICH MENU --- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #252526;
    z-index: 1100;
    display: none; /* Controlled by media query */
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-logo {
    font-weight: bold;
    color: #f1c40f;
    font-size: 1.2rem;
    margin-left: 15px;
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    padding: 0;
    z-index: 1101;
}

.hamburger-btn span {
    width: 30px;
    height: 3px;
    background-color: #ecf0f1;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Animation for sandwich to X */
.hamburger-btn.open span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}
.hamburger-btn.open span:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.open span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

#lesson-content-display {
    padding: 40px;
}

@media (max-width: 1150px) {
    #lesson-content-display {
        padding: 20px 10px;
    }
    .mobile-header {
        display: flex;
    }

    .side-nav {
        top: 60px;
        left: 0;
        height: calc(100vh - 60px);
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
        z-index: 1150;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
        background-color: #1e1e1e;
        border-right: 1px solid rgba(255,255,255,0.1);
        padding: 5px 0;
        gap: 0;
        overflow-y: auto;
        overflow-x: hidden;
        align-items: flex-start !important;
    }

    .side-nav::-webkit-scrollbar {
        width: 4px;
    }

    .side-nav::-webkit-scrollbar-track {
        background: #1e1e1e;
    }

    .side-nav::-webkit-scrollbar-thumb {
        background: #333;
        border-radius: 2px;
    }

    .side-nav::-webkit-scrollbar-thumb:hover {
        background: #444;
    }

    .side-nav.mobile-open {
        transform: translateX(0);
    }

    /* Responsive adjustments for content */
    .trainer-layout {
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px !important;
    }

    #board-section {
        width: 100% !important;
        max-width: 500px;
        margin: 0 auto;
        border-right: none !important;
        border-bottom: 1px solid #333;
    }

    #puzzle-board, #diagram-editor-board, #board {
        width: 100% !important;
        max-width: 500px;
        height: auto !important;
    }

    .user-diagram-container {
        min-width: 0 !important;
        width: 95% !important;
        padding: 15px !important;
    }

    .selection-container {
        width: calc(100% - 20px) !important;
        margin: 10px auto !important;
    }

    .admin-full-width {
        width: calc(100% - 20px) !important;
        margin: 10px !important;
    }

    .menu-grid, .pgn-grid, .features-overview {
        grid-template-columns: 1fr !important;
    }

    .dashboard-stats-overview {
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    .dashboard-stats-overview .profile-card {
        width: 100% !important;
        max-width: none !important;
    }

    .dashboard-stats-overview .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .side-nav-toggle {
        display: none !important;
    }

    /* Override any collapsed width on mobile */
    .side-nav.collapsed {
        width: 280px !important;
        align-items: flex-start !important;
    }
    
    .side-nav-group-separator,
    .side-nav.collapsed .side-nav-group-separator {
        width: calc(100% - 30px) !important;
        margin: 8px 15px !important;
    }
    
    .side-nav-group-title,
    .side-nav.collapsed .side-nav-group-title {
        display: block !important;
        margin: 10px 15px 4px 15px !important;
    }
    
    .side-nav.collapsed .side-nav-item span:last-child {
        display: block !important;
        opacity: 1 !important;
    }

    .side-nav-spacer {
        display: none;
    }

    .side-nav-item span:first-child {
        justify-content: flex-start !important;
        min-width: 30px !important;
    }

    .side-nav-item {
        padding: 8px 15px;
        margin: 2px 8px;
        font-size: 1rem;
        justify-content: flex-start !important;
    }

    .side-nav.collapsed .side-nav-item {
        justify-content: flex-start !important;
        padding: 8px 15px !important;
    }

    /* Page content adjustment for mobile/tablet */
    .hero-section,
    .menu-section {
        padding: 40px 10px !important;
    }

    .view,
    .container-full,
    div.container-full,
    main.view {
        padding-left: 10px !important;
        padding-right: 10px !important;
        padding-top: 60px !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .user-block {
        padding: 20px 10px !important;
        font-size: 0.95rem !important;
        border-radius: 8px !important;
    }

    .view-header h1 {
        font-size: 1.5rem !important;
    }

    .user-diagram-container {
        padding: 15px 5px !important;
        width: 100% !important;
    }
    
    /* Overlay when menu is open */
    .menu-overlay {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.6);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(3px);
    }
    
    .menu-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-height: 700px) {
    .side-nav {
        height: 80vh;
        gap: 2px;
    }
    .side-nav-item {
        padding: 8px 10px;
    }
    .side-nav-item span:first-child {
        font-size: 1.2rem;
    }
    .side-nav-item span:last-child {
        font-size: 0.8rem;
    }
}

/* Threat Highlighting - FOND DE CASE (Glow) */
.threat-losing {
    box-shadow: inset 0 0 15px 5px rgba(231, 76, 60, 0.6) !important;
}
.threat-equal {
    box-shadow: inset 0 0 15px 5px rgba(230, 126, 34, 0.6) !important;
}
.threat-safe {
    box-shadow: inset 0 0 15px 5px rgba(46, 204, 113, 0.6) !important;
}

/* Marquages tactiques - ENTOURAGE (Bordures nettes) */
.threat-en-prise {
    border: 4px solid #e74c3c !important; /* Rouge pour le danger critique */
    box-sizing: border-box;
}
.tactical-fork {
    border: 4px solid rgba(155, 89, 182, 0.8) !important;
    box-sizing: border-box;
}
.tactical-pin {
    border: 4px solid rgba(52, 152, 219, 0.8) !important;
    box-sizing: border-box;
}
.tactical-skewer {
    border: 4px solid rgba(230, 126, 34, 0.8) !important;
    box-sizing: border-box;
}

.threat-value {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.7rem;
    padding: 1px 3px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 10;
}

.help-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: #34495e;
    color: #ecf0f1;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    position: relative;
    border: 1px solid #7f8c8d;
}

/* Modern Tooltips for Recommendation Cards and Progress Tables */
[data-tooltip]:not(.side-nav-item):not(.side-nav-toggle) {
    position: relative;
}

[data-tooltip]:not(.side-nav-item):not(.side-nav-toggle):hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: normal;
    width: 250px;
    z-index: 10000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.6);
    line-height: 1.4;
    text-align: center;
    pointer-events: none;
    white-space: normal;
}

[data-tooltip]:not(.side-nav-item):not(.side-nav-toggle):hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: #2c3e50 transparent transparent transparent;
    z-index: 10000;
}


.blunder-move {
    background-color: rgba(192, 57, 43, 0.5) !important;
}

.highlight-attacked {
    box-shadow: inset 0 0 0 4px #e74c3c !important;
}

.highlight-defending {
    box-shadow: inset 0 0 0 4px #2ecc71 !important;
}

.highlight-attacker {
    box-shadow: inset 0 0 0 4px #f1c40f !important;
}

/* Modern Horizontal Recommendation Cards */
.recommendations-grid {
    display: grid;
    grid-template-columns: 1fr; /* Full width for horizontal style */
    gap: 8px;
    max-height: 450px;
    overflow-y: auto;
    padding: 10px 5px;
}

.recommendation-card.horizontal-card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reco-left-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reco-theme-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #ecf0f1;
    min-width: 140px; /* Force consistent start for next items */
}

.reco-divider {
    width: 1px;
    height: 14px;
    background: #444;
    flex-shrink: 0;
}

.reco-info-item {
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.reco-info-item.tag-diff {
    color: #95a5a6;
    min-width: 15px;
    text-align: center;
}

.reco-info-item.tag-volume {
    color: #7f8c8d;
    font-weight: 500;
}

.reco-progress-container.mini {
    height: 3px;
    background: #111;
    border-radius: 2px;
    width: 100%;
}

.recommendation-card.horizontal-card:hover {
    background: #252525;
    border-color: #3498db;
    transform: translateX(5px);
}

/* Color coding for cards based on category */
#reco-to-improve .recommendation-card { border-left: 4px solid #e74c3c; }
#reco-learning .recommendation-card { border-left: 4px solid #f1c40f; }
#reco-unattempted .recommendation-card { border-left: 4px solid #95a5a6; }

/* Promotion Modal */
.promotion-modal-content {
    text-align: center;
    max-width: 400px;
}

.promotion-pieces {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}

.promotion-piece {
    width: 70px;
    height: 70px;
    background: #333;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s, transform 0.1s;
    border: 1px solid #444;
}

.promotion-piece:hover {
    background: #444;
    transform: scale(1.05);
    border-color: #2ecc71;
}

.promotion-piece img {
    width: 55px;
    height: 55px;
}








.coach-advice-card { 
    background: rgba(44, 44, 46, 0.8);
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 6px;
}
#coach-feedback { 
    margin-top: 10px;
}
#coach-feedback h4 { 
    margin-top: 0;
}
.coach-advice-card.favorable { background: rgba(46, 204, 113, 0.15) !important; border-left-color: #2ecc71 !important; } 
.coach-advice-card.caution { background: rgba(241, 196, 15, 0.1) !important; border-left-color: #f1c40f !important; }

/* Documentation Styles */
.faq-item h4 { margin-top: 25px; margin-bottom: 10px; }
.faq-item p { color: #bdc3c7; line-height: 1.6; }
.tab-content h2 { margin-bottom: 20px; color: #f1c40f; }
.tab-content h3 { margin-top: 30px; margin-bottom: 15px; color: #3498db; }
.info-card h4 { margin-top: 0; margin-bottom: 10px; } 

/* Documentation Layout */
.doc-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.doc-nav-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: rgba(44, 44, 46, 0.8);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: width 0.3s ease, padding 0.3s ease;
    border: 1px solid #333;
    position: sticky;
    top: 20px;
    height: fit-content;
    z-index: 10;
}

.doc-nav-sidebar.collapsed {
    width: 70px;
    padding: 15px 10px;
}

.doc-nav-sidebar .tab-btn {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    padding: 12px 15px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #ecf0f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.doc-nav-sidebar.collapsed .tab-btn {
    padding: 12px 0;
    justify-content: center;
}

.doc-nav-sidebar.collapsed .tab-btn span:not(.tab-icon) {
    display: none;
}

.doc-nav-sidebar .tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.doc-nav-sidebar .tab-btn.active {
    background: rgba(52, 152, 219, 0.2);
    border-color: #3498db;
    color: #3498db;
}

.doc-content-area {
    flex-grow: 1;
    background: rgba(44, 44, 46, 0.5);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #333;
    min-height: 500px;
}

.doc-sidebar-toggle {
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    color: #bdc3c7;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.doc-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 900px) {
    .doc-container {
        flex-direction: column;
    }
    .doc-nav-sidebar {
        width: 100% !important;
        flex-direction: row;
        overflow-x: auto;
        position: static;
        padding: 10px !important;
    }
    .doc-sidebar-toggle {
        display: none;
    }
    .doc-nav-sidebar .tab-btn {
        width: auto;
        padding: 8px 15px;
    }
    .doc-nav-sidebar.collapsed .tab-btn span:not(.tab-icon) {
        display: inline;
    }
}

/* Difficulty Tags */
.difficulty-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: capitalize;
    margin-top: 5px;
    border: 1px solid;
    vertical-align: middle;
    width: fit-content;
    align-self: flex-start;
}

.diff-debutant {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border-color: #2ecc71;
}

.diff-intermediaire {
    background-color: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
    border-color: #f1c40f;
}

.diff-avance {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-color: #e74c3c;
}

.cat-info, .pgn-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    width: 100%;
}

.cat-name, .pgn-name {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    text-align: left;
}

.user-category-summary {
    text-align: left;
    align-items: flex-start !important;
}

.user-pgn-card {
    align-items: flex-start !important;
    text-align: left !important;
}

.cta-developer {
    background: linear-gradient(135deg, #2c3e50 0%, #000 100%);
    border-top: 1px solid #3498db;
    padding: 30px 20px;
    text-align: center;
    margin-top: 40px;
    color: #ecf0f1;
}

.cta-developer h3 {
    color: #3498db;
    margin-bottom: 10px;
}

.cta-developer p {
    margin-bottom: 20px;
    opacity: 0.9;
}

.cta-btn-dev {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 10px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}

.cta-btn-dev:hover {
    background: #2980b9;
}

.credits-dev {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #95a5a6;
}

.credits-dev a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

/* Responsive Chessboard & Instructions */
.responsive-board {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}

.move-instruction {
    background: rgba(52, 152, 219, 0.1);
    border-left: 4px solid #3498db;
    padding: 12px 15px;
    margin: 15px 0;
    font-size: 0.95rem;
    color: #ecf0f1;
    border-radius: 4px;
    line-height: 1.4;
    text-align: left;
}

.move-instruction span {
    margin-right: 5px;
}

/* Tablet & Mobile Layout Fixes */
@media (max-width: 900px) {
    .trainer-layout {
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px !important;
    }
    
    .trainer-left, .trainer-right {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 600px !important;
    }
    
    .responsive-board {
        max-width: 90vw;
    }
    
    .container-full header {
        flex-direction: column;
        gap: 10px;
        padding: 15px !important;
    }
    
    .header-right {
        padding-right: 0 !important;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .move-instruction {
        font-size: 0.85rem;
        padding: 10px;
    }
    
    h1 {
        font-size: 1.5rem !important;
    }
    
    .side-nav {
        width: 100% !important;
        z-index: 1150;
    }
}
