:root {
    --primary: #03045E;
    --secondary: #023E8A;
    --tertiary: #0077B6;
    --quaternary: #0096C7;
    --light: #90E0EF;
    --white: #ffffff;
    --gray-light: #f8f9fa;
    --gray-medium: #6c757d;
    --gray-dark: #343a40;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --shadow: rgba(3, 4, 94, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--light) 0%, var(--white) 100%);
    color: var(--gray-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 80px;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(3, 4, 94, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 119, 182, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(144, 224, 239, 0.05) 0%, transparent 50%);
}

.app-header {
    background: var(--white);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.app-main {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.section.active {
    display: block;
}

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

/* Timer Styles */
.timer-container {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.timer-display {
    margin: 2rem 0;
}

.time-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 8px 32px var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    border: 4px solid var(--light);
}

#time-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.timer-label {
    font-size: 0.9rem;
    color: var(--gray-medium);
    margin-top: 0.5rem;
}

.timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    justify-content: center;
}

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

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

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

.btn-secondary:hover {
    background: var(--quaternary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-tertiary {
    background: var(--gray-light);
    color: var(--gray-dark);
    border: 2px solid var(--gray-medium);
}

.btn-tertiary:hover {
    background: var(--gray-medium);
    color: var(--white);
}

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

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.timer-settings {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px var(--shadow);
    margin-top: 2rem;
}

.setting-group {
    margin-bottom: 1rem;
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
}

.setting-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.setting-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(3, 4, 94, 0.1);
}

/* Analytics Styles */
.analytics-container h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px var(--shadow);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-medium);
}

.chart-container {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px var(--shadow);
    margin-bottom: 1rem;
    height: 300px;
}

.period-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.period-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.period-btn.active,
.period-btn:hover {
    background: var(--primary);
    color: var(--white);
}

/* Focus Assessment Styles */
.focus-container h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 2rem;
}

.assessment-form {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px var(--shadow);
    margin-bottom: 2rem;
    text-align: center;
}

.assessment-form h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.rating-container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.rating-btn {
    padding: 1rem;
    border: 2px solid var(--light);
    background: var(--white);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    min-width: 100px;
}

.rating-btn:hover,
.rating-btn.selected {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

#session-notes {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--light);
    border-radius: var(--border-radius);
    resize: vertical;
    min-height: 100px;
    margin-bottom: 1rem;
    font-family: inherit;
}

#session-notes:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(3, 4, 94, 0.1);
}

.focus-insights {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px var(--shadow);
}

.focus-insights h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

/* Groups Styles */
.groups-container h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 2rem;
}

.group-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.form-container {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px var(--shadow);
    margin-bottom: 2rem;
}

.form-container h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-container input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.form-container input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(3, 4, 94, 0.1);
}

.current-group {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px var(--shadow);
}

.current-group h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.group-info {
    margin-bottom: 1.5rem;
}

.group-info p {
    margin-bottom: 0.5rem;
}

.group-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Settings Styles */
.settings-container h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 2rem;
}

.settings-group {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px var(--shadow);
    margin-bottom: 2rem;
}

.settings-group h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-medium);
    transition: var(--transition);
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* FAQ Styles */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-container h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 2rem;
}

.faq-item {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

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

.faq-question:hover {
    background: var(--gray-light);
}

.faq-icon {
    font-size: 1.5rem;
    transition: var(--transition);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer:not([hidden]) {
    padding: 1.5rem;
    max-height: 200px;
}

.faq-answer p {
    color: var(--gray-dark);
    line-height: 1.6;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--light);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 10px var(--shadow);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-medium);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    min-width: 60px;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
    background: rgba(3, 4, 94, 0.05);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray-medium);
    font-size: 0.9rem;
    background: var(--white);
    margin-top: 2rem;
    border-top: 1px solid var(--light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-main {
        padding: 0.5rem;
    }
    
    .time-circle {
        width: 150px;
        height: 150px;
    }
    
    #time-display {
        font-size: 2rem;
    }
    
    .timer-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rating-container {
        flex-direction: column;
        align-items: center;
    }
    
    .rating-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .group-actions,
    .group-controls {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-item span {
        font-size: 0.6rem;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
}

/* Animations and Transitions */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--light);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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