/* Chess Academy - Frontend Styles */

.chess-academy-register-form,
.chess-academy-login-form {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.chess-academy-register-form h2,
.chess-academy-login-form h2 {
    margin-top: 0;
}

.chess-academy-register-form p,
.chess-academy-login-form p {
    margin-bottom: 15px;
}

.chess-academy-register-form label,
.chess-academy-login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.chess-academy-register-form input[type="text"],
.chess-academy-register-form input[type="email"],
.chess-academy-register-form input[type="tel"],
.chess-academy-register-form input[type="date"],
.chess-academy-register-form input[type="password"],
.chess-academy-register-form select,
.chess-academy-login-form input[type="email"],
.chess-academy-login-form input[type="password"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.chess-academy-qr-scanner {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
}

#qr-reader-frontend {
    margin: 20px auto;
}

#qr-result-frontend {
    margin-top: 20px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 5px;
}

.chess-academy-player-dashboard {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Play vs Computer */
.ca-game-area {
    display: grid;
    grid-template-columns: minmax(260px, 420px) 1fr;
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}

.ca-chessboard {
    width: 100%;
    max-width: 420px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.ca-game-status {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    font-size: 14px;
    color: #333;
}

.ca-status-line {
    margin-bottom: 8px;
}

.ca-play-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.ca-play-actions .button,
.ca-play-actions button {
    padding: 8px 14px;
}

.ca-highlight {
    box-shadow: inset 0 0 0 4px rgba(33, 150, 243, 0.45);
}

@media screen and (max-width: 900px) {
    .ca-game-area {
        grid-template-columns: 1fr;
    }
    .ca-chessboard {
        max-width: 100%;
    }
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .chess-academy-player-dashboard {
        padding: 15px;
        margin: 10px;
    }
    
    .chess-academy-player-dashboard h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }
}

.dashboard-quick-actions {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #2271b1;
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.quick-actions .button {
    padding: 10px 20px;
    text-decoration: none;
    display: inline-block;
}

/* Mobile Responsive for Quick Actions */
@media screen and (max-width: 768px) {
    .dashboard-quick-actions {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .quick-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .quick-actions .button {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }
}

.dashboard-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.dashboard-section:last-child {
    border-bottom: none;
}

.dashboard-section h3 {
    color: #2271b1;
    margin-top: 0;
}

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

/* Mobile Responsive for Stats Grid */
@media screen and (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-box {
        padding: 10px;
    }
    
    .stat-box h4 {
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}

.stat-box {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    border: 1px solid #ddd;
}

.stat-box h4 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
}

.stat-box .stat-value {
    margin: 0;
    font-size: 28px;
    font-weight: bold;
    color: #2271b1;
}

.recent-games-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.recent-games-table th,
.recent-games-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
}

.recent-games-table th {
    background: #f9f9f9;
    font-weight: 600;
}

/* Mobile Responsive for Tables */
@media screen and (max-width: 768px) {
    .recent-games-table {
        font-size: 14px;
    }
    
    .recent-games-table th,
    .recent-games-table td {
        padding: 8px 5px;
        font-size: 13px;
    }
    
    .recent-games-table th:nth-child(3),
    .recent-games-table td:nth-child(3),
    .recent-games-table th:nth-child(4),
    .recent-games-table td:nth-child(4) {
        display: none;
    }
    
    .recent-games-table .button {
        padding: 5px 10px;
        font-size: 12px;
    }
}

.chess-academy-tournaments {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
}

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

.tournament-card {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tournament-card h3 {
    margin-top: 0;
    color: #2271b1;
}

.chess-academy-leaderboard {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.leaderboard-table th {
    background: #f9f9f9;
    font-weight: 600;
    color: #2271b1;
}

.leaderboard-table tr:nth-child(even) {
    background: #f9f9f9;
}

.notice {
    padding: 10px;
    margin: 10px 0;
    border-radius: 3px;
}

.notice-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notice-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Lessons Styles */
.chess-academy-lessons {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.lessons-filters {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.lessons-filter-form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.lessons-filter-form label {
    font-weight: 600;
}

.lessons-filter-form select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

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

.lesson-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.lesson-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.lesson-card.completed {
    border-color: #46b450;
    background: #f0f9f0;
}

.lesson-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.lesson-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lesson-content {
    padding: 20px;
}

.lesson-content h3 {
    margin-top: 0;
    color: #2271b1;
}

.lesson-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
    font-size: 14px;
}

.lesson-meta span {
    padding: 3px 8px;
    background: #f0f0f0;
    border-radius: 3px;
    color: #666;
}

.lesson-meta .difficulty {
    background: #e3f2fd;
    color: #1976d2;
}

.lesson-description {
    color: #666;
    margin: 15px 0;
}

.lesson-progress {
    margin: 15px 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: #2271b1;
    transition: width 0.3s;
}

.progress-text {
    font-size: 12px;
    color: #666;
}

.lesson-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
}

.completed-badge {
    color: #46b450;
    font-weight: 600;
}

/* Lesson View Styles */
.chess-academy-lesson-view {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.lesson-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #2271b1;
}

.back-link {
    display: inline-block;
    margin-bottom: 10px;
    color: #2271b1;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.lesson-header h1 {
    margin: 10px 0;
    color: #2271b1;
}

.lesson-progress-bar {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.lesson-featured-image {
    margin: 20px 0;
}

.lesson-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.lesson-description,
.lesson-objectives,
.lesson-prerequisites {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
}

.lesson-objectives h3,
.lesson-prerequisites h3 {
    margin-top: 0;
    color: #2271b1;
}

.lesson-video {
    margin: 30px 0;
}

.lesson-video h3 {
    color: #2271b1;
}

.video-container {
    margin-top: 15px;
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.lesson-content {
    margin: 30px 0;
}

.lesson-content h3 {
    color: #2271b1;
}

.content-body {
    margin-top: 15px;
    line-height: 1.8;
}

.content-body p {
    margin-bottom: 15px;
}

.lesson-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

/* My Progress Styles */
.chess-academy-my-progress {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
}

.progress-stats {
    margin: 20px 0;
}

.progress-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.progress-table th,
.progress-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.progress-table th {
    background: #f9f9f9;
    font-weight: 600;
    color: #2271b1;
}

.progress-bar-small {
    width: 100px;
    height: 15px;
    background: #f0f0f0;
    border-radius: 7px;
    overflow: hidden;
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-in-progress {
    background: #fff3cd;
    color: #856404;
}

/* Record Game Styles */
.chess-academy-record-game {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.record-game-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.tab-button {
    padding: 10px 20px;
    background: #f9f9f9;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.tab-button:hover {
    background: #f0f0f0;
}

.tab-button.active {
    background: #fff;
    color: #2271b1;
    border-bottom-color: #2271b1;
}

.tab-content {
    display: none;
}

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

.chess-academy-form {
    margin-top: 20px;
}

.chess-academy-form h3,
.chess-academy-form h4 {
    color: #2271b1;
    margin-top: 20px;
    margin-bottom: 15px;
}

.chess-academy-form p {
    margin-bottom: 15px;
}

.chess-academy-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.chess-academy-form input[type="text"],
.chess-academy-form input[type="number"],
.chess-academy-form input[type="datetime-local"],
.chess-academy-form select,
.chess-academy-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.chess-academy-form .small-text {
    width: 100px;
}

.pending-games-table,
.games-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.pending-games-table th,
.pending-games-table td,
.games-table th,
.games-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.pending-games-table th,
.games-table th {
    background: #f9f9f9;
    font-weight: 600;
    color: #2271b1;
}

/* Modal Styles */
.chess-academy-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 15px;
}

.modal-close:hover {
    color: #000;
}

.modal-content h3 {
    margin-top: 0;
    color: #2271b1;
}

.modal-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.modal-content input[type="radio"] {
    margin-right: 5px;
}

.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-bottom: 15px;
}

/* My Games Styles */
.chess-academy-my-games {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.games-stats {
    margin: 20px 0;
}

.result-badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.result-win {
    background: #d4edda;
    color: #155724;
}

.result-loss {
    background: #f8d7da;
    color: #721c24;
}

.result-draw {
    background: #fff3cd;
    color: #856404;
}

/* Dashboard Tournaments */
.tournaments-grid-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

/* Mobile Responsive for Tournaments Grid */
@media screen and (max-width: 768px) {
    .tournaments-grid-dashboard {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .tournament-card-dashboard {
        padding: 12px;
    }
    
    .tournament-card-dashboard h4 {
        font-size: 16px;
    }
    
    .tournament-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .tournament-dates,
    .tournament-participants {
        font-size: 12px;
    }
}

.tournament-card-dashboard {
    background: #f9f9f9;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    border-left: 4px solid #2271b1;
}

.tournament-card-dashboard h4 {
    margin-top: 0;
    color: #2271b1;
    font-size: 16px;
}

.tournament-meta {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.tournament-meta span {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.tournament-type {
    background: #e3f2fd;
    color: #1976d2;
}

.tournament-status {
    background: #f0f0f0;
    color: #666;
}

.tournament-status.status-upcoming {
    background: #fff3cd;
    color: #856404;
}

.tournament-status.status-registration {
    background: #d1ecf1;
    color: #0c5460;
}

.tournament-status.status-active {
    background: #d4edda;
    color: #155724;
}

.tournament-description {
    color: #666;
    font-size: 14px;
    margin: 10px 0;
}

.tournament-dates {
    font-size: 13px;
    color: #666;
    margin: 10px 0;
}

.tournament-participants {
    font-size: 13px;
    color: #666;
    margin: 10px 0;
}

.tournament-card-dashboard .button {
    margin-top: 10px;
}

/* Interactive Quiz Styles */
.lesson-quiz {
    margin: 40px 0;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid #2271b1;
}

.lesson-quiz h3 {
    color: #2271b1;
    margin-top: 0;
}

.quiz-question {
    background: #fff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

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

.question-header h4 {
    margin: 0;
    color: #2271b1;
}

.answer-status {
    padding: 5px 12px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 14px;
}

.answer-status.correct {
    background: #d4edda;
    color: #155724;
}

.answer-status.incorrect {
    background: #f8d7da;
    color: #721c24;
}

.question-image {
    margin: 15px 0;
    text-align: center;
}

.question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.question-text {
    font-size: 16px;
    font-weight: 600;
    margin: 15px 0;
    color: #333;
}

.question-options {
    margin: 15px 0;
}

.option-label {
    display: block;
    padding: 12px;
    margin: 8px 0;
    background: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.option-label:hover {
    background: #f0f0f0;
    border-color: #2271b1;
}

.option-label input[type="radio"] {
    margin-right: 10px;
}

.option-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #2271b1;
}

.option-label:has(input[type="radio"]:checked) {
    background: #e3f2fd;
    border-color: #2271b1;
}

.correct-indicator {
    margin-left: 10px;
    color: #46b450;
    font-weight: 600;
}

.short-answer-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.short-answer-input:focus {
    outline: none;
    border-color: #2271b1;
}

.correct-answer {
    margin-top: 10px;
    padding: 10px;
    background: #d4edda;
    border-radius: 5px;
    color: #155724;
}

.question-explanation {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 5px;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.quiz-results {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    text-align: center;
    border: 2px solid #2271b1;
}

.quiz-results h4 {
    color: #2271b1;
    font-size: 24px;
    margin: 0 0 10px 0;
}

#submit-quiz-btn {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 16px;
}

/* Image Gallery Styles */
.lesson-gallery {
    margin: 30px 0;
}

.lesson-gallery h3 {
    color: #2271b1;
    margin-bottom: 20px;
}

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

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Image Modal */
#image-modal {
    z-index: 9999;
}

#image-modal img {
    max-height: 90vh;
    object-fit: contain;
}

.close-modal {
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #fff !important;
}

/* Age Group Badges */
.lesson-meta .age-group {
    background: #f3e5f5;
    color: #7b1fa2;
}

.lesson-meta .age-group.kids {
    background: #fff3e0;
    color: #e65100;
}

.lesson-meta .age-group.teens {
    background: #e8f5e9;
    color: #2e7d32;
}

.lesson-meta .age-group.adults {
    background: #e3f2fd;
    color: #1565c0;
}

/* Mobile Responsive for Quiz */
@media screen and (max-width: 768px) {
    .lesson-quiz {
        padding: 15px;
    }
    
    .quiz-question {
        padding: 15px;
    }
    
    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .option-label {
        padding: 10px;
        font-size: 14px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .gallery-item img {
        height: 150px;
    }
}

/* Unified Dashboard Styles */
.chess-academy-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #fafafa;
    min-height: 100vh;
}

.ca-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.ca-header-left h1.ca-logo {
    margin: 0 0 5px 0;
    font-size: 32px;
    color: #7b2cbf;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ca-crown {
    font-size: 36px;
}

.ca-tagline {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.ca-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ca-points-display {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.ca-star {
    font-size: 24px;
}

.ca-theme-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.ca-tab-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.ca-tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.ca-tab-btn:hover {
    color: #7b2cbf;
    background: #f5f5f5;
}

.ca-tab-btn.active {
    color: #7b2cbf;
    border-bottom-color: #7b2cbf;
    background: #fff;
    border-radius: 8px 8px 0 0;
}

.ca-tab-icon {
    font-size: 20px;
}

.ca-tab-panels {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    min-height: 500px;
}

.ca-tab-panel {
    display: none;
}

.ca-tab-panel.active {
    display: block;
}

.ca-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.ca-section-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ca-section-icon {
    font-size: 28px;
}

.ca-section-subtitle {
    margin: 10px 0 0 0;
    color: #666;
    font-size: 14px;
}

.ca-progress-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #666;
    font-size: 14px;
}

.ca-points-badge {
    background: #7b2cbf;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Lessons Grid */
.ca-lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ca-lesson-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s;
    position: relative;
}

.ca-lesson-card:hover {
    border-color: #7b2cbf;
    box-shadow: 0 4px 12px rgba(123, 44, 191, 0.15);
    transform: translateY(-2px);
}

.ca-lesson-card.ca-locked {
    opacity: 0.7;
    background: #f9f9f9;
}

.ca-lesson-icon {
    font-size: 48px;
    text-align: center;
}

.ca-lesson-content {
    flex: 1;
}

.ca-lesson-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ca-lock-icon {
    font-size: 16px;
}

.ca-lesson-description {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.ca-difficulty-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.ca-difficulty-badge.ca-beginner,
.ca-difficulty-badge.ca-easy {
    background: #4caf50;
}

.ca-difficulty-badge.ca-intermediate,
.ca-difficulty-badge.ca-medium {
    background: #ff9800;
}

.ca-difficulty-badge.ca-expert,
.ca-difficulty-badge.ca-hard {
    background: #f44336;
}

.ca-lesson-link {
    display: inline-block;
    padding: 10px 20px;
    background: #7b2cbf;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    transition: background 0.3s;
}

.ca-lesson-link:hover {
    background: #6a1b9a;
}

/* Practice Drills */
.ca-drills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ca-drill-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s;
}

.ca-drill-card:hover {
    border-color: #7b2cbf;
    box-shadow: 0 4px 12px rgba(123, 44, 191, 0.15);
}

.ca-drill-icon {
    font-size: 48px;
    text-align: center;
}

.ca-drill-title {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.ca-drill-description {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.ca-drill-btn {
    padding: 10px 20px;
    background: #7b2cbf;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.ca-drill-btn:hover {
    background: #6a1b9a;
}

/* Puzzles */
.ca-daily-puzzle-card {
    background: linear-gradient(135deg, #7b2cbf 0%, #9d4edd 100%);
    color: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 12px rgba(123, 44, 191, 0.3);
}

.ca-daily-icon {
    font-size: 48px;
}

.ca-daily-content {
    flex: 1;
}

.ca-daily-content h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
}

.ca-daily-content p {
    margin: 0;
    opacity: 0.9;
}

.ca-play-btn {
    padding: 12px 24px;
    background: #ff6b35;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.ca-play-btn:hover {
    background: #e55a2b;
}

.ca-puzzle-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.ca-filter-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.ca-filter-btn:hover {
    border-color: #7b2cbf;
    background: #fff;
}

.ca-filter-btn.active {
    background: #7b2cbf;
    color: #fff;
    border-color: #7b2cbf;
}

.ca-puzzles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ca-puzzle-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s;
}

.ca-puzzle-card:hover {
    border-color: #7b2cbf;
    box-shadow: 0 4px 12px rgba(123, 44, 191, 0.15);
}

.ca-puzzle-card.ca-solved {
    border-color: #4caf50;
    background: #f1f8f4;
}

.ca-puzzle-icon {
    font-size: 40px;
    text-align: center;
}

.ca-puzzle-title {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.ca-puzzle-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ca-puzzle-type-badge {
    padding: 4px 10px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.ca-solved-badge {
    padding: 6px 12px;
    background: #4caf50;
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.ca-puzzle-btn {
    padding: 10px 20px;
    background: #7b2cbf;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.ca-puzzle-btn:hover {
    background: #6a1b9a;
}

/* Play Tab */
.ca-play-card {
    max-width: 600px;
    margin: 40px auto;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
}

.ca-robot-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.ca-play-card h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.ca-play-card > p {
    margin: 0 0 30px 0;
    color: #666;
}

.ca-play-options {
    margin: 30px 0;
    text-align: left;
}

.ca-option-group {
    margin-bottom: 20px;
}

.ca-option-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: #333;
}

.ca-color-options {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.ca-color-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.ca-color-btn.active {
    background: #7b2cbf;
    color: #fff;
    border-color: #7b2cbf;
}

.ca-hints-toggle {
    width: 40px;
    height: 20px;
    cursor: pointer;
}

.ca-start-game-btn {
    padding: 15px 40px;
    background: #7b2cbf;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin: 20px 0;
}

.ca-start-game-btn:hover {
    background: #6a1b9a;
}

.ca-game-stats {
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

/* Progress Tab */
.ca-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.ca-progress-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
}

.ca-progress-card:hover {
    border-color: #7b2cbf;
    box-shadow: 0 4px 12px rgba(123, 44, 191, 0.15);
}

.ca-progress-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.ca-progress-value {
    font-size: 36px;
    font-weight: bold;
    color: #7b2cbf;
    margin-bottom: 10px;
}

.ca-progress-label {
    color: #666;
    font-size: 14px;
    font-weight: 600;
}

.ca-points-icon { color: #ffc107; }
.ca-streak-icon { color: #ff6b35; }
.ca-puzzles-icon { color: #20b2aa; }
.ca-games-icon { color: #4caf50; }

.ca-lessons-progress-section {
    margin-top: 40px;
}

.ca-lessons-progress-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ca-lessons-progress-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ca-lesson-progress-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
}

.ca-lesson-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ca-lesson-name {
    font-weight: 600;
    color: #333;
}

.ca-lesson-percentage {
    font-weight: 600;
    color: #7b2cbf;
}

.ca-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.ca-progress-fill {
    height: 100%;
    background: #7b2cbf;
    transition: width 0.3s;
    border-radius: 4px;
}

.ca-empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .chess-academy-dashboard {
        padding: 10px;
    }
    
    .ca-dashboard-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .ca-tab-navigation {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ca-tab-btn {
        white-space: nowrap;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .ca-tab-panels {
        padding: 15px;
    }
    
    .ca-lessons-grid,
    .ca-drills-grid,
    .ca-puzzles-grid {
        grid-template-columns: 1fr;
    }
    
    .ca-progress-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ca-play-card {
        padding: 20px;
    }
}
