/* ==========================================================================
   Azael Haward Academy - Main Stylesheet
   learn.azaelhaward.com
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
    --color-navy: #1a2332;
    --color-navy-dark: #131a26;
    --color-navy-light: #243044;
    --color-navy-hover: #1f2c3f;
    --color-gold: #c9a96e;
    --color-gold-dark: #b8964f;
    --color-gold-light: #d4bc8a;
    --color-gold-hover: #d4b87a;
    --color-cream: #faf8f5;
    --color-cream-dark: #f0ece5;
    --color-white: #ffffff;
    --color-text: #1a2332;
    --color-text-light: #4a5568;
    --color-text-muted: #718096;
    --color-border: #e2e0dc;
    --color-border-light: #eeedea;
    --color-success: #38a169;
    --color-success-bg: #f0fff4;
    --color-error: #e53e3e;
    --color-error-bg: #fff5f5;
    --color-warning: #d69e2e;
    --color-warning-bg: #fffff0;
    --color-info: #3182ce;
    --color-info-bg: #ebf8ff;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;

    --shadow-sm: 0 1px 2px rgba(26, 35, 50, 0.05);
    --shadow: 0 1px 3px rgba(26, 35, 50, 0.08), 0 1px 2px rgba(26, 35, 50, 0.06);
    --shadow-md: 0 4px 6px rgba(26, 35, 50, 0.07), 0 2px 4px rgba(26, 35, 50, 0.06);
    --shadow-lg: 0 10px 15px rgba(26, 35, 50, 0.08), 0 4px 6px rgba(26, 35, 50, 0.05);
    --shadow-xl: 0 20px 25px rgba(26, 35, 50, 0.1), 0 10px 10px rgba(26, 35, 50, 0.04);

    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;

    --container-max: 1200px;
    --sidebar-width: 260px;
    --header-height: 64px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

img, svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--color-navy);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-gold);
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-navy);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

p:last-child {
    margin-bottom: 0;
}

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1.5rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex {
    display: flex;
    align-items: center;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-col {
    flex-direction: column;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ---------- Navigation ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
}

.navbar {
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-navy);
    letter-spacing: -0.01em;
}

.brand-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--color-gold);
    color: var(--color-navy);
    border-radius: var(--radius-full);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    z-index: 1001;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-navy);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-light);
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--color-navy);
    background: var(--color-cream);
}

.nav-link.active {
    color: var(--color-navy);
    background: var(--color-cream);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

.btn-primary {
    background: var(--color-navy);
    color: var(--color-white);
    border-color: var(--color-navy);
}

.btn-primary:hover {
    background: var(--color-navy-light);
    border-color: var(--color-navy-light);
    color: var(--color-white);
}

.btn-gold {
    background: var(--color-gold);
    color: var(--color-navy);
    border-color: var(--color-gold);
}

.btn-gold:hover {
    background: var(--color-gold-hover);
    border-color: var(--color-gold-hover);
    color: var(--color-navy);
}

.btn-outline {
    background: transparent;
    color: var(--color-navy);
    border-color: var(--color-border);
}

.btn-outline:hover {
    background: var(--color-cream);
    border-color: var(--color-navy);
    color: var(--color-navy);
}

.btn-danger {
    background: var(--color-error);
    color: var(--color-white);
    border-color: var(--color-error);
}

.btn-danger:hover {
    background: #c53030;
    border-color: #c53030;
    color: var(--color-white);
}

.btn-success {
    background: var(--color-success);
    color: var(--color-white);
    border-color: var(--color-success);
}

.btn-success:hover {
    background: #2f855a;
    border-color: #2f855a;
    color: var(--color-white);
}

.btn-ghost {
    background: transparent;
    color: var(--color-navy);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--color-cream);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius);
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-gold);
    padding: 0;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn-link:hover {
    color: var(--color-gold-dark);
}

/* ---------- Hero Sections ---------- */
.hero {
    padding: 5rem 0;
    background: var(--color-navy);
    color: var(--color-white);
    text-align: center;
}

.hero h1 {
    color: var(--color-white);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero h2 {
    color: var(--color-gold);
    font-size: 1.125rem;
    font-weight: 400;
    font-family: var(--font-body);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero .btn {
    margin: 0.25rem;
}

.hero-small {
    padding: 3rem 0;
}

.hero-small h1 {
    font-size: 2rem;
}

.hero-inverted {
    background: var(--color-cream);
    color: var(--color-navy);
}

.hero-inverted h1 {
    color: var(--color-navy);
}

/* ---------- Sections ---------- */
.section {
    padding: 4rem 0;
}

.section-sm {
    padding: 2rem 0;
}

.section-lg {
    padding: 6rem 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}

/* ---------- Cards ---------- */
.card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border-light);
    background: var(--color-cream);
}

/* ---------- Course Cards ---------- */
.course-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow var(--transition-slow), transform var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.course-card-image {
    position: relative;
    padding-top: 56.25%;
    background: var(--color-navy);
    overflow: hidden;
}

.course-card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-card-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-gold);
    color: var(--color-navy);
    border-radius: var(--radius-full);
}

.course-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-card-title {
    font-size: 1.1rem;
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.course-card-title a {
    color: var(--color-navy);
}

.course-card-title a:hover {
    color: var(--color-gold);
}

.course-card-desc {
    color: var(--color-text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border-light);
}

.course-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.course-card-price {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-gold-dark);
}

.course-card-price.free {
    color: var(--color-success);
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.4rem;
}

.form-label .required {
    color: var(--color-error);
    margin-left: 0.15rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-white);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--color-cream-dark);
    opacity: 0.7;
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--color-error);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5568' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
}

.form-text {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.35rem;
}

.form-error {
    font-size: 0.8rem;
    color: var(--color-error);
    margin-top: 0.35rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-navy);
    cursor: pointer;
}

.form-check label {
    font-size: 0.9rem;
    color: var(--color-text-light);
    cursor: pointer;
}

/* ---------- Dashboard Cards ---------- */
.stat-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.navy {
    background: rgba(26, 35, 50, 0.08);
    color: var(--color-navy);
}

.stat-icon.gold {
    background: rgba(201, 169, 110, 0.15);
    color: var(--color-gold-dark);
}

.stat-icon.success {
    background: rgba(56, 161, 105, 0.1);
    color: var(--color-success);
}

.stat-icon.info {
    background: rgba(49, 130, 206, 0.1);
    color: var(--color-info);
}

.stat-info h3 {
    font-size: 1.75rem;
    font-family: var(--font-body);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ---------- Tables ---------- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    background: var(--color-cream);
    white-space: nowrap;
}

.table tbody tr:hover {
    background: var(--color-cream);
}

.table td {
    color: var(--color-text-light);
    vertical-align: middle;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
    line-height: 1.5;
}

.badge-navy {
    background: rgba(26, 35, 50, 0.08);
    color: var(--color-navy);
}

.badge-gold {
    background: rgba(201, 169, 110, 0.2);
    color: var(--color-gold-dark);
}

.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-error {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.badge-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.badge-outline {
    background: transparent;
    border: 1.5px solid currentColor;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.5;
    position: relative;
}

.alert-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
}

.alert-close:hover {
    opacity: 1;
}

.alert-success {
    background: var(--color-success-bg);
    color: #276749;
    border: 1px solid rgba(56, 161, 105, 0.2);
}

.alert-error {
    background: var(--color-error-bg);
    color: #9b2c2c;
    border: 1px solid rgba(229, 62, 62, 0.2);
}

.alert-warning {
    background: var(--color-warning-bg);
    color: #975a16;
    border: 1px solid rgba(214, 158, 46, 0.2);
}

.alert-info {
    background: var(--color-info-bg);
    color: #2b6cb0;
    border: 1px solid rgba(49, 130, 206, 0.2);
}

/* ---------- Progress Bars ---------- */
.progress {
    height: 8px;
    background: var(--color-cream-dark);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--color-gold);
    transition: width 0.5s ease;
}

.progress-bar-navy {
    background: var(--color-navy);
}

.progress-bar-success {
    background: var(--color-success);
}

.progress-lg {
    height: 12px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
}

/* ---------- Quiz Styling ---------- */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-light);
}

.quiz-progress {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.quiz-timer {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-navy);
    padding: 0.4rem 1rem;
    background: var(--color-cream);
    border-radius: var(--radius-full);
}

.quiz-question {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.quiz-question-text {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.quiz-question-number {
    color: var(--color-gold-dark);
    font-weight: 600;
    margin-right: 0.5rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.quiz-option:hover {
    border-color: var(--color-gold);
    background: rgba(201, 169, 110, 0.04);
}

.quiz-option input[type="radio"],
.quiz-option input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--color-navy);
    flex-shrink: 0;
}

.quiz-option.selected {
    border-color: var(--color-navy);
    background: rgba(26, 35, 50, 0.04);
}

.quiz-option.correct {
    border-color: var(--color-success);
    background: var(--color-success-bg);
}

.quiz-option.incorrect {
    border-color: var(--color-error);
    background: var(--color-error-bg);
}

.quiz-option-text {
    font-size: 0.95rem;
    color: var(--color-text);
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-light);
}

.quiz-results {
    text-align: center;
    padding: 3rem 1.5rem;
}

.quiz-score {
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-navy);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.quiz-score-label {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

/* ---------- Certificate Styling ---------- */
.certificate-preview {
    background: var(--color-white);
    border: 3px solid var(--color-gold);
    border-radius: var(--radius-md);
    padding: 3rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.certificate-preview::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid var(--color-gold-light);
    border-radius: var(--radius);
    pointer-events: none;
}

.certificate-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-navy);
    margin-bottom: 2rem;
}

.certificate-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--color-navy);
    margin-bottom: 0.5rem;
}

.certificate-subtitle {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.certificate-name {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-gold-dark);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.certificate-course {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.certificate-date {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.certificate-footer {
    display: flex;
    justify-content: space-around;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-light);
}

.certificate-signature {
    text-align: center;
}

.certificate-signature-line {
    width: 150px;
    border-bottom: 1px solid var(--color-navy);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
}

.certificate-signature-name {
    font-size: 0.8rem;
    font-weight: 500;
}

.certificate-signature-title {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ---------- Page Header ---------- */
.page-header {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--color-text-muted);
    font-size: 1.05rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--color-text-muted);
}

.breadcrumb a:hover {
    color: var(--color-navy);
}

.breadcrumb-sep {
    color: var(--color-border);
}

/* ---------- Empty States ---------- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    color: var(--color-text-muted);
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Loading States ---------- */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-navy);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.spinner-gold {
    border-top-color: var(--color-gold);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--color-cream-dark) 25%, var(--color-cream) 50%, var(--color-cream-dark) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 0.75rem;
}

.skeleton-image {
    width: 100%;
    padding-top: 56.25%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--color-navy);
    color: rgba(255, 255, 255, 0.7);
    padding: 4rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--color-white);
    margin-bottom: 1rem;
}

.footer-about p {
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-links h4,
.footer-support h4 {
    color: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.footer-links ul,
.footer-support ul {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-links a,
.footer-support a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    transition: color var(--transition);
}

.footer-links a:hover,
.footer-support a:hover {
    color: var(--color-gold);
}

.footer-bottom {
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
}

.dashboard-footer {
    padding: 1.5rem 0;
    background: var(--color-white);
    border-top: 1px solid var(--color-border-light);
}

.dashboard-footer .footer-bottom {
    padding: 0;
}

/* ---------- Admin Sidebar ---------- */
.admin-layout {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--color-white);
    border-right: 1px solid var(--color-border-light);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 900;
    transition: transform var(--transition-slow);
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    padding: 0.5rem 1.25rem;
    margin-top: 0.5rem;
}

.sidebar-section:first-child {
    margin-top: 0;
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-light);
    transition: all var(--transition);
    margin: 0.125rem 0.5rem;
    border-radius: var(--radius);
}

.sidebar-link:hover {
    color: var(--color-navy);
    background: var(--color-cream);
}

.sidebar-link.active {
    color: var(--color-navy);
    background: rgba(26, 35, 50, 0.06);
    font-weight: 600;
}

.sidebar-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    color: var(--color-text-light);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--color-cream);
    color: var(--color-navy);
}

.admin-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
    min-height: calc(100vh - var(--header-height));
}

.admin-page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-light);
}

.admin-page-title {
    font-size: 1.5rem;
}

.admin-header .navbar {
    box-shadow: var(--shadow-sm);
}

/* ---------- Auth Pages ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--color-cream);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .brand-text {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border-light);
}

/* ---------- Dashboard Layout ---------- */
.dashboard-main .container {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-section {
    margin-bottom: 2.5rem;
}

.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.dashboard-section-title {
    font-size: 1.2rem;
}

/* ---------- Lesson / Content ---------- */
.lesson-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.lesson-content {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.lesson-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.lesson-content p {
    line-height: 1.8;
}

.lesson-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
}

.lesson-nav {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.lesson-nav-header {
    padding: 1rem 1.25rem;
    background: var(--color-navy);
    color: var(--color-white);
    font-weight: 600;
    font-size: 0.9rem;
}

.lesson-nav-list {
    max-height: 400px;
    overflow-y: auto;
}

.lesson-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
    border-bottom: 1px solid var(--color-border-light);
    transition: var(--transition);
}

.lesson-nav-item:hover {
    background: var(--color-cream);
}

.lesson-nav-item.active {
    background: rgba(201, 169, 110, 0.08);
    color: var(--color-navy);
    font-weight: 500;
}

.lesson-nav-item.completed {
    color: var(--color-success);
}

.lesson-nav-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lesson-nav-item.completed .lesson-nav-check {
    background: var(--color-success);
    border-color: var(--color-success);
    color: var(--color-white);
}

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border-light);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--color-navy);
}

.tab-btn.active {
    color: var(--color-navy);
    border-bottom-color: var(--color-gold);
    font-weight: 600;
}

.tab-content {
    display: none;
}

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

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 2rem;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-white);
    transition: var(--transition);
}

.pagination-btn:hover {
    background: var(--color-cream);
    border-color: var(--color-navy);
    color: var(--color-navy);
}

.pagination-btn.active {
    background: var(--color-navy);
    border-color: var(--color-navy);
    color: var(--color-white);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 35, 50, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-slow);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform var(--transition-slow);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--color-cream);
    color: var(--color-navy);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ---------- Tooltips ---------- */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-white);
    background: var(--color-navy);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    margin-bottom: 6px;
    z-index: 100;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ---------- Utilities ---------- */
.text-navy { color: var(--color-navy); }
.text-gold { color: var(--color-gold-dark); }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-heading { font-family: var(--font-heading); }
.font-bold { font-weight: 600; }
.font-medium { font-weight: 500; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bg-navy { background: var(--color-navy); }
.bg-white { background: var(--color-white); }
.bg-cream { background: var(--color-cream); }

.border { border: 1px solid var(--color-border); }
.border-top { border-top: 1px solid var(--color-border-light); }
.border-bottom { border-bottom: 1px solid var(--color-border-light); }

.rounded { border-radius: var(--radius); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-full { border-radius: var(--radius-full); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.relative { position: relative; }

/* ---------- Mobile Responsive ---------- */

/* Max 480px */
@media (max-width: 480px) {
    :root {
        --header-height: 56px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }

    .container {
        padding: 0 1rem;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero h2 {
        font-size: 1rem;
    }

    .section {
        padding: 2.5rem 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .auth-card {
        padding: 1.75rem;
    }

    .certificate-preview {
        padding: 2rem 1.25rem;
    }

    .certificate-title {
        font-size: 1.75rem;
    }

    .certificate-name {
        font-size: 1.5rem;
    }

    .quiz-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}

/* Max 768px (tablet) */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: var(--color-white);
        flex-direction: column;
        align-items: stretch;
        padding: calc(var(--header-height) + 1rem) 1.5rem 1.5rem;
        box-shadow: var(--shadow-xl);
        transform: translateX(100%);
        transition: transform var(--transition-slow);
        z-index: 1000;
        overflow-y: auto;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-links {
        flex-direction: column;
        gap: 0.25rem;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: var(--radius);
    }

    .nav-actions {
        flex-direction: column;
        gap: 0.75rem;
        padding-top: 1rem;
        margin-top: 1rem;
        border-top: 1px solid var(--color-border-light);
    }

    .nav-actions .btn {
        width: 100%;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

    .lesson-sidebar {
        position: static;
    }

    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-content {
        margin-left: 0;
        padding: 1.25rem;
    }

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

    .table-responsive {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .modal {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
}

/* Min 769px (desktop) */
@media (min-width: 769px) {
    .mobile-overlay {
        display: none;
    }
}

/* Min 1024px (large desktop) */
@media (min-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ---------- Print Styles ---------- */
@media print {
    .site-header,
    .site-footer,
    .admin-sidebar,
    .nav-toggle,
    .btn,
    .pagination {
        display: none !important;
    }

    body {
        background: white;
    }

    .card,
    .course-card,
    .quiz-question {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .certificate-preview {
        border-width: 2px;
        page-break-inside: avoid;
    }
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease;
}

.animate-slideUp {
    animation: slideUp 0.3s ease;
}

.animate-slideDown {
    animation: slideDown 0.3s ease;
}

/* ---------- Scrollbar Styling ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-cream);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ---------- Focus Visible ---------- */
:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

/* ---------- Selection ---------- */
::selection {
    background: var(--color-gold);
    color: var(--color-navy);
}
