/* Progress Circle Specific Classes - Scoped under .subjects-page */
.subjects-page .progress-circle.progress-68::before {
    background: conic-gradient(from 0deg, var(--accent, #00C853) 0%, var(--accent, #00C853) 68%, #e2e8f0 68%, #e2e8f0 100%);
}

.subjects-page .progress-circle.progress-72::before {
    background: conic-gradient(from 0deg, var(--accent, #00C853) 0%, var(--accent, #00C853) 72%, #e2e8f0 72%, #e2e8f0 100%);
}

.subjects-page .progress-circle.progress-85::before {
    background: conic-gradient(from 0deg, var(--accent, #00C853) 0%, var(--accent, #00C853) 85%, #e2e8f0 85%, #e2e8f0 100%);
}

/* Loading and Error States */
.subjects-page .loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.subjects-page .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary, #1A237E);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.subjects-page .error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.subjects-page .error-message {
    text-align: center;
    max-width: 400px;
}

.subjects-page .error-message i {
    font-size: 4rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

.subjects-page .error-message h3 {
    color: var(--primary, #1A237E);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.subjects-page .error-message p {
    color: #64748b;
    margin-bottom: 2rem;
}

.subjects-page .empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    padding: 2rem;
}

.subjects-page .empty-state-content {
    text-align: center;
    max-width: 400px;
}

.subjects-page .empty-state-content i {
    font-size: 4rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.subjects-page .empty-state-content h3 {
    color: var(--primary, #1A237E);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.subjects-page .empty-state-content p {
    color: #64748b;
}

/* Subjects Page Specific Styles */

/* View toggle removed - using grid view only */

/* Breadcrumb Styles */
.subjects-page .breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.9rem;
}

.subjects-page .breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.subjects-page .breadcrumb-item:hover {
    background: white;
    color: var(--primary, #1A237E);
}

.subjects-page .breadcrumb-item.active {
    color: var(--primary, #1A237E);
    font-weight: 600;
}

.subjects-page .breadcrumb-item:not(:last-child)::after {
    content: '/';
    color: #cbd5e1;
    margin-left: 0.75rem;
}

/* Subjects Grid */
.subjects-page .subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.subjects-page .subject-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 380px;
}

.subjects-page .subject-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: var(--primary, #1A237E);
}

/* Clickable card styles */
.subjects-page .subject-card.clickable {
    cursor: pointer;
    user-select: none;
}

.subjects-page .subject-card.clickable:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-color: var(--primary, #1A237E);
}

.subjects-page .subject-card.clickable:active {
    transform: translateY(-2px);
    transition: transform 0.1s ease;
}

/* Subject Header */
.subjects-page .subject-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

.subjects-page .subject-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary, #1A237E), #3949ab);
    color: white;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.subjects-page .subject-info {
    flex: 1;
}

.subjects-page .subject-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary, #1A237E);
}

.subjects-page .subject-info p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.subjects-page .subject-progress {
    position: relative;
    width: 50px;
    height: 50px;
}

.subjects-page .progress-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #e2e8f0;
}

.subjects-page .progress-circle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--accent, #00C853) 0%, var(--accent, #00C853) 50%, #e2e8f0 50%, #e2e8f0 100%);
}

.subjects-page .progress-circle::after {
    content: '';
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: white;
    position: absolute;
    z-index: 1;
}

.subjects-page .progress-circle span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary, #1A237E);
    z-index: 2;
    position: relative;
}

/* Subject Stats */
.subjects-page .subject-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    min-height: 60px;
    flex-shrink: 0;
}

.subjects-page .subject-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.subjects-page .subject-stats .stat i {
    font-size: 1.25rem;
    color: var(--primary, #1A237E);
}

.subjects-page .subject-stats .stat span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

/* Subject Actions */
.subjects-page .subject-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    justify-content: center;
}

.subjects-page .action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

.subjects-page .action-btn.centered {
    margin: 0 auto;
    min-width: 160px;
}

.subjects-page .action-btn.primary {
    background: linear-gradient(135deg, var(--primary, #1A237E), var(--accent, #00C853));
    color: white;
}

.subjects-page .action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3);
}

.subjects-page .action-btn.secondary {
    background: #f1f5f9;
    color: var(--primary, #1A237E);
    border: 1px solid #e2e8f0;
}

.subjects-page .action-btn.secondary:hover {
    background: #e2e8f0;
    border-color: var(--primary, #1A237E);
}

/* Subject Detail View */
.subjects-page .subject-detail {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.subjects-page .subject-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.subjects-page .subject-detail-info {
    display: flex;
    gap: 1.5rem;
    flex: 1;
}

.subjects-page .subject-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary, #1A237E), #3949ab);
    color: white;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.subjects-page .subject-meta h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary, #1A237E);
}

.subjects-page .subject-meta p {
    margin: 0 0 1rem 0;
    color: #64748b;
    font-size: 1.1rem;
}

.subjects-page .subject-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.subjects-page .badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #374151;
}

.subjects-page .badge.progress {
    background: linear-gradient(135deg, var(--accent, #00C853), #16a34a);
    color: white;
}

.subjects-page .subject-detail-actions {
    display: flex;
    gap: 1rem;
}

/* Topics Section */
.subjects-page .topics-section {
    margin-top: 2rem;
}

.subjects-page .topics-section h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary, #1A237E);
}

.subjects-page .topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.subjects-page .topic-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 200px;
}

.subjects-page .topic-card:hover {
    background: white;
    border-color: var(--primary, #1A237E);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.subjects-page .topic-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.subjects-page .topic-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary, #1A237E);
    margin: 0;
}

.subjects-page .topic-progress {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent, #00C853);
}

.subjects-page .topic-description {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    line-height: 1.5;
    flex: 1;
}

.subjects-page .topic-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.subjects-page .topic-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #64748b;
}

.subjects-page .topic-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.subjects-page .topic-btn {
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.subjects-page .topic-btn.primary {
    color: var(--primary, #1A237E);
    border-color: var(--primary, #1A237E);
}

.subjects-page .topic-btn.primary:hover {
    background: var(--primary, #1A237E);
    color: white;
}

.subjects-page .topic-btn.secondary {
    color: #64748b;
    border-color: #e2e8f0;
}

.subjects-page .topic-btn.secondary:hover {
    background: #f1f5f9;
    color: var(--primary, #1A237E);
    border-color: var(--primary, #1A237E);
}

/* Sub-Subjects Text */
.subjects-page .sub-subjects-text {
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid var(--primary, #1A237E);
}

.subjects-page .sub-subjects-text small {
    color: #64748b;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subjects-page .sub-subjects-text i {
    color: var(--primary, #1A237E);
}

/* Practice Mode Selection */
.subjects-page .practice-mode-selection {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.subjects-page .practice-mode-selection h3 {
    text-align: center;
    margin: 0 0 2rem 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary, #1A237E);
}

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

.subjects-page .mode-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.subjects-page .mode-card:hover {
    background: white;
    border-color: var(--primary, #1A237E);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.subjects-page .mode-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary, #1A237E), var(--accent, #00C853));
    color: white;
    font-size: 2.5rem;
    margin: 0 auto 1rem;
}

.subjects-page .mode-card h4 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary, #1A237E);
}

.subjects-page .mode-card p {
    margin: 0 0 1.5rem 0;
    color: #64748b;
    line-height: 1.6;
}

.subjects-page .mode-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.subjects-page .mode-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: #374151;
    font-size: 0.9rem;
}

.subjects-page .mode-features li i {
    color: var(--accent, #00C853);
    font-size: 1rem;
}

.subjects-page .mode-btn {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary, #1A237E), var(--accent, #00C853));
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.subjects-page .mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3);
}

/* Practice Mode Modal */
.subjects-page .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.subjects-page .modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.subjects-page .practice-mode-modal {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(-30px) scale(0.9);
    opacity: 0;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.subjects-page .modal-overlay.show .practice-mode-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
    transition: opacity 0.3s ease-out, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.subjects-page .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.subjects-page .modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary, #1A237E);
}

.subjects-page .modal-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.subjects-page .modal-close:hover {
    background: #e2e8f0;
    color: var(--primary, #1A237E);
}

.subjects-page .modal-body {
    padding: 2rem;
}

.subjects-page .mode-cards-modal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.subjects-page .mode-card-modal {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.subjects-page .mode-card-modal:hover {
    background: white;
    border-color: var(--primary, #1A237E);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.subjects-page .mode-icon-modal {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary, #1A237E), var(--accent, #00C853));
    color: white;
    font-size: 1.75rem;
    margin: 0 auto 1.5rem;
}

.subjects-page .mode-content h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary, #1A237E);
    text-align: center;
}

.subjects-page .mode-content p {
    margin: 0 0 1.5rem 0;
    color: #64748b;
    line-height: 1.5;
    text-align: center;
}

.subjects-page .mode-features-modal {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.subjects-page .mode-features-modal li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: #374151;
    font-size: 0.9rem;
}

.subjects-page .mode-features-modal li i {
    color: var(--accent, #00C853);
    font-size: 1rem;
    flex-shrink: 0;
}

.subjects-page .mode-btn-modal {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.subjects-page .mode-btn-modal.primary {
    background: linear-gradient(135deg, var(--primary, #1A237E), var(--accent, #00C853));
    color: white;
}

.subjects-page .mode-btn-modal.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3);
}

.subjects-page .mode-btn-modal.secondary {
    background: #f1f5f9;
    color: var(--primary, #1A237E);
    border: 2px solid #e2e8f0;
}

.subjects-page .mode-btn-modal.secondary:hover {
    background: #e2e8f0;
    border-color: var(--primary, #1A237E);
}

/* Modal Responsive Design */
@media (max-width: 768px) {
    .subjects-page .practice-mode-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .subjects-page .modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .subjects-page .modal-body {
        padding: 1.5rem;
    }
    
    .subjects-page .mode-cards-modal {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .subjects-page .mode-card-modal {
        padding: 1.5rem;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .subjects-page .subjects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .subjects-page .topics-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .subjects-page .subject-detail-header {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .subjects-page .subject-detail-actions {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .subjects-page .subjects-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .subjects-page .subjects-grid {
        grid-template-columns: 1fr;
    }
    
    .subjects-page .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .subjects-page .mode-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .subjects-page .subject-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .subjects-page .subject-stats {
        justify-content: space-around;
    }
    
    .subjects-page .subject-actions {
        flex-direction: column;
    }
    
    .subjects-page .subject-detail-info {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .subjects-page .subject-card {
        padding: 1.5rem;
    }
    
    .subjects-page .subject-detail {
        padding: 1.5rem;
    }
    
    .subjects-page .practice-mode-selection {
        padding: 1.5rem;
    }
    
    .subjects-page .mode-card {
        padding: 1.5rem;
    }
    
    .subjects-page .breadcrumb {
        padding: 0.75rem 1rem;
    }
    
    .subjects-page .subjects-header {
        padding: 1rem;
    }
}