/* ===================================
   COURSES PAGE STYLES
   =================================== */

.page-header {
    background: white;
    padding: 30px 20px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.page-header .container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    text-align: center;
    padding: 0 100px;
}

.page-header .back-link {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.page-header .back-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-50%) translateX(-3px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.page-header .back-link i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.page-header .back-link:hover i {
    transform: translateX(-2px);
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    margin-top: 0;
    color: var(--primary-dark);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-header p {
    font-size: 1rem;
    color: var(--text-color);
    margin: 0;
}

/* ===================================
   MATERIAL SELECTION - 2 CARD LAYOUT
   =================================== */

.material-selection {
    padding: 30px 20px;
}

.material-selection .container {
    max-width: 1100px;
    margin: 0 auto;
}

.material-grid {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 1.25rem;
    align-items: stretch;
}

.material-card {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.material-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

/* Card Badges */
.card-badge {
    position: absolute;
    top: 8px;
    right: -28px;
    padding: 2px 30px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    transform: rotate(45deg);
    letter-spacing: 0.5px;
}

.card-badge.free {
    background: #22C55E;
    color: white;
}

.card-badge.popular {
    background: var(--primary-color);
    color: white;
}

/* Popular Card Highlight */
.popular-card {
    border: 2px solid var(--primary-color);
}

.material-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.5rem;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.free-card .material-icon {
    background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
}

.material-card h3 {
    color: var(--dark-color);
    margin-bottom: 0.1rem;
    font-size: 1rem;
}

.material-subtitle {
    color: var(--text-color);
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
}

/* Pricing */
.material-price {
    margin: 0.3rem 0;
}

.material-price .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.material-price.free .price {
    color: #22C55E;
}

/* Feature List */
.material-features {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
    text-align: left;
}

.material-features li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0;
    color: var(--text-color);
    font-size: 0.8rem;
    border-bottom: 1px solid #f1f5f9;
}

.material-features li:last-child {
    border-bottom: none;
}

.material-features i {
    color: #22C55E;
    font-size: 0.7rem;
}

/* Section Preview - Horizontal layout */
.section-preview {
    text-align: left;
    margin: 0.5rem 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.section-item {
    background: #f8fafc;
    border-radius: 6px;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
}

.section-header i {
    font-size: 0.65rem;
}

.section-topics {
    list-style: none;
    padding: 0.2rem 0;
    margin: 0;
}

.section-topics li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.68rem;
    color: var(--text-color);
    border-bottom: 1px solid #e2e8f0;
}

.section-topics li:last-child {
    border-bottom: none;
}

.section-topics li i {
    color: var(--primary-color);
    font-size: 0.55rem;
}

.login-note {
    font-size: 0.7rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    padding: 0.3rem 0.5rem;
    background: #fef3c7;
    border-radius: 4px;
}

.login-note i {
    color: #F59E0B;
    margin-right: 0.2rem;
}

.start-material {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 900px) {
    .material-grid {
        grid-template-columns: 1fr;
    }
    
    .section-preview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 20px 15px;
    }

    .page-header .container {
        padding: 0 15px;
        text-align: left;
    }
    
    .page-header .back-link {
        position: relative;
        left: 0;
        top: 0;
        transform: none;
        margin-bottom: 1rem;
        display: inline-flex;
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    .material-selection {
        padding: 20px 15px;
    }

    .material-card {
        padding: 1rem;
    }

    .material-card h3 {
        font-size: 1.1rem;
    }

    .feature-list li {
        font-size: 0.85rem;
    }

    .start-material {
        padding: 0.6rem 1rem;
    }
}
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.viewer-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-color);
    color: white;
    border-radius: 15px 15px 0 0;
}

.viewer-header h3 {
    font-size: 1.5rem;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.viewer-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    line-height: 1.8;
}

.viewer-body h3 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.viewer-body h3:first-child {
    margin-top: 0;
}

.viewer-body p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.viewer-body ul, .viewer-body ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.viewer-body li {
    margin-bottom: 0.5rem;
}

.viewer-body code {
    background: var(--light-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
}

.viewer-body pre {
    background: var(--dark-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.viewer-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.protection-notice {
    background: #FEF3C7;
    border-left: 4px solid var(--accent-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.protection-notice i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

/* Content Layout Responsive Design */
@media (max-width: 968px) {
    .content-layout {
        grid-template-columns: 1fr;
    }

    .course-sidebar {
        position: relative;
        top: 0;
    }

    .subject-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .subject-list {
        grid-template-columns: 1fr;
    }

    .topic-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }

    .viewer-header {
        padding: 1rem 1.25rem;
    }

    .viewer-header h3 {
        font-size: 1.1rem;
    }

    .viewer-body {
        padding: 1.25rem;
    }

    .viewer-footer {
        padding: 1rem 1.25rem;
        flex-direction: column;
    }

    .viewer-footer button {
        width: 100%;
    }

    .protection-notice {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .topic-card h4 {
        font-size: 0.95rem;
    }

    .close-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .viewer-header h3 {
        font-size: 1rem;
    }
}

/* ===================================
   ENHANCED MOBILE STYLES - COURSES
   =================================== */
@media (max-width: 768px) {
    /* Material Selection Mobile */
    .material-selection {
        padding: 15px;
    }
    
    .material-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .material-card {
        padding: 1.25rem;
    }
    
    .material-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .material-card h3 {
        font-size: 1.15rem;
    }
    
    .material-subtitle {
        font-size: 0.8rem;
    }
    
    .material-price .price {
        font-size: 1.75rem;
    }
    
    .material-features li {
        font-size: 0.85rem;
        padding: 0.3rem 0;
    }
    
    /* Section Preview Mobile */
    .section-preview {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .section-header {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
    
    .section-topics li {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }
    
    .start-material {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Card Badge Mobile */
    .card-badge {
        font-size: 0.55rem;
        padding: 2px 25px;
        right: -30px;
        top: 10px;
    }
    
    /* Content Viewer Mobile */
    .content-viewer {
        border-radius: 0;
        max-height: 100vh;
    }
    
    .viewer-header {
        padding: 1rem;
        border-radius: 0;
    }
    
    .viewer-body {
        padding: 1rem;
    }
    
    .viewer-body h3 {
        font-size: 1.1rem;
    }
    
    .viewer-body p,
    .viewer-body li {
        font-size: 0.9rem;
    }
    
    .viewer-body pre {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
    
    .viewer-footer {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .viewer-footer .btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .material-card {
        padding: 1rem;
    }
    
    .material-card h3 {
        font-size: 1rem;
    }
    
    .material-price .price {
        font-size: 1.5rem;
    }
    
    .section-topics li {
        font-size: 0.7rem;
    }
    
    .viewer-header h3 {
        font-size: 0.95rem;
    }
    
    .close-btn {
        width: 32px;
        height: 32px;
    }
}