:root {
    --bg-body: #F5F5F7;
    --bg-card: #FFFFFF;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --accent: #0071E3;
    --accent-hover: #0077ED;
    --danger: #FF3B30;
    --success: #34C759;
    --warning: #FF9F0A;
    --radius-l: 18px;
    --radius-m: 12px;
    --radius-s: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.02), 0 2px 4px -1px rgba(0,0,0,0.02);
    --shadow-lg: 0 20px 40px -10px rgba(0,0,0,0.05);
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-body: #1c1c1e;
    --bg-card: #2c2c2e;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 40px -10px rgba(0,0,0,0.4);
}

/* Dark Mode Specific Overrides */
body.dark-mode input[type="text"],
body.dark-mode input[type="password"],
body.dark-mode input[type="email"],
body.dark-mode input[type="number"],
body.dark-mode select,
body.dark-mode textarea {
    background: #3a3a3c;
    border-color: #48484a;
    color: white;
}

body.dark-mode .custom-nav {
    background: rgba(44, 44, 46, 0.8);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

body.dark-mode .exam-card,
body.dark-mode .card {
    border: 1px solid rgba(255,255,255,0.05);
}

body.dark-mode .option-label {
    background: #3a3a3c;
    border-color: transparent;
}

body.dark-mode .option-label:hover {
    background: #48484a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: var(--accent);
    transition: color 0.2s ease;
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text-primary);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header / Nav */
.custom-nav {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 54px;
    display: flex;
    align-items: center;
}

.nav-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo a {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0.9;
}

.nav-logo a:hover {
    opacity: 1;
}

.right-section a {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 20px;
}

.right-section a:hover {
    color: var(--accent);
}

.right-section a.button {
    background: var(--text-primary);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 500;
}

.right-section a.button:hover {
    background: #000;
    color: white;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-md);
    padding: 30px;
    border: 1px solid rgba(0,0,0,0.02);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border-radius: 99px;
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--accent-hover);
    transform: scale(1.01);
    color: white; /* Ensure text stays white */
}

.btn-secondary {
    background: #E8E8ED;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #D2D2D7;
    color: var(--text-primary);
}

.btn-danger {
    background: var(--bg-body);
    color: var(--danger);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

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

/* Forms */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-m);
    border: 1px solid #D2D2D7;
    background: rgba(255,255,255,0.8);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Typography Utilities */
.text-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}

.page-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

body.dark-mode .page-title {
    background: linear-gradient(135deg, #F5F5F7 0%, #a1a1a6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

.hero {
    max-width: 1000px;
    margin: 40px auto 20px;
    text-align: center;
    padding: 0 20px;
}

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

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.card, .action-card, .history-item, .exam-card {
    animation: fadeIn 0.5s ease-out;
}

/* Icon Utilities */
i.ph, i.ph-bold, i.ph-fill {
    vertical-align: middle;
    margin-right: 6px;
    font-size: 1.1em;
}

.btn i {
    margin-right: 8px;
}

.action-card i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 15px;
    display: block;
    transition: transform 0.3s ease;
}

.action-card:hover i {
    transform: scale(1.1);
}

/* Enhanced Hover Effects */
.card:hover, .exam-card:hover {
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

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

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.card, .action-card, .history-item, .exam-card {
    animation: fadeIn 0.5s ease-out;
}

/* Icon Utilities */
i.ph, i.ph-bold, i.ph-fill {
    vertical-align: middle;
    margin-right: 6px;
    font-size: 1.1em;
}

.btn i {
    margin-right: 8px;
}

.action-card i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 15px;
    display: block;
    transition: transform 0.3s ease;
}

.action-card:hover i {
    transform: scale(1.1);
}

@keyframes wave {
    0% { transform: rotate( 0.0deg) }
    10% { transform: rotate(14.0deg) }
    20% { transform: rotate(-8.0deg) }
    30% { transform: rotate(14.0deg) }
    40% { transform: rotate(-4.0deg) }
    50% { transform: rotate(10.0deg) }
    60% { transform: rotate( 0.0deg) }
    100% { transform: rotate( 0.0deg) }
}

/* Navigation Utilities */
.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
}

.back-link:hover {
    color: var(--accent);
    text-decoration: none;
}

.back-link i {
    margin-right: 5px;
    font-size: 1.1em;
}

/* Mobile-First Responsive Tables */
@media (max-width: 768px) {
    .responsive-table table, 
    .responsive-table thead, 
    .responsive-table tbody, 
    .responsive-table th, 
    .responsive-table td, 
    .responsive-table tr {
        display: block;
    }
    
    .responsive-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .responsive-table tr {
        border: 1px solid rgba(0,0,0,0.1);
        margin-bottom: 15px;
        border-radius: var(--radius-m);
        background: var(--bg-card);
        overflow: hidden;
        box-shadow: var(--shadow-sm);
    }
    
    .responsive-table td {
        border: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        position: relative;
        padding: 12px 15px 12px 50% !important;
        text-align: right !important;
        min-height: 48px;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
    
    .responsive-table td:last-child {
        border-bottom: none;
    }
    
    .responsive-table td::before {
        position: absolute;
        top: 50%;
        left: 15px;
        transform: translateY(-50%);
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        content: attr(data-label);
        color: var(--text-secondary);
        font-size: 0.85rem;
    }
}
