:root {
    --primary-color: #7868E6;
    --secondary-color: #B8B5FF;
    --accent-color: #E4FBFF;
    --background-color: #EDEEF7;
    --danger-color: #FFB4B4;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(120, 104, 230, 0.15);
    --transition: all 0.3s ease;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-dark);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(120, 104, 230, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(184, 181, 255, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: var(--border-radius);
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Main Content */
.main {
    flex: 1;
    padding: 40px 0;
}

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

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-dark);
    opacity: 0.8;
}

/* Counter Section */
.counter-section {
    margin-bottom: 40px;
}

.counter-card {
    background: var(--text-light);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}

.timer-display,
.counter-display {
    text-align: center;
}

.timer-display h3,
.counter-display h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.timer {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.count {
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.timer-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.count-button {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.count-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(120, 104, 230, 0.3);
}

.count-button:active {
    transform: scale(0.95);
}

.session-info {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-around;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.info-item {
    text-align: center;
}

.info-item .label {
    display: block;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background: #6b5ce6;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-dark);
}

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

.btn-danger {
    background: var(--danger-color);
    color: var(--text-dark);
}

.btn-danger:hover {
    background: #ff9999;
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--text-light);
}

/* Alerts */
.alerts-card {
    background: var(--text-light);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
}

.alerts-card h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-info {
    background: var(--accent-color);
    color: var(--text-dark);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-danger {
    background: var(--danger-color);
    color: var(--text-dark);
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

/* History Section */
.history-section {
    margin-bottom: 40px;
}

.history-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.chart-container {
    background: var(--text-light);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    text-align: center;
}

.chart-container canvas {
    max-width: 100%;
    height: auto;
}

.history-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* FAQ Styles */
.faq-hero {
    text-align: center;
    margin-bottom: 40px;
}

.faq-section {
    margin-bottom: 40px;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--text-light);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: rgba(120, 104, 230, 0.05);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer p {
    padding: 20px 0;
    line-height: 1.6;
    color: var(--text-dark);
}

/* Emergency Section */
.emergency-section {
    margin-bottom: 40px;
}

.emergency-card {
    background: linear-gradient(135deg, var(--danger-color), #ffcccc);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--box-shadow);
    max-width: 600px;
    margin: 0 auto;
}

.emergency-card h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.emergency-numbers {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.emergency-numbers p {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: var(--text-light);
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--secondary-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
    }

    .nav-menu {
        margin-top: 15px;
        gap: 20px;
    }

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

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

    .counter-card {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .timer {
        font-size: 2rem;
    }

    .count {
        font-size: 3rem;
    }

    .count-button {
        width: 150px;
        height: 150px;
        font-size: 1rem;
    }

    .timer-controls {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 200px;
    }

    .session-info {
        flex-direction: column;
        gap: 15px;
    }

    .history-controls {
        flex-direction: column;
        align-items: center;
    }

    .emergency-numbers {
        flex-direction: column;
        gap: 10px;
    }
}

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

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

    .counter-card,
    .alerts-card,
    .chart-container {
        padding: 15px;
    }

    .count-button {
        width: 120px;
        height: 120px;
        font-size: 0.9rem;
    }

    .timer {
        font-size: 1.5rem;
    }

    .count {
        font-size: 2.5rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --secondary-color: #4169E1;
        --text-dark: #000000;
        --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

/* Print styles */
@media print {
    .header,
    .footer,
    .timer-controls,
    .count-button,
    .history-controls {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .counter-card,
    .alerts-card,
    .chart-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
