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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
}

/* PWA Install Banner */
.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

.install-banner.hidden {
    display: none;
}

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

.install-banner-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.install-banner-text strong {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.install-banner-text span {
    font-size: 0.85rem;
    opacity: 0.9;
}

.install-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.install-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.install-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.dismiss-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.dismiss-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Install instructions modal */
.install-instructions {
    max-width: 350px;
}

.install-steps {
    margin: 1.5rem 0;
}

.install-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.step-number {
    background-color: #4CAF50;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    line-height: 1.4;
}

.share-icon,
.add-icon {
    background-color: #333;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Adjust app layout when banner is shown */
.app {
    transition: margin-top 0.3s ease;
}

.app {
    max-width: 400px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #2a2a2a;
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #333;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.tabs {
    display: flex;
    background-color: #2a2a2a;
    border-bottom: 1px solid #333;
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: #888;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #ffffff;
    background-color: #1a1a1a;
    border-bottom: 2px solid #4CAF50;
}

main {
    flex: 1;
    padding: 1rem;
}

.tab-content {
    display: none;
}

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

.timer-section {
    text-align: center;
    margin-bottom: 2rem;
}

.current-fast h2 {
    margin-bottom: 1rem;
    color: #4CAF50;
}

.timer {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
}

.timer-status {
    color: #888;
    margin-bottom: 2rem;
}

.log-meal-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    max-width: 250px;
}

.log-meal-btn:hover {
    background-color: #45a049;
}



.recent-meals h3 {
    margin-bottom: 1rem;
    color: #4CAF50;
}

.meals-list {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.meal-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid #333;
}

.meal-item:last-child {
    border-bottom: none;
}

.meal-info {
    flex: 1;
}

.meal-time {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.meal-gap {
    color: #4CAF50;
    font-size: 0.9rem;
}

.meal-notes {
    color: #888;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.delete-btn {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.2rem;
}

.empty-state {
    text-align: center;
    color: #888;
    font-style: italic;
}

.analytics-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

#period-select {
    background-color: #2a2a2a;
    color: white;
    border: 1px solid #333;
    padding: 0.5rem;
    border-radius: 4px;
}

.csv-buttons {
    display: flex;
    gap: 0.5rem;
}

.import-btn {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.import-btn:hover {
    background-color: #f57c00;
}

.export-btn {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.export-btn:hover {
    background-color: #1976D2;
}

.export-btn:disabled {
    background-color: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.export-btn:disabled:hover {
    background-color: #666;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-card {
    background-color: #2a2a2a;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-card h4 {
    color: #888;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4CAF50;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #2a2a2a;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: #4CAF50;
}

#meal-notes {
    width: 100%;
    background-color: #1a1a1a;
    color: white;
    border: 1px solid #333;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    resize: vertical;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-secondary,
.btn-primary,
.btn-danger {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-secondary {
    background-color: #666;
    color: white;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-danger {
    background-color: #ff4444;
    color: white;
}

.btn-danger:hover {
    background-color: #cc3333;
}

.btn-primary:disabled {
    background-color: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-primary:disabled:hover {
    background-color: #666;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section h3 {
    color: #4CAF50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.setting-item {
    background-color: #2a2a2a;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.setting-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#min-fast-hours {
    background-color: #1a1a1a;
    color: white;
    border: 1px solid #333;
    padding: 0.75rem;
    border-radius: 4px;
    width: 100px;
    font-size: 1rem;
}

.update-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.update-btn:hover {
    background-color: #45a049;
}

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

.setting-description {
    color: #888;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.danger-btn {
    background-color: #ff4444;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.danger-btn:hover {
    background-color: #cc3333;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-header h3 {
    color: #4CAF50;
    margin: 0;
}

.nav-btn {
    background-color: #2a2a2a;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
}

.nav-btn:hover {
    background-color: #333;
}

.calendar-legend {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.success {
    background-color: #4CAF50;
}

.legend-color.partial {
    background-color: #ff9800;
}

.legend-color.no-fast {
    background-color: #666;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background-color: #2a2a2a;
    padding: 1rem;
    border-radius: 8px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
    border-radius: 4px;
    font-size: 0.9rem;
    position: relative;
    cursor: pointer;
}

.calendar-day.other-month {
    color: #666;
    background-color: #0f0f0f;
}

.calendar-day.today {
    border: 2px solid #4CAF50;
}

.calendar-day.success {
    background-color: #4CAF50;
    color: white;
}

.calendar-day.partial {
    background-color: #ff9800;
    color: white;
}

.calendar-day.no-fast {
    background-color: #666;
    color: white;
}

.calendar-day-header {
    background-color: #333;
    color: #888;
    font-weight: bold;
    font-size: 0.8rem;
}

@media (max-width: 480px) {
    .app {
        max-width: 100%;
    }

    .timer {
        font-size: 2.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Load
ing spinner for updates */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Update modal styling */
.update-modal .modal-content {
    border: 2px solid #4CAF50;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
}

.update-modal h3 {
    color: #4CAF50;
    margin-bottom: 1rem;
}