:root {
    --primary-color: #2196F3;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --danger-color: #F44336;
    --purple-color: #9C27B0;
    --background-color: #ffffff;
    --surface-color: #f8f9fa;
    --text-primary: #000000;
    --text-secondary: #333333;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 80px;
    font-weight: 400;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.language-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
    font-weight: 600;
}

.language-btn:hover {
    background: rgba(255,255,255,0.3);
}

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

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

.section.active {
    display: block;
}

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

/* Timer Styles */
.timer-container {
    text-align: center;
    padding: 2rem 0;
}

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

.timer-circle {
    position: relative;
    display: inline-block;
}

.timer-svg {
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 8;
    opacity: 0.3;
}

.timer-progress {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

#timer-time {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.session-type {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 500;
}

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

.control-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    font-weight: 600;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    filter: brightness(1.1);
}

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

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

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

.session-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.session-counter, .current-session {
    text-align: center;
    font-weight: 500;
}

.session-counter span:last-child,
.current-session span:last-child {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Settings Styles */
.settings-container, .audio-container, .blocker-container, .analytics-container, .break-container, .faq-container {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

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

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

.setting-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background-color: #ffffff;
    color: var(--text-primary);
}

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

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 26px;
    background: var(--border-color);
    border-radius: 26px;
    position: relative;
    margin-right: 1rem;
    transition: background-color 0.3s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: var(--primary-color);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Audio Styles */
.volume-slider {
    width: calc(100% - 60px);
    margin-right: 1rem;
}

#volume-display {
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Blocker Styles */
.blocker-info {
    background: var(--warning-color);
    color: #000000;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.add-site-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.add-site-form input {
    flex: 1;
}

.sites-list {
    max-height: 300px;
    overflow-y: auto;
}

.site-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--background-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.site-url {
    font-weight: 600;
    color: var(--text-primary);
}

.remove-site {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: var(--shadow);
}

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

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

.chart-container {
    margin-bottom: 2rem;
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

#weekly-chart {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    background: var(--background-color);
}

.sessions-list {
    max-height: 300px;
    overflow-y: auto;
}

.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.session-info-item {
    display: flex;
    flex-direction: column;
}

.session-date {
    font-weight: 600;
    color: var(--text-primary);
}

.session-duration {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.session-type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.session-type-badge.focus {
    background: var(--primary-color);
    color: white;
}

.session-type-badge.break {
    background: var(--success-color);
    color: white;
}

/* Break Activities Styles */
.break-suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.activity-card {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    position: relative;
}

.activity-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.activity-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.activity-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.activity-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.suggested-activity {
    background: linear-gradient(135deg, var(--success-color), var(--primary-color));
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 2rem;
}

.suggested-activity h3 {
    margin-bottom: 1rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* FAQ Styles */
.faq-items {
    space-y: 1rem;
}

.faq-item {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

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

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

.faq-question[aria-expanded="true"] {
    background: var(--primary-color);
    color: white;
}

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

.faq-icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.faq-answer {
    padding: 1rem;
    background: var(--background-color);
    border-top: 1px solid var(--border-color);
    animation: slideDown 0.3s ease-in-out;
    color: var(--text-primary);
    font-weight: 400;
}

.faq-answer[hidden] {
    display: none;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 200px; }
}

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

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s;
    min-width: 60px;
    font-weight: 500;
}

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

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

.nav-item.active {
    color: var(--primary-color);
    background: rgba(33, 150, 243, 0.15);
    font-weight: 600;
}

.nav-item:hover {
    color: var(--primary-color);
}

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

.modal-content {
    background: var(--surface-color);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-hover);
    border: 2px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
    font-weight: bold;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 2px solid var(--border-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: var(--surface-color);
    border-top: 2px solid var(--border-color);
    margin-top: 2rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    .timer-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    .session-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .add-site-form {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .break-suggestions {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .nav-item span {
        font-size: 0.6rem;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0.5rem;
    }
    
    .settings-container, .audio-container, .blocker-container, .analytics-container, .break-container, .faq-container {
        padding: 1rem;
    }
    
    #timer-time {
        font-size: 2rem;
    }
    
    .timer-svg {
        width: 150px;
        height: 150px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
}

/* Focus mode styles */
.focus-mode {
    filter: blur(2px);
    pointer-events: none;
    transition: filter 0.3s;
}

.focus-mode .timer-container {
    filter: none;
    pointer-events: all;
}

/* Animations */
.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;
}

.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Success/Error states */
.success {
    color: var(--success-color);
}

.error {
    color: var(--danger-color);
}

.success-bg {
    background-color: var(--success-color);
}

.error-bg {
    background-color: var(--danger-color);
}

/* 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 {
        --border-color: #000;
        --text-secondary: #000;
        --shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
}

/* Dark mode support - keep light theme for consistent readability */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #ffffff;
        --surface-color: #f8f9fa;
        --text-primary: #000000;
        --text-secondary: #333333;
        --border-color: #dee2e6;
    }
}
