/* Reset and 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: #010727;
    min-height: 100vh;
    color: #333;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Auth Section */
.auth-section {
    margin-top: 20px;
    text-align: center;
}

.auth-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.auth-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.auth-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.google-btn {
    background: white;
    color: #333;
    border: 1px solid #dadce0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.google-btn:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logout-btn {
    background: #ff6b6b;
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.logout-btn:hover {
    background: #ff5252;
    transform: translateY(-1px);
}

.notification-btn {
    background: #9C27B0;
    color: white;
    box-shadow: 0 2px 8px rgba(156, 39, 176, 0.3);
    padding: 8px 12px;
}

.notification-btn:hover {
    background: #8E24AA;
    transform: translateY(-1px);
}

.notification-btn.disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

.notification-btn.disabled:hover {
    background: #ccc;
    transform: none;
}

.secondary-btn {
    background: #6c757d;
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.secondary-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.sync-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s ease-in-out infinite;
    display: inline-block;
}

.sync-indicator.syncing {
    background: #ff9800;
}

.sync-indicator.error {
    background: #f44336;
}

#user-email {
    color: white;
    font-size: 0.9rem;
    opacity: 0.9;
}

.auth-error {
    color: #f44336;
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
}

.import-error {
    color: #f44336;
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
}

.backup-section, .import-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.backup-section h4, .import-section h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-weight: 500;
}

.backup-section p, .import-section p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 0.9rem;
}

/* Timer Section */
.timer-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.timer-display {
    margin-bottom: 30px;
}

.time {
    font-size: 4rem;
    font-weight: 200;
    color: #667eea;
    margin-bottom: 10px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.zone-indicator {
    font-size: 1.2rem;
    color: #666;
    font-weight: 400;
}

/* Controls */
.controls {
    margin-bottom: 30px;
}

.focus-btn, .stop-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.focus-btn {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.focus-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.focus-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.stop-btn {
    background: #ff6b6b;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.stop-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.stop-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Settings */
.settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.settings .full-width {
    grid-column: 1 / -1;
}

/* Session Notes Section */
.session-notes-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
    border: 2px solid #667eea;
    animation: slideDown 0.3s ease-out;
}

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

.session-notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.session-notes-header h3 {
    margin: 0;
    color: #333;
    font-weight: 500;
    font-size: 1.2rem;
}

/* Removed live session status styles */

.session-notes-content {
    display: grid;
    gap: 20px;
}

.session-notes-content .form-group {
    margin-bottom: 0;
}

.session-notes-content .form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.session-notes-content select,
.session-notes-content textarea {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.session-notes-content select:focus,
.session-notes-content textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.session-notes-content textarea {
    resize: vertical;
    min-height: 80px;
}

.setting-group {
    text-align: left;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.setting-group input,
.setting-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.setting-group input:focus,
.setting-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Analytics Section */
.analytics-section {
    background: white;
    border-radius: 20px;
    padding: 0 30px 30px 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.analytics-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-weight: 400;
}

.analytics-controls {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.analytics-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #e1e5e9;
}

.analytics-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.analytics-tab:hover {
    color: #666;
}

.analytics-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.analytics-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.analytics-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.tab-controls {
    margin-bottom: 25px;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.daily-totals-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.daily-totals-controls label {
    font-weight: 500;
    color: #555;
}

.daily-totals-controls select {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.daily-totals-controls select:focus {
    outline: none;
    border-color: #667eea;
}

.daily-totals-controls .nav-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.daily-totals-controls .nav-btn:hover {
    background: #764ba2;
    transform: translateY(-1px);
}

.daily-totals-controls .nav-btn:active {
    transform: translateY(0);
}

#week-indicator {
    font-weight: 500;
    color: #555;
    font-size: 0.95rem;
    min-width: 150px;
    text-align: center;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-filter label {
    font-weight: 500;
    color: #555;
}

.date-filter input {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.date-filter input:focus {
    outline: none;
    border-color: #667eea;
}

.daily-totals-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.daily-total-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 10px 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.daily-total-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.daily-total-item.no-data {
    padding: 5px 15px;
    background: transparent;
    border-left: none;
}

.daily-total-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.daily-total-date {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.daily-total-minutes {
    font-weight: 600;
    color: #667eea;
    font-size: 1rem;
}

.daily-total-bar {
    background: #e1e5e9;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.daily-total-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    min-width: 35px;
}

.daily-total-bar.no-data {
    background: #f0f0f0;
}

.daily-total-bar.no-data .daily-total-fill {
    background: #ddd;
    width: 100%;
}

.daily-total-no-sessions {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 12px;
}

.analytics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e1e5e9;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.zone-breakdown h3 {
    margin-bottom: 20px;
    color: #333;
    font-weight: 400;
    font-size: 1.2rem;
}

.zone-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.zone-stat-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.zone-stat-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.zone-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.zone-name {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.zone-percentage {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.zone-stat-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.zone-time {
    font-weight: 500;
    color: #555;
}

.zone-sessions {
    color: #666;
    font-size: 0.9rem;
}

.zone-progress-bar {
    background: #e1e5e9;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.zone-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.no-data {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 12px;
}

/* History Section */
.history-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.history-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-weight: 400;
}

.history-controls {
    margin-bottom: 20px;
    text-align: right;
}

.clear-btn {
    padding: 8px 16px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #ff5252;
    transform: translateY(-1px);
}

/* History List */
.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
}

.history-duration {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.history-zone {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.delete-session-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
    margin-left: 10px;
}

.delete-session-btn:hover {
    background: #ff5252;
    opacity: 1;
    transform: scale(1.1);
}

.delete-session-btn:active {
    transform: scale(0.95);
}

.history-time {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.history-intention,
.history-result,
.history-notes {
    color: #333;
    margin: 8px 0;
    font-size: 0.9rem;
}

.history-intention strong,
.history-result strong,
.history-notes strong {
    color: #555;
    font-weight: 500;
}

.history-result {
    font-style: italic;
}

.history-notes {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.history-empty {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px;
}

/* Disrupted session styling */
.disrupted-session {
    border-left-color: #ff9800 !important;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.disrupted-session .history-duration {
    color: #ff9800;
}

.history-disruption {
    color: #e65100;
    margin: 8px 0;
    font-size: 0.9rem;
    background: #fff3e0;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #ff9800;
}

.history-disruption strong {
    color: #e65100;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .timer-section {
        padding: 30px 20px;
    }
    
    .time {
        font-size: 3rem;
    }
    
    .settings {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .focus-btn, .stop-btn {
        padding: 12px 30px;
        font-size: 1rem;
        margin: 5px;
    }
    
    .analytics-section {
        padding: 20px;
    }
    
    .analytics-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .analytics-tabs {
        width: 100%;
        border-bottom: 2px solid #e1e5e9;
    }
    
    .analytics-tab {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .date-filter {
        width: 100%;
        flex-direction: row;
    }
    
    .date-filter input {
        flex: 1;
    }
    
    .analytics-summary {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .daily-totals-controls {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .daily-totals-controls select {
        width: 100%;
    }
}

/* Animation for timer countdown */
.time.counting {
    animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        color: #667eea;
    }
    to {
        color: #764ba2;
    }
}


/* Zone-specific colors */
.zone-1 { border-left-color: #4CAF50; }
.zone-2 { border-left-color: #2196F3; }
.zone-3 { border-left-color: #FF9800; }
.zone-4 { border-left-color: #F44336; }
.zone-5 { border-left-color: #9C27B0; }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 25px 30px 15px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-weight: 400;
    font-size: 1.4rem;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 25px 30px;
}

.session-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.session-summary p {
    margin: 8px 0;
    color: #555;
}

.session-summary strong {
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    padding: 15px 30px 25px;
    text-align: right;
}

.save-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}
