/* CSS Variables */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 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);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    text-align: center;
    padding: 30px 0;
    color: white;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 8px;
}

/* Main Content */
main {
    flex: 1;
}

/* Section Styles */
.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Card Styles */
.card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

/* Welcome Card */
.welcome-card {
    text-align: center;
}

.icon-large {
    font-size: 4rem;
    margin-bottom: 20px;
}

.welcome-card h2 {
    font-size: 1.75rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.welcome-card p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.feature-icon {
    font-size: 1.2rem;
}

/* Button Styles */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-hover);
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #a855f7);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Question Styles */
.question-text {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 25px;
    line-height: 1.5;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    padding: 16px 20px;
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    color: var(--text-primary);
}

.option-btn:hover {
    border-color: var(--primary-color);
    background: #f0f0ff;
}

.option-btn.selected {
    border-color: var(--primary-color);
    background: #eef2ff;
    color: var(--primary-color);
    font-weight: 500;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.nav-buttons .btn {
    flex: 1;
}

/* Results Section */
.results-card {
    text-align: center;
}

.results-card h2 {
    margin-bottom: 25px;
    color: var(--text-primary);
}

/* Stress Meter */
.stress-meter {
    margin-bottom: 30px;
}

.meter-container {
    height: 20px;
    background: linear-gradient(90deg, var(--success-color), var(--warning-color), var(--danger-color));
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.meter-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-right: 4px solid white;
    transition: width 0.8s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.meter-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Stress Level Display */
.stress-level {
    padding: 25px;
    background: var(--background-color);
    border-radius: 10px;
    margin-bottom: 25px;
}

.stress-emoji {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 15px;
}

.stress-level h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.stress-level p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Tips Section */
.tips-section {
    text-align: left;
    padding: 20px;
    background: var(--background-color);
    border-radius: 10px;
    margin-bottom: 25px;
}

.tips-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.tips-list {
    list-style: none;
}

.tips-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.tips-list li:last-child {
    border-bottom: none;
}

.tip-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-buttons .btn {
    flex: 1;
    min-width: 150px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-content h3 {
    margin-bottom: 15px;
    font-size: 1.25rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.reminder-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reminder-option {
    padding: 14px 20px;
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    color: var(--text-primary);
}

.reminder-option:hover {
    border-color: var(--primary-color);
    background: #eef2ff;
}

.reminder-option.active {
    border-color: var(--success-color);
    background: #f0fdf4;
    color: var(--success-color);
}

.reminder-status {
    margin-top: 20px;
    padding: 15px;
    background: #f0fdf4;
    border-radius: 8px;
    color: var(--success-color);
    font-weight: 500;
    display: none;
}

.reminder-status.active {
    display: block;
}

#cancel-reminder {
    margin-top: 15px;
    width: 100%;
}

/* Break Notification */
.break-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    max-width: 400px;
    margin: 0 auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    z-index: 1001;
    transform: translateY(-150%);
    transition: transform 0.4s ease;
}

.break-notification.active {
    transform: translateY(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.notification-text {
    flex: 1;
}

.notification-text strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.notification-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 25px 0;
    margin-top: auto;
}

footer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

footer a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    header {
        padding: 20px 0;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 20px;
    }

    .icon-large {
        font-size: 3rem;
    }

    .welcome-card h2 {
        font-size: 1.5rem;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .nav-buttons {
        flex-direction: column-reverse;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .stress-emoji {
        font-size: 3rem;
    }

    .notification-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus States */
.btn:focus,
.option-btn:focus,
.reminder-option:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1e293b;
        --card-background: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border-color: #475569;
    }

    body {
        background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    }

    .option-btn:hover,
    .reminder-option:hover {
        background: #3b4252;
    }

    .option-btn.selected {
        background: #3730a3;
        color: white;
    }

    .stress-level {
        background: var(--background-color);
    }

    .tips-section {
        background: var(--background-color);
    }

    .modal-content {
        background: var(--card-background);
    }

    .reminder-status {
        background: #166534;
        color: #bbf7d0;
    }

    .break-notification {
        background: var(--card-background);
    }
}
