:root {
    /* Color Palette - Calming & Mindful */
    --color-sage: #8B9D83;
    --color-sage-light: #A8B89F;
    --color-sage-dark: #6B7D63;
    --color-cream: #F5F3EE;
    --color-sand: #E8E3D8;
    --color-terracotta: #D4A59A;
    --color-terracotta-light: #E8C5BC;
    --color-slate: #5A6470;
    --color-slate-light: #8A94A0;
    --color-white: #FFFFFF;
    --color-shadow: rgba(90, 100, 112, 0.08);
    --color-shadow-heavy: rgba(90, 100, 112, 0.15);
    
    /* Typography */
    --font-display: 'Crimson Pro', serif;
    --font-body: 'DM Sans', sans-serif;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--color-cream) 0%, var(--color-sand) 100%);
    color: var(--color-slate);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background decoration */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(139, 157, 131, 0.05) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-20px, 20px) rotate(5deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg);
    position: relative;
    z-index: 1;
    animation: fadeIn 0.6s ease;
}

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

/* Header */
.header {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: 0 4px 20px var(--color-shadow);
    animation: slideDown 0.5s ease;
}

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.app-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--color-sage-dark);
    letter-spacing: -0.02em;
}

.header-meta {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
    flex-wrap: wrap;
}

.user-info {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, rgba(139, 157, 131, 0.1), rgba(139, 157, 131, 0.05));
    border-radius: var(--radius-md);
}

.user-welcome {
    color: var(--color-slate);
    font-weight: 500;
    font-size: 0.95rem;
}

.btn-logout {
    padding: var(--space-xs) var(--space-md);
    background: var(--color-white);
    border: 2px solid var(--color-terracotta);
    border-radius: var(--radius-sm);
    color: var(--color-terracotta);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
    text-decoration: none;
    display: inline-block;
}

.btn-logout:hover {
    background: var(--color-terracotta);
    color: var(--color-white);
    transform: scale(1.05);
}

.date-display {
    font-size: 1.1rem;
    color: var(--color-slate-light);
    font-weight: 500;
}

.weather-mini {
    padding: var(--space-xs) var(--space-md);
    background: linear-gradient(135deg, var(--color-sage-light), var(--color-sage));
    color: var(--color-white);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    animation: fadeInUp 0.7s ease 0.2s backwards;
}

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

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Sections */
.entry-section,
.entries-section {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: 0 4px 20px var(--color-shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--color-sand);
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--color-sage-dark);
    font-weight: 600;
}

.subsection-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--color-sage);
    margin-bottom: var(--space-md);
    font-weight: 600;
}

/* Form Styles */
.entry-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-weight: 500;
    color: var(--color-slate);
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group textarea {
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--color-sand);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-slate);
    transition: all var(--transition-smooth);
    background: var(--color-cream);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-sage);
    background: var(--color-white);
    box-shadow: 0 0 0 4px rgba(139, 157, 131, 0.1);
}

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

/* Mood Selector */
.mood-selector {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    padding: var(--space-md);
    background: var(--color-cream);
    border-radius: var(--radius-lg);
}

.mood-selector input[type="radio"] {
    display: none;
}

.mood-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    border: 3px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-smooth);
    background: var(--color-white);
    flex: 1;
    min-width: 80px;
}

.mood-icon:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px var(--color-shadow);
}

.mood-icon .emoji {
    font-size: 2.5rem;
    transition: transform var(--transition-smooth);
}

.mood-icon:hover .emoji {
    transform: scale(1.2);
}

.mood-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-slate-light);
    text-align: center;
}

.mood-selector input[type="radio"]:checked + .mood-icon {
    border-color: var(--color-sage);
    background: linear-gradient(135deg, rgba(139, 157, 131, 0.1), rgba(139, 157, 131, 0.05));
}

.mood-selector input[type="radio"]:checked + .mood-icon .emoji {
    transform: scale(1.3);
}

.mood-selector input[type="radio"]:checked + .mood-icon .mood-label {
    color: var(--color-sage-dark);
    font-weight: 600;
}

/* Health Section */
.health-section {
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--color-terracotta-light), rgba(232, 197, 188, 0.3));
    border-radius: var(--radius-lg);
}

/* Weather Section */
.weather-section {
    padding: var(--space-lg);
    background: linear-gradient(135deg, rgba(168, 184, 159, 0.2), rgba(168, 184, 159, 0.05));
    border-radius: var(--radius-lg);
}

.weather-display {
    margin-top: var(--space-md);
}

.weather-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
}

.weather-item {
    padding: var(--space-md);
    background: var(--color-white);
    border-radius: var(--radius-md);
    text-align: center;
}

.weather-item strong {
    display: block;
    color: var(--color-sage);
    margin-bottom: var(--space-xs);
    font-size: 0.85rem;
}

.weather-item span {
    font-size: 1.25rem;
    color: var(--color-slate);
    font-weight: 600;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-weather,
.btn-delete {
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-sage), var(--color-sage-dark));
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(139, 157, 131, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 157, 131, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

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

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

.btn-weather {
    background: linear-gradient(135deg, var(--color-terracotta), var(--color-terracotta-light));
    color: var(--color-white);
    width: 100%;
}

.btn-weather:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 154, 0.4);
}

.btn-delete {
    background: #E57373;
    color: var(--color-white);
    padding: var(--space-xs) var(--space-md);
    font-size: 0.9rem;
}

.btn-delete:hover {
    background: #EF5350;
}

.form-actions {
    margin-top: var(--space-md);
}

/* Entries List */
.date-navigation {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--color-cream), var(--color-sand));
    border-radius: var(--radius-lg);
}

.nav-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--color-white);
    border: 2px solid var(--color-sage-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-smooth);
    font-size: 1.2rem;
    min-width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover:not(:disabled) {
    background: var(--color-sage);
    border-color: var(--color-sage);
    transform: scale(1.05);
}

.nav-btn:hover:not(:disabled) .nav-arrow {
    color: var(--color-white);
}

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

.nav-arrow {
    color: var(--color-sage);
    font-weight: bold;
    transition: color var(--transition-smooth);
}

.date-search {
    flex: 1;
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.date-search-input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--color-sand);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-slate);
    background: var(--color-white);
    transition: all var(--transition-smooth);
}

.date-search-input:focus {
    outline: none;
    border-color: var(--color-sage);
    box-shadow: 0 0 0 4px rgba(139, 157, 131, 0.1);
}

.btn-today {
    padding: var(--space-sm) var(--space-lg);
    background: linear-gradient(135deg, var(--color-sage-light), var(--color-sage));
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
    white-space: nowrap;
}

.btn-today:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 157, 131, 0.3);
}

.entries-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-height: 800px;
    overflow-y: auto;
    padding-right: var(--space-sm);
}

.filter-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: linear-gradient(135deg, rgba(139, 157, 131, 0.15), rgba(139, 157, 131, 0.08));
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    border-left: 4px solid var(--color-sage);
    font-weight: 500;
    color: var(--color-slate);
}

.btn-clear-filter {
    padding: var(--space-xs) var(--space-md);
    background: var(--color-white);
    border: 2px solid var(--color-sage-light);
    border-radius: var(--radius-sm);
    color: var(--color-slate);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.btn-clear-filter:hover {
    background: var(--color-sage);
    color: var(--color-white);
    border-color: var(--color-sage);
    transform: scale(1.05);
}

.entries-list::-webkit-scrollbar {
    width: 8px;
}

.entries-list::-webkit-scrollbar-track {
    background: var(--color-sand);
    border-radius: var(--radius-sm);
}

.entries-list::-webkit-scrollbar-thumb {
    background: var(--color-sage-light);
    border-radius: var(--radius-sm);
}

.entries-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-sage);
}

.entry-card {
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--color-white), var(--color-cream));
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--color-sage);
    transition: all var(--transition-smooth);
    cursor: pointer;
    animation: slideIn 0.4s ease;
}

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

.entry-card:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 20px var(--color-shadow-heavy);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-sand);
}

.entry-date {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--color-sage-dark);
    font-weight: 600;
}

.entry-mood {
    font-size: 1.5rem;
}

.entry-content {
    display: grid;
    gap: var(--space-sm);
}

.entry-item {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    font-size: 0.9rem;
}

.entry-item strong {
    color: var(--color-sage);
    min-width: 120px;
}

.entry-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

/* Stats Panel */
.stats-panel {
    margin-bottom: var(--space-lg);
    padding: var(--space-lg);
    background: linear-gradient(135deg, rgba(139, 157, 131, 0.1), rgba(139, 157, 131, 0.05));
    border-radius: var(--radius-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.stat-card {
    padding: var(--space-lg);
    background: var(--color-white);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: 0 2px 8px var(--color-shadow);
}

.stat-card .stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-slate-light);
    margin-bottom: var(--space-xs);
    font-weight: 500;
}

.stat-card .stat-value {
    display: block;
    font-size: 1.75rem;
    color: var(--color-sage-dark);
    font-weight: 700;
    font-family: var(--font-display);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-sage-dark);
    color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px var(--color-shadow-heavy);
    opacity: 0;
    transform: translateY(100px);
    transition: all var(--transition-smooth);
    z-index: 1000;
    font-weight: 500;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

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

.toast.error {
    background: #E57373;
}

/* Loading State */
.btn-loader {
    display: inline-block;
}

button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--color-slate-light);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: var(--space-md);
    }
    
    .header {
        padding: var(--space-md) var(--space-lg);
    }
    
    .app-title {
        font-size: 1.75rem;
    }
    
    .entry-section,
    .entries-section {
        padding: var(--space-lg);
    }
    
    .mood-selector {
        justify-content: center;
    }
    
    .mood-icon {
        min-width: 70px;
    }
    
    .date-navigation {
        flex-wrap: wrap;
    }
    
    .date-search {
        width: 100%;
        order: -1;
    }
    
    .nav-btn {
        flex: 1;
    }
    
    .filter-status {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }
}
