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

/* Default Warm Linen Theme */
:root {
    --bg: #faf6f1;
    --bg-gradient: linear-gradient(160deg, #fdfbf8 0%, #f7f1e9 40%, #f0e6d8 100%);
    --surface: rgba(255, 255, 255, 0.85);
    --surface-hover: rgba(255, 253, 250, 0.95);
    --border: #e5ddd2;
    --text: #4a4039;
    --text-muted: #9a8b7c;
    --accent: #b8956c;
    --accent-hover: #c9a67d;
    --accent-glow: rgba(184, 149, 108, 0.25);
    --success: #7cb377;
    --danger: #c75f5f;
    --recording: #c75f5f;
    --glass: rgba(139, 119, 101, 0.06);
}

/* Dark Theme (Midnight) */
[data-theme="dark"] {
    --bg: #0a0a0b;
    --bg-gradient: linear-gradient(180deg, #0a0a0b 0%, #1a1a2e 100%);
    --surface: rgba(20, 20, 22, 0.95);
    --surface-hover: rgba(28, 28, 31, 0.95);
    --border: #2a2a2d;
    --text: #fafafa;
    --text-muted: #71717a;
    --accent: #8b5cf6;
    --accent-hover: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --success: #22c55e;
    --danger: #ef4444;
    --recording: #ef4444;
    --glass: rgba(255, 255, 255, 0.05);
}

/* Light Theme (Daylight) */
[data-theme="light"] {
    --bg: #f8f9fa;
    --bg-gradient: linear-gradient(180deg, #ffffff 0%, #e8f4f8 100%);
    --surface: rgba(255, 255, 255, 0.95);
    --surface-hover: rgba(248, 249, 250, 0.95);
    --border: #e2e8f0;
    --text: #1a202c;
    --text-muted: #64748b;
    --accent: #7c3aed;
    --accent-hover: #8b5cf6;
    --accent-glow: rgba(124, 58, 237, 0.3);
    --glass: rgba(0, 0, 0, 0.03);
}

/* Sunset Theme */
[data-theme="sunset"] {
    --bg: #1a1423;
    --bg-gradient: linear-gradient(180deg, #2d1b3d 0%, #1a1423 50%, #0f0a14 100%);
    --surface: rgba(45, 27, 61, 0.9);
    --surface-hover: rgba(60, 36, 82, 0.9);
    --border: #4a3562;
    --text: #fef3c7;
    --text-muted: #c4a77d;
    --accent: #f59e0b;
    --accent-hover: #fbbf24;
    --accent-glow: rgba(245, 158, 11, 0.4);
    --glass: rgba(255, 200, 100, 0.05);
}

/* Forest Theme */
[data-theme="forest"] {
    --bg: #0c1a14;
    --bg-gradient: linear-gradient(180deg, #1a2f23 0%, #0c1a14 100%);
    --surface: rgba(26, 47, 35, 0.9);
    --surface-hover: rgba(34, 60, 45, 0.9);
    --border: #2d5a40;
    --text: #e8f5e8;
    --text-muted: #7cb380;
    --accent: #10b981;
    --accent-hover: #34d399;
    --accent-glow: rgba(16, 185, 129, 0.4);
    --glass: rgba(100, 255, 150, 0.05);
}

/* Ocean Theme */
[data-theme="ocean"] {
    --bg: #0a1628;
    --bg-gradient: linear-gradient(180deg, #1e3a5f 0%, #0a1628 100%);
    --surface: rgba(30, 58, 95, 0.9);
    --surface-hover: rgba(40, 75, 120, 0.9);
    --border: #2563eb50;
    --text: #e0f2fe;
    --text-muted: #7dd3fc;
    --accent: #0ea5e9;
    --accent-hover: #38bdf8;
    --accent-glow: rgba(14, 165, 233, 0.4);
    --glass: rgba(100, 200, 255, 0.05);
}

/* Lavender Theme */
[data-theme="lavender"] {
    --bg: #1a1625;
    --bg-gradient: linear-gradient(180deg, #2d2640 0%, #1a1625 100%);
    --surface: rgba(45, 38, 64, 0.9);
    --surface-hover: rgba(58, 49, 82, 0.9);
    --border: #6b5b9550;
    --text: #f3e8ff;
    --text-muted: #c4b5fd;
    --accent: #a78bfa;
    --accent-hover: #c4b5fd;
    --accent-glow: rgba(167, 139, 250, 0.4);
    --glass: rgba(200, 150, 255, 0.05);
}

/* Amber Theme - Warm and Poetic (Alfaaz default) */
[data-theme="amber"] {
    --bg: #1a1510;
    --bg-gradient: linear-gradient(180deg, #2d2418 0%, #1a1510 50%, #0f0d0a 100%);
    --surface: rgba(45, 36, 24, 0.9);
    --surface-hover: rgba(60, 48, 32, 0.9);
    --border: #5c4a3550;
    --text: #fef3e2;
    --text-muted: #d4a574;
    --accent: #f5a623;
    --accent-hover: #ffc857;
    --accent-glow: rgba(245, 166, 35, 0.4);
    --glass: rgba(255, 200, 100, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient, var(--bg));
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background 0.5s ease, color 0.3s ease;
}

/* Custom background image support */
body.has-custom-bg {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.has-custom-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: -1;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

.screen {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

.hidden {
    display: none !important;
}

/* Auth Screen */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px 24px;
}

.auth-welcome {
    font-family: 'Lora', Georgia, serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    opacity: 0;
    animation: fadeIn 0.8s ease 0.2s forwards;
}

.auth-container h1.alfaaz-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 4.5rem;
    font-weight: 500;
    font-style: italic;
    margin-bottom: 16px;
    color: var(--text);
    letter-spacing: 3px;
    opacity: 0;
    animation: fadeIn 0.8s ease 0.4s forwards;
}

.auth-container h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.tagline {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.3px;
    opacity: 0;
    animation: fadeIn 0.8s ease 0.6s forwards;
}

.auth-decoration {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    margin: 32px 0 40px;
    opacity: 0;
    animation: fadeIn 0.8s ease 0.8s forwards;
}

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

/* Google Sign In Button */
.google-btn {
    width: 100%;
    max-width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    background: #ffffff;
    color: #3d3d3d;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.google-btn:hover {
    background: #fefefe;
    border-color: #d0d0d0;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.google-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.google-icon {
    flex-shrink: 0;
}

/* Auth Divider */
.auth-divider {
    width: 100%;
    max-width: 300px;
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#auth-form {
    width: 100%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 16px;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: all 0.25s ease;
}

input:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Buttons */
.btn {
    padding: 13px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn.primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateY(-1px);
}

.btn.secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn.secondary:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--text);
}

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

.error {
    color: var(--danger);
    font-size: 14px;
    margin-top: 12px;
    animation: shake 0.4s ease;
}

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

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.header-greeting {
    flex: 1;
}

.header-greeting h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.greeting-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 4px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--surface);
}

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

/* Date Display */
.date-display {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* On This Day Memories */
.on-this-day {
    margin-bottom: 24px;
    animation: fadeIn 0.5s ease;
}

.otd-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.otd-icon {
    font-size: 1.1rem;
    animation: sparkle 2s ease-in-out infinite;
}

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

.otd-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.otd-memories {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.otd-memories::-webkit-scrollbar {
    height: 4px;
}

.otd-memories::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.otd-card {
    flex: 0 0 auto;
    width: 260px;
    background: var(--surface);
    border-radius: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

.otd-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.otd-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.otd-card:hover::before {
    opacity: 1;
}

.otd-card:active {
    transform: scale(0.98);
}

.otd-year {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
    padding: 4px 10px;
    background: var(--accent-glow);
    border-radius: 20px;
}

.otd-years-ago {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.otd-preview {
    font-family: 'Lora', Georgia, serif;
    font-size: 14px;
    font-style: italic;
    color: var(--text);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.otd-photo-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Empty state for no memories */
.otd-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
    background: var(--glass);
    border-radius: 12px;
    border: 1px dashed var(--border);
}

.otd-empty-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
}

/* Moments */
#moments-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

#moments-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.moment-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    animation: slideUp 0.3s ease;
}

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

.moment-card:hover {
    border-color: var(--text-muted);
}

.moment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.moment-time {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.moment-location {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 2px;
}

.moment-text {
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.7;
    color: var(--text);
    letter-spacing: 0.2px;
}

.moment-edit-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    border: 2px solid var(--accent);
    border-radius: 10px;
    resize: vertical;
    font-family: inherit;
    outline: none;
}

.moment-edit-input:focus {
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.moment-photos {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.moment-photo {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.moment-photo:hover {
    transform: scale(1.05);
    border-color: var(--accent);
}

/* Photo preview modal */
.photo-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 250;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}

.photo-preview-modal img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
}

/* Standalone photo card (no text) */
.moment-card.photo-only .moment-photos {
    margin-top: 0;
}

.moment-photo-standalone {
    width: 100%;
    max-height: 300px;
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.2s ease;
}

.moment-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    gap: 8px;
}

.moment-actions button {
    font-size: 12px;
    padding: 8px 14px;
    border-radius: 8px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.empty-emoji {
    font-size: 3rem;
    margin-bottom: 8px;
    opacity: 0.8;
}

.empty-state > span:nth-child(2) {
    font-size: 1.1rem;
    color: var(--text);
    font-weight: 500;
}

.empty-hint {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Record Button */
.record-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
}

.record-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.photo-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    transform: scale(1.05);
}

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

.photo-icon {
    font-size: 24px;
}

.record-btn {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px var(--accent-glow);
    position: relative;
}

.record-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    filter: blur(12px);
}

.record-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px var(--accent-glow);
}

.record-btn:hover::before {
    opacity: 0.5;
}

.record-btn:active {
    transform: scale(0.98);
}

.record-btn.recording {
    background: linear-gradient(135deg, var(--recording), #f87171);
    animation: pulse 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.4);
}

.record-btn.recording::before {
    background: linear-gradient(135deg, var(--recording), #f87171);
    opacity: 0.6;
}

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

.mic-icon {
    font-size: 36px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

#record-status {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Generate Button */
.generate-btn {
    width: 100%;
    margin-top: 16px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    box-shadow: 0 4px 20px var(--accent-glow);
    font-size: 16px;
    padding: 16px 24px;
}

.generate-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover), #c4b5fd);
    box-shadow: 0 6px 28px var(--accent-glow);
    transform: translateY(-2px);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--surface);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    animation: modalSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.entry-content {
    padding: 24px;
    line-height: 1.9;
    font-size: 15px;
}

.entry-text {
    font-family: 'Lora', Georgia, serif;
    font-size: 16px;
    line-height: 1.95;
    letter-spacing: 0.2px;
    white-space: pre-wrap;
    color: var(--text);
}

.entry-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    justify-content: center;
}

/* Polaroid style photo container */
.polaroid {
    background: #fefefe;
    padding: 12px 12px 44px 12px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    max-width: 200px;
}

.polaroid:nth-child(odd) {
    transform: rotate(-2deg);
}

.polaroid:nth-child(even) {
    transform: rotate(2deg);
}

.polaroid:nth-child(3n) {
    transform: rotate(-1deg);
}

.polaroid:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.polaroid-image {
    width: 176px;
    height: 176px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    filter: saturate(1.05) contrast(1.02);
}

.polaroid-caption {
    font-family: 'Caveat', cursive;
    font-size: 18px;
    font-weight: 500;
    color: #2c2c2c;
    text-align: center;
    position: absolute;
    bottom: 10px;
    left: 12px;
    right: 12px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Legacy support for entries without captions */
.entry-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.entry-photo:hover {
    transform: scale(1.03);
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    bottom: 0;
}

.modal-actions .btn {
    flex: 1;
}

/* Settings */
.settings-modal-content {
    max-height: 90vh;
}

.settings-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.settings-form label {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.hint {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.8;
    margin-top: -4px;
}

/* Reminder Settings */
.section-header-with-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-header-with-toggle h3 {
    margin: 0;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex-direction: row;
}

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

.toggle-slider {
    width: 48px;
    height: 26px;
    background: var(--border);
    border-radius: 13px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--text);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
}

.toggle-container input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-container input:checked + .toggle-slider::before {
    transform: translateX(22px);
    background: white;
}

.toggle-label {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.reminder-time-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--glass);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.reminder-time-container label {
    font-size: 13px;
    color: var(--text-muted);
    flex-direction: row;
    gap: 0;
}

.reminder-time-container input[type="time"] {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    width: auto;
    cursor: pointer;
}

.reminder-time-container input[type="time"]:focus {
    border-color: var(--accent);
    outline: none;
}

.reminder-status {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 12px;
    background: var(--glass);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reminder-status.active {
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.reminder-status.denied {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Theme Grid */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.theme-btn.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.theme-btn span {
    font-size: 11px;
    color: var(--text);
}

.theme-preview {
    width: 100%;
    height: 40px;
    border-radius: 8px;
}

.dark-preview {
    background: linear-gradient(135deg, #0a0a0b 0%, #1a1a2e 100%);
}

.light-preview {
    background: linear-gradient(135deg, #ffffff 0%, #e8f4f8 100%);
}

.sunset-preview {
    background: linear-gradient(135deg, #f59e0b 0%, #2d1b3d 100%);
}

.forest-preview {
    background: linear-gradient(135deg, #10b981 0%, #0c1a14 100%);
}

.ocean-preview {
    background: linear-gradient(135deg, #0ea5e9 0%, #0a1628 100%);
}

.lavender-preview {
    background: linear-gradient(135deg, #a78bfa 0%, #1a1625 100%);
}

.amber-preview {
    background: linear-gradient(135deg, #f5a623 0%, #1a1510 100%);
}

/* Custom Background */
.custom-bg-options {
    display: flex;
    gap: 10px;
}

.custom-bg-options .btn {
    flex: 1;
    font-size: 13px;
    padding: 10px 16px;
}

.bg-preview {
    margin-top: 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.bg-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

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

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.toast.success {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--surface), rgba(34, 197, 94, 0.1));
}

.toast.error {
    border-color: var(--danger);
    background: linear-gradient(135deg, var(--surface), rgba(239, 68, 68, 0.1));
}

.toast.hiding {
    animation: toastOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

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

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 340px;
    max-width: 90vw;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

#entries-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.entry-card {
    background: var(--bg);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.entry-card:hover {
    border-color: var(--accent);
    transform: translateX(-4px);
}

.entry-card:active {
    transform: scale(0.98);
}

.entry-date {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.entry-preview {
    font-family: 'Lora', Georgia, serif;
    font-size: 14px;
    font-style: italic;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.7;
}

.no-entries {
    text-align: center;
    color: var(--text-muted);
    padding: 48px 20px;
    line-height: 1.8;
}

/* Responsive */
@media (max-width: 480px) {
    #app {
        max-width: 100%;
    }

    .screen {
        padding: 16px;
    }

    .sidebar {
        width: 100%;
        max-width: 100%;
    }

    .record-btn {
        width: 80px;
        height: 80px;
    }

    .mic-icon {
        font-size: 32px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
