/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #f97316;
    --secondary-dark: #ea580c;
    --secondary-light: #fb923c;
    
    /* Neutral Colors */
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-dark: linear-gradient(135deg, var(--neutral-800) 0%, var(--neutral-900) 100%);
    --gradient-light: linear-gradient(135deg, var(--neutral-50) 0%, var(--neutral-100) 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    --font-size-6xl: 3.75rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--neutral-800);
    background: var(--gradient-light);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* Background Elements */
.bg-circles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: var(--gradient-primary);
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: -10%;
    animation-delay: 0s;
}

.circle-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: -5%;
    animation-delay: 7s;
}

.circle-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 20%;
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--neutral-200);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition-normal);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: var(--font-size-2xl);
}

.nav {
    display: flex;
    gap: var(--space-8);
}

.nav-link {
    text-decoration: none;
    color: var(--neutral-600);
    font-weight: 500;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

/* Main Content */
.main {
    padding-top: 80px;
    min-height: calc(100vh - 140px);
}

/* Screen Transitions */
.screen {
    display: none;
    padding: var(--space-20) 0;
    min-height: calc(100vh - 160px);
    animation: fadeIn 0.6s ease-in-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Welcome Screen */
.welcome-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: center;
    min-height: 60vh;
}

.hero-text {
    animation: slideInLeft 0.8s ease-out;
}

.title {
    font-size: var(--font-size-5xl);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-6);
    color: var(--neutral-800);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.subtitle {
    font-size: var(--font-size-lg);
    color: var(--neutral-600);
    margin-bottom: var(--space-8);
    line-height: 1.8;
}

/* Hero Visual */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: slideInRight 0.8s ease-out;
}

.clock-container {
    position: relative;
    width: 300px;
    height: 300px;
}

.clock-face {
    position: relative;
    width: 100%;
    height: 100%;
    border: 8px solid var(--primary-color);
    border-radius: 50%;
    background: var(--gradient-light);
    box-shadow: var(--shadow-2xl);
}

.clock-hand {
    position: absolute;
    left: 50%;
    bottom: 50%;
    transform-origin: bottom center;
    background: var(--primary-color);
    border-radius: var(--radius-full);
}

.clock-hand.hour {
    width: 6px;
    height: 80px;
    margin-left: -3px;
    animation: rotateHour 12s linear infinite;
}

.clock-hand.minute {
    width: 4px;
    height: 100px;
    margin-left: -2px;
    animation: rotateMinute 1s linear infinite;
}

.clock-hand.second {
    width: 2px;
    height: 110px;
    margin-left: -1px;
    background: var(--secondary-color);
    animation: rotateSecond 1s linear infinite;
}

.clock-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

@keyframes rotateHour {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateMinute {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateSecond {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border: none;
    border-radius: var(--radius-xl);
    font-family: inherit;
    font-size: var(--font-size-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-normal);
}

.btn:hover:before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-lg);
    transform: translateY(0);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: white;
    color: var(--neutral-700);
    border: 2px solid var(--neutral-200);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-300);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Form Styles */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: var(--space-12);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.6s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.form-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--neutral-800);
    margin-bottom: var(--space-4);
}

.form-subtitle {
    font-size: var(--font-size-lg);
    color: var(--neutral-600);
}

.form-group {
    margin-bottom: var(--space-8);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: var(--space-3);
}

.form-input {
    width: 100%;
    padding: var(--space-4);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    transition: var(--transition-fast);
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.gender-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

.gender-option {
    position: relative;
}

.gender-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gender-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-6);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: var(--transition-normal);
    background: white;
    text-align: center;
}

.gender-label i {
    font-size: var(--font-size-2xl);
    color: var(--neutral-400);
    transition: var(--transition-fast);
}

.gender-label span {
    font-weight: 500;
    color: var(--neutral-600);
}

.gender-input:checked + .gender-label {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.gender-input:checked + .gender-label i {
    color: var(--primary-color);
}

.gender-input:checked + .gender-label span {
    color: var(--primary-color);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-12);
}

/* Quiz Styles */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    background: white;
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-8);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-4);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease-in-out;
    width: 0%;
}

.question-counter {
    text-align: center;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--neutral-700);
}

.question-container {
    background: white;
    padding: var(--space-12);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-8);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.question-title {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--neutral-800);
    margin-bottom: var(--space-8);
    text-align: center;
    line-height: 1.4;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
}

.option {
    position: relative;
}

.option-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-label {
    display: block;
    padding: var(--space-6);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-normal);
    background: white;
    text-align: center;
    font-weight: 500;
}

.option-label:hover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.option-input:checked + .option-label {
    border-color: var(--primary-color);
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.quiz-actions {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
}

/* Results Screen */
.results-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.results-header {
    margin-bottom: var(--space-16);
}

.results-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--neutral-800);
    margin-bottom: var(--space-4);
}

.results-subtitle {
    font-size: var(--font-size-lg);
    color: var(--neutral-600);
}

.life-wasted-info {
    margin-top: var(--space-6);
    padding: var(--space-4);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(251, 113, 133, 0.1) 100%);
    border-radius: var(--radius-lg);
    border-left: 4px solid #ef4444;
}

.life-wasted-text {
    font-size: var(--font-size-base);
    color: var(--neutral-700);
    font-weight: 500;
}

.life-wasted-text span {
    color: #dc2626;
    font-weight: 700;
    font-size: var(--font-size-lg);
}

.counter-display {
    background: white;
    padding: var(--space-16);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    margin-bottom: var(--space-12);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: var(--shadow-2xl);
    }
    50% {
        box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.3);
    }
}

.counter-main {
    margin-bottom: var(--space-12);
}

.counter-value {
    font-size: var(--font-size-6xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--space-4);
    font-family: 'Courier New', monospace;
}

.counter-label {
    font-size: var(--font-size-xl);
    color: var(--neutral-600);
    font-weight: 500;
}

.counter-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
}

.detail-item {
    padding: var(--space-6);
    background: var(--gradient-light);
    border-radius: var(--radius-xl);
    border: 1px solid var(--neutral-200);
}

.detail-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--space-2);
    font-family: 'Courier New', monospace;
}

.detail-label {
    font-size: var(--font-size-sm);
    color: var(--neutral-600);
    font-weight: 500;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-4);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: var(--font-size-lg);
    font-weight: 500;
}

/* Footer */
.footer {
    background: var(--neutral-800);
    color: var(--neutral-300);
    text-align: center;
    padding: var(--space-8) 0;
    margin-top: var(--space-20);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    .header .container {
        padding: var(--space-3) var(--space-4);
    }
    
    .nav {
        gap: var(--space-4);
    }
    
    .nav-link {
        padding: var(--space-2);
        font-size: var(--font-size-sm);
    }
    
    .welcome-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
        text-align: center;
    }
    
    .title {
        font-size: var(--font-size-3xl);
    }
    
    .clock-container {
        width: 250px;
        height: 250px;
    }
    
    .form-container {
        padding: var(--space-8);
        margin: 0 var(--space-4);
    }
    
    .gender-options {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .quiz-container {
        margin: 0 var(--space-4);
    }
    
    .quiz-header,
    .question-container {
        padding: var(--space-6);
    }
    
    .question-title {
        font-size: var(--font-size-xl);
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .quiz-actions {
        flex-direction: column;
    }
    
    .results-container {
        margin: 0 var(--space-4);
    }
    
    .results-title {
        font-size: var(--font-size-3xl);
    }
    
    .counter-display {
        padding: var(--space-8);
    }
    
    .counter-value {
        font-size: var(--font-size-4xl);
    }
    
    .counter-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: var(--font-size-2xl);
    }
    
    .counter-value {
        font-size: var(--font-size-3xl);
    }
    
    .counter-details {
        grid-template-columns: 1fr;
    }
    
    .detail-item {
        padding: var(--space-4);
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bounce-in {
    animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}
