/* Student-facing Styles - Doroos Platform */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Tajawal:wght@400;500;700&display=swap');

:root {
    --teal: #0E9488;
    --teal-light: #5eead4;
    --terra: #E85D2F;
    --gold: #F5A524;
    --sky: #0EA5E9;
    --grape: #8B5CF6;
    --rose: #F43F5E;
    --bg: #FFF8EE;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-light: #6b7280;
    --shadow: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 24px;
    --radius-sm: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.logo-icon { font-size: 28px; }
.logo-text {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 22px;
    background: linear-gradient(135deg, var(--teal), var(--sky));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links { display: flex; gap: 8px; }
.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s;
}
.nav-links a:hover { color: var(--teal); background: #f0fdfa; }

/* Main */
.main-content {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
    width: 100%;
}

/* Hero */
.hero {
    text-align: center;
    padding: 48px 20px;
}

.hero-title {
    font-family: 'Cairo', sans-serif;
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--teal), var(--sky));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(16px, 2.5vw, 20px);
    color: var(--text-light);
    max-width: 500px;
    margin: 0 auto;
}

/* Grades Grid */
.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.grade-card {
    position: relative;
    border-radius: var(--radius);
    padding: 40px 28px;
    text-align: center;
    color: white;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow);
}

.grade-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.grade-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.grade-card-1 { background: linear-gradient(135deg, #0E9488, #0EA5E9); }
.grade-card-2 { background: linear-gradient(135deg, #F5A524, #E85D2F); }
.grade-card-3 { background: linear-gradient(135deg, #8B5CF6, #F43F5E); }

.grade-card-icon {
    font-size: 56px;
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.grade-card-name {
    font-family: 'Cairo', sans-serif;
    font-size: 24px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    margin-bottom: 4px;
}

.grade-card-count {
    font-size: 14px;
    opacity: 0.85;
    position: relative;
    z-index: 1;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    font-size: 15px;
}

.breadcrumb a {
    color: var(--teal);
    text-decoration: none;
    font-weight: 500;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #d1d5db; }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* Section Title */
.section-title {
    font-family: 'Cairo', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Semester Cards */
.semesters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

.semester-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 3px solid transparent;
}

.semester-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--teal);
}

.semester-card.active {
    border-color: var(--teal);
    background: #f0fdfa;
}

.semester-icon { font-size: 40px; margin-bottom: 10px; }
.semester-name {
    font-family: 'Cairo', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

/* Subject Cards */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.subject-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 24px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 3px solid transparent;
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.subject-card.active { background: #f8f9fa; }

.subject-icon { font-size: 36px; margin-bottom: 8px; }
.subject-name {
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.subject-count {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Lessons List */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.lesson-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lesson-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.lesson-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.lesson-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.lesson-card-title {
    font-family: 'Cairo', sans-serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.lesson-card-desc {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

.lesson-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lesson-card .btn-start {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    color: white;
    transition: all 0.2s;
}

.lesson-card .btn-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty-state p { color: var(--text-light); font-size: 18px; }

/* View Page */
.view-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
    z-index: 1000;
}

.view-topbar {
    background: white;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.view-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--teal);
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.view-back:hover { background: #f0fdfa; }

.view-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.view-title {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 16px;
}

.view-meta { color: var(--text-light); font-size: 13px; }

.view-topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-fullscreen {
    padding: 6px 12px;
    border-radius: 8px;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.btn-fullscreen:hover { background: #e5e7eb; }

.view-iframe {
    flex: 1;
    border: none;
    width: 100%;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-light);
    font-size: 14px;
    margin-top: auto;
}

.footer-credit {
    margin-top: 6px;
    font-size: 13px;
    color: #9ca3af;
}

.footer-credit strong {
    color: var(--teal);
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container { padding: 0 16px; }
    .main-content { padding: 20px 16px; }
    .hero { padding: 32px 12px; }
    .grades-grid { grid-template-columns: 1fr; }
    .subjects-grid { grid-template-columns: repeat(2, 1fr); }
    .lessons-grid { grid-template-columns: 1fr; }
    .grade-card { padding: 28px 20px; }
    .view-topbar { padding: 0 12px; height: 48px; }
    .view-title { font-size: 14px; }
    .view-meta { display: none; }
}

@media (max-width: 480px) {
    .subjects-grid { grid-template-columns: 1fr; }
    .breadcrumb { font-size: 13px; }
}
