/* ==========================================
   Bestymommy - Modern CSS Design System
   ========================================== */

/* CSS Variables */
:root {
    /* Primary Colors - Pink/Rose Theme for Midwifery */
    --primary-50: #fdf2f8;
    --primary-100: #fce7f3;
    --primary-200: #fbcfe8;
    --primary-300: #f9a8d4;
    --primary-400: #f472b6;
    --primary-500: #ec4899;
    --primary-600: #db2777;
    --primary-700: #be185d;
    --primary-800: #9d174d;
    --primary-900: #831843;

    /* Secondary Colors - Teal */
    --secondary-50: #f0fdfa;
    --secondary-100: #ccfbf1;
    --secondary-200: #99f6e4;
    --secondary-300: #5eead4;
    --secondary-400: #2dd4bf;
    --secondary-500: #14b8a6;
    --secondary-600: #0d9488;
    --secondary-700: #0f766e;
    --secondary-800: #115e59;
    --secondary-900: #134e4a;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Functional Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-500) 0%, var(--secondary-700) 100%);
    --gradient-hero: linear-gradient(135deg, var(--primary-600) 0%, var(--secondary-600) 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-colored: 0 4px 14px 0 rgba(236, 72, 153, 0.3);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
}

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;
}

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

a:hover {
    color: var(--primary-700);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

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

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-colored);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(236, 72, 153, 0.4);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-600);
    border: 2px solid var(--primary-600);
}

.btn-outline:hover {
    background: var(--primary-600);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
}

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

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

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

.card-body {
    padding: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--gray-900);
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

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

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

/* Radio & Checkbox */
.form-radio,
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.form-radio:hover,
.form-checkbox:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
}

.form-radio.selected,
.form-checkbox.selected {
    border-color: var(--primary-500);
    background: var(--primary-50);
}

.form-radio input,
.form-checkbox input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary-600);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary-700);
}

.badge-secondary {
    background: var(--secondary-100);
    color: var(--secondary-700);
}

.badge-success {
    background: #d1fae5;
    color: #047857;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

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

.table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tr:hover {
    background: var(--gray-50);
}

.table tr:last-child td {
    border-bottom: none;
}

/* Progress Bar */
.progress {
    width: 100%;
    height: 0.5rem;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* Stats Card */
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.stat-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.stat-card-icon.primary {
    background: var(--primary-100);
    color: var(--primary-600);
}

.stat-card-icon.secondary {
    background: var(--secondary-100);
    color: var(--secondary-600);
}

.stat-card-icon.success {
    background: #d1fae5;
    color: #059669;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Utilities */
.text-center {
    text-align: center;
}

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

.text-left {
    text-align: left;
}

.text-primary {
    color: var(--primary-600);
}

.text-secondary {
    color: var(--secondary-600);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

.text-muted {
    color: var(--gray-500);
}

.bg-primary {
    background-color: var(--primary-600);
}

.bg-secondary {
    background-color: var(--secondary-600);
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-5 {
    margin-top: 1.25rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-5 {
    margin-bottom: 1.25rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.flex {
    display: flex;
}

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

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

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.grid {
    display: grid;
}

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

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

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

.hidden {
    display: none;
}

/* ==========================================
   Admin Layout
   ========================================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--gray-900);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-700);
}

.sidebar-logo h1 {
    font-size: 1.25rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-logo h1 span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-logo h1 img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--gray-400);
    font-weight: 500;
    transition: all var(--transition);
}

.nav-item:hover {
    color: white;
    background: var(--gray-800);
}

.nav-item.active {
    color: white;
    background: var(--primary-600);
}

.nav-item svg {
    width: 1.25rem;
    height: 1.25rem;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.admin-header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-content {
    padding: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Sidebar Toggle Button - Hidden on Desktop */
.sidebar-toggle {
    display: none;
    padding: 0.5rem;
    margin-right: 1rem;
}

/* Sidebar Close Button - Hidden by Default */
.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    color: white;
    background: var(--gray-700);
}

/* Sidebar Overlay - Hidden by Default */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   Admin Mobile Responsive
   ========================================== */
@media (max-width: 768px) {

    /* Show sidebar toggle button */
    .sidebar-toggle {
        display: flex;
    }

    /* Show close button in sidebar */
    .sidebar-close {
        display: block;
    }

    /* Sidebar logo flex */
    .sidebar-logo {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Show overlay on mobile */
    .sidebar-overlay {
        display: block;
    }

    /* Sidebar - hidden by default on mobile, slides in from left */
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 260px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 101;
    }

    .admin-sidebar.open {
        transform: translateX(0) !important;
    }

    /* Main content - full width on mobile */
    .admin-main {
        margin-left: 0;
    }

    /* Header adjustments */
    .admin-header {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .page-subtitle {
        font-size: 0.75rem;
    }

    /* User dropdown adjustments */
    .user-name {
        display: none;
    }

    .user-dropdown {
        border-left: none !important;
        padding-left: 0 !important;
        margin-left: 0.5rem !important;
    }

    /* Content padding */
    .admin-content {
        padding: 1rem;
    }

    /* Table responsive - remove negative margins and add horizontal scroll */
    .table-container {
        margin: 0;
        border-radius: var(--radius);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Cards should have horizontal scroll for overflowing content */
    .card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Tables inside cards should scroll horizontally */
    .card .table-container,
    .card table {
        min-width: 100%;
    }

    /* Stat cards grid */
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Better spacing for cards with tables */
    .card-body {
        padding: 1rem;
        overflow-x: auto;
    }
}

/* ==========================================
   Guest Layout
   ========================================== */
.guest-header {
    background: white;
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.guest-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.guest-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guest-logo img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.guest-logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.guest-nav a {
    padding: 0.5rem 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

.guest-nav a:hover {
    color: var(--primary-600);
}

.guest-main {
    padding-top: 70px;
    min-height: 100vh;
}

/* Hero Section */
.hero {
    background: var(--gradient-hero);
    color: white;
    padding: 6rem 0;
    text-align: center;
}

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

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Booklet Card */
.booklet-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
}

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

.booklet-cover {
    height: 200px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

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

.booklet-info {
    padding: 1.5rem;
}

.booklet-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.booklet-desc {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.booklet-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--gray-400);
    font-size: 0.75rem;
}

/* ==========================================
   Booklet Reader
   ========================================== */
.reader-wrapper {
    background: linear-gradient(180deg, var(--gray-100) 0%, var(--gray-200) 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

.reader-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.reader-header {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.reader-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.reader-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.reader-progress-text {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.reader-book {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
}

.reader-page {
    min-height: 600px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.reader-page-content {
    flex: 1;
}

.reader-page-content iframe {
    width: 100%;
    height: 500px;
    border: none;
}

.reader-page-number {
    text-align: center;
    color: var(--gray-400);
    font-size: 0.875rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.reader-controls {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.reader-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reader-auto {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auto-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    position: relative;
    transition: all var(--transition);
}

.toggle-switch.active {
    background: var(--primary-500);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all var(--transition);
}

.toggle-switch.active::after {
    left: 23px;
}

.timer-display {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-600);
    min-width: 40px;
    text-align: center;
}

/* ==========================================
   Test/Quiz Styles
   ========================================== */
.test-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

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

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

.test-header p {
    color: var(--gray-500);
}

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

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--primary-100);
    color: var(--primary-600);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.question-text {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

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

.answer-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.answer-option:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
}

.answer-option.selected {
    border-color: var(--primary-500);
    background: var(--primary-50);
}

.answer-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.answer-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-500);
    transition: all var(--transition);
}

.answer-option.selected .answer-label {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: white;
}

.answer-text {
    flex: 1;
    font-size: 1rem;
}

/* Result Page */
.result-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.result-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.result-header {
    background: var(--gradient-hero);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.result-header h1 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.result-body {
    padding: 2rem;
}

.score-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

.score-box {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--gray-50);
}

.score-box.pretest {
    background: var(--primary-50);
}

.score-box.posttest {
    background: var(--secondary-50);
}

.score-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    color: var(--gray-500);
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.score-box.pretest .score-value {
    color: var(--primary-600);
}

.score-box.posttest .score-value {
    color: var(--secondary-600);
}

.score-arrow {
    font-size: 2rem;
    color: var(--gray-400);
}

.improvement-badge {
    text-align: center;
    padding: 1rem;
    background: var(--success);
    color: white;
    border-radius: var(--radius);
    font-weight: 600;
}

.improvement-badge.negative {
    background: var(--error);
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }

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

    .admin-main {
        margin-left: 0;
    }

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

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero {
        padding: 4rem 0;
    }

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

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

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

    .reader-page {
        padding: 1.5rem;
        min-height: 400px;
    }

    .reader-controls {
        flex-direction: column;
    }

    .score-comparison {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .score-arrow {
        transform: rotate(90deg);
    }

    .admin-content {
        padding: 1rem;
    }

    .table-container {
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .card-body {
        padding: 1rem;
    }

    .question-card {
        padding: 1.25rem;
    }
}

/* ==========================================
   Animations
   ========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

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

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Page Turn Animation */
@keyframes pageTurnRight {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(-180deg);
    }
}

@keyframes pageTurnLeft {
    0% {
        transform: rotateY(-180deg);
    }

    100% {
        transform: rotateY(0deg);
    }
}

.page-turning-right {
    animation: pageTurnRight 0.6s ease-in-out;
    transform-origin: left center;
}

.page-turning-left {
    animation: pageTurnLeft 0.6s ease-in-out;
    transform-origin: right center;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: var(--radius);
}

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

    100% {
        background-position: -200% 0;
    }
}

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

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.pagination a:hover {
    background: var(--gray-50);
    border-color: var(--primary-300);
    color: var(--primary-600);
}

.pagination .active {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: white;
}

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

/* File Upload */
.file-upload {
    position: relative;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.file-upload:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.file-upload input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2.5rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}

.file-upload-text {
    color: var(--gray-500);
}

.file-upload-text span {
    color: var(--primary-600);
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

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

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

.modal-overlay.open .modal {
    transform: scale(1);
}

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

.modal-body {
    padding: 1.5rem;
}

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

/* ==========================================
   User Dropdown
   ========================================== */
.user-dropdown {
    position: relative;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.user-dropdown-trigger:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.user-dropdown-trigger svg {
    color: var(--gray-400);
    transition: transform var(--transition);
}

.user-dropdown.open .user-dropdown-trigger svg {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 220px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
    z-index: 100;
}

.user-dropdown.open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 0.875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.dropdown-header strong {
    font-size: 0.875rem;
    color: var(--gray-900);
}

.dropdown-header span {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    background: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}

.dropdown-item:hover {
    background: var(--gray-50);
}

.dropdown-item-danger {
    color: var(--error);
}

.dropdown-item-danger:hover {
    background: #fee2e2;
}

.gap-5 {
    gap: 1.25rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

/* ==========================================
   Responsive Navigation
   ========================================== */

/* Guest Header - Improved Styling */
.guest-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.guest-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.guest-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    z-index: 1001;
}

.guest-logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Desktop Navigation */
.guest-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guest-nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    text-decoration: none;
}

.guest-nav a:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.guest-nav a.active {
    color: var(--primary-600);
    background: var(--primary-50);
}

.guest-nav .nav-admin-link {
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
}

.guest-nav .nav-admin-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
    background: var(--gradient-primary);
    color: white;
}

.nav-icon {
    font-size: 1rem;
}

/* Hamburger Menu Button - Hidden on Desktop */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    border-radius: var(--radius);
    transition: background 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: var(--gray-100);
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger Animation when Open */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================
   Mobile Responsive Styles
   ========================================== */
@media (max-width: 768px) {

    /* Show Hamburger Menu */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Mobile Navigation */
    .guest-nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 1rem;
        background: white;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        transform: translateY(-20px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: all 0.25s ease;
        z-index: 999;
    }

    .guest-nav.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .guest-nav a {
        padding: 1rem 1.25rem;
        font-size: 1.0625rem;
        border-radius: var(--radius-lg);
        margin-bottom: 0.5rem;
        background: var(--gray-50);
        border: 1px solid var(--gray-100);
    }

    .guest-nav a:hover,
    .guest-nav a.active {
        background: var(--primary-50);
        border-color: var(--primary-200);
    }

    .guest-nav .nav-admin-link {
        margin-top: 1rem;
        padding: 1rem 1.25rem;
        text-align: center;
        justify-content: center;
        font-size: 1rem;
        border-radius: var(--radius-lg);
    }

    /* Adjust main content */
    .guest-main {
        padding-top: 70px;
    }

    /* Hero Section Mobile */
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    /* Grid Responsive */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    /* Booklet Card Mobile */
    .booklet-card {
        margin-bottom: 1rem;
    }

    /* Container Padding */
    .container {
        padding: 0 1rem;
    }
}

/* Tablet Breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

/* Hide nav icons on desktop for cleaner look */
@media (min-width: 769px) {
    .guest-nav .nav-icon {
        display: none;
    }
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}