:root {
    --bg-light: #f5f5f7;
    --text-light: #1d1d1f;
    --glass-light: rgba(255, 255, 255, 0.4);
    --border-light: rgba(255, 255, 255, 0.4);
    
    --bg-dark: #000005; /* Blacker background for 3D depth */
    --text-dark: #f5f5f7;
    --glass-dark: rgba(30, 30, 30, 0.4);
    --border-dark: rgba(255, 255, 255, 0.1);
    
    --primary: #0071e3;
    --primary-depth: #005bb5;
    --primary-hover: #0a84ff;
    
    --bg: var(--bg-light);
    --text: var(--text-light);
    --glass: var(--glass-light);
    --border: var(--border-light);
}

body.dark-mode {
    --bg: var(--bg-dark);
    --text: var(--text-dark);
    --glass: var(--glass-dark);
    --border: var(--border-dark);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.5s ease, color 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    padding-bottom: 100px; /* Space for dock */
    overflow-x: hidden;
    position: relative;
}

/* Premium Background */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('../img/bg.png') no-repeat center center/cover;
    opacity: 0.15;
    z-index: -1;
    filter: blur(2px);
    transition: opacity 0.5s ease;
}

body.dark-mode::before {
    opacity: 0.25;
}

/* Header for Desktop */
.page-header {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 100%;
    pointer-events: none;
    z-index: 10;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, var(--text), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    animation: slideDown 0.8s ease forwards;
}

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

#theme-toggle {
    position: fixed; top: 30px; right: 30px; 
    width: 44px; height: 44px;
    background: var(--glass);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; cursor: pointer; z-index: 100; color: var(--text);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
}

#app-content { 
    width: 100%; 
    max-width: 500px; 
    z-index: 5;
    perspective: 1000px;
}

.view { 
    display: none; 
    text-align: center; 
    animation: viewIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
}
.view.active-view { display: block; }

@keyframes viewIn {
    from { opacity: 0; transform: translateY(30px) rotateX(-5deg) scale(0.95); }
    to { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
}

.glass-container {
    background: var(--glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 50px 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), inset 0 0 0 1px var(--border);
    position: relative;
    overflow: hidden;
}

/* 3D Modern Button */
.primary-btn {
    display: inline-block;
    background: var(--primary); 
    color: white; 
    border: none;
    padding: 18px 45px; 
    font-size: 1.1rem; 
    border-radius: 20px;
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 30px; 
    font-weight: 600;
    box-shadow: 0 10px 0 var(--primary-depth), 0 15px 30px rgba(0, 113, 227, 0.3);
    position: relative;
    top: 0;
}
.primary-btn:hover { 
    background: var(--primary-hover); 
    transform: translateY(-2px);
    box-shadow: 0 12px 0 var(--primary-depth), 0 20px 40px rgba(0, 113, 227, 0.4);
}
.primary-btn:active {
    top: 8px;
    box-shadow: 0 2px 0 var(--primary-depth), 0 5px 15px rgba(0, 113, 227, 0.2);
}

/* Quiz Design */
.quiz-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 30px;
    letter-spacing: -0.5px;
}

.progress-bar { 
    width: 60px; height: 6px; 
    background: rgba(0,0,0,0.05); 
    border-radius: 10px; 
    overflow: hidden; 
    margin: 0 auto 30px; 
}
.progress { height: 100%; background: var(--primary); transition: width 0.4s ease; }

.options-grid { display: flex; flex-direction: column; gap: 16px; }

.option-btn {
    background: var(--glass); 
    border: 1px solid var(--border);
    padding: 24px; 
    border-radius: 24px; 
    color: var(--text);
    font-size: 1.1rem; 
    font-weight: 500;
    cursor: pointer; 
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    text-align: left;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.option-btn::after {
    content: "→";
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s;
}

.option-btn:hover { 
    background: var(--primary); 
    color: #fff;
    transform: scale(1.03) translateY(-5px); 
    border-color: transparent;
    box-shadow: 0 15px 35px rgba(0, 113, 227, 0.25);
}
.option-btn:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile App Specific (Dock) */
.dock {
    position: fixed; 
    bottom: 25px; 
    left: 50%; 
    transform: translateX(-50%);
    display: flex; gap: 10px; 
    padding: 8px; 
    border-radius: 30px; 
    z-index: 100;
    background: rgba(255, 255, 255, 0.2); 
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

body.dark-mode .dock {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
}

.dock-item {
    color: var(--text); 
    font-size: 22px; 
    display: flex; align-items: center; justify-content: center;
    width: 54px; height: 54px; 
    border-radius: 50%; 
    text-decoration: none; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dock-item:hover {
    background: rgba(var(--primary), 0.1);
    transform: translateY(-8px);
}
.dock-item.active {
    background: var(--primary); 
    color: #fff;
    transform: translateY(-10px) scale(1.1);
    box-shadow: 0 10px 20px rgba(0, 113, 227, 0.4);
}

/* Response Text Styling */
#view-home p {
    font-size: 1.1rem;
    color: var(--text);
    opacity: 0.8;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .page-header h1 { font-size: 1.8rem; top: 20px; }
    .glass-container { border-radius: 0; height: 100vh; width: 100vw; max-width: none; border: none; padding-top: 80px; }
    #app-content { max-width: none; padding: 0; }
    body { padding: 0; }
    .dock { width: 90%; max-width: 400px; justify-content: space-around; bottom: 15px; }
    .page-header { top: 25px; }
}

/* Large Screens */
@media (min-width: 1024px) {
    .page-header { top: 60px; }
}
/* Test Selection Cards */
.test-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.test-card:hover {
    background: rgba(255,255,255,0.12) !important;
    transform: translateY(-4px) scale(1.02);
    border-color: var(--primary) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
body.dark-mode .test-card:hover {
    background: rgba(255,255,255,0.08) !important;
}
