:root {
    /* Primary brand color - deep navy for trust */
    --navy: #1f3047;
    --navy-light: #2d4562;
    
    /* Warm neutrals - calm and peaceful */
    --bg: #FAF8F5;
    --bg-warm: #F5F1EB;
    --sand: #E8E0D5;
    --stone: #C9C0B5;
    
    /* Accent colors - soft pops of warmth */
    --terracotta: #C4937A;
    --gold: #C9A962;
    --dusty-rose: #C9A5A0;
    --sky: #8BAFC4;
    
    /* Text and UI */
    --text: #2C2C2C;
    --muted: rgba(44,44,44,.6);
    --card: #FFFFFF;
    --shadow: 0 6px 20px rgba(31,48,71,0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Josefin Slab', Georgia, serif;
    margin: 0;
    padding: 0;
    line-height: 1.7;
    background: var(--bg);
    color: var(--text);
}

h1, h2, h3, h4, h5, h6, label, nav, button, .section-title, .section-header, .badge {
    font-family: 'Josefin Sans', 'Segoe UI', sans-serif;
}

nav {
    background: var(--card);
    padding: 0.75rem 1.25rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

nav a:hover {
    background: var(--bg-warm);
    color: var(--navy);
}

nav a.active {
    background: var(--navy);
    color: white;
}

nav button {
    margin-left: auto;
    background: transparent;
    border: 2px solid var(--navy);
    color: var(--navy);
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

nav button:hover {
    background: var(--navy);
    color: white;
}

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

#loading {
    text-align: center;
    padding: 4rem;
    color: var(--muted);
    font-size: 1.1rem;
}

.header-banner {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 20px;
    margin: 1rem 0 1.5rem;
    position: relative;
}

.header-date {
    font-family: 'Josefin Slab', serif;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.header-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.day-signpost {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    margin-top: 0.75rem;
}

.section-card {
    background: var(--card);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text);
}

.section-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scripture-box {
    background: linear-gradient(135deg, #FAF8F5 0%, var(--sand) 100%);
    border-left: 4px solid var(--gold);
    padding: 1rem 1.25rem;
    border-radius: 0 16px 16px 0;
    font-style: italic;
    color: #5d4037;
    line-height: 1.8;
}

.scripture-reference {
    display: block;
    margin-top: 0.75rem;
    font-style: normal;
    font-weight: 600;
    color: var(--terracotta);
    font-size: 0.9rem;
    font-family: 'Josefin Sans', sans-serif;
}

.devotional-content {
    color: var(--text);
    line-height: 1.9;
}

.devotional-content p {
    margin-bottom: 1.25rem;
}

.reflection-question-box {
    background: linear-gradient(135deg, #FAF8F5 0%, var(--sand) 100%);
    border-left: 4px solid var(--terracotta);
    padding: 1rem 1.25rem;
    border-radius: 0 16px 16px 0;
    color: #5d4037;
    line-height: 1.8;
}

.reflection-textarea {
    width: 100%;
    min-height: 130px;
    padding: 1rem;
    border: 2px solid #E8E0D8;
    border-radius: 16px;
    font-family: 'Josefin Slab', serif;
    font-size: 1rem;
    resize: vertical;
    line-height: 1.7;
    background: #FDFBF9;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.reflection-textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 4px rgba(31, 48, 71, 0.1);
}

.reflection-textarea::placeholder {
    color: var(--muted);
}

.btn-primary {
    background: var(--navy);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(31, 48, 71, 0.3);
}

.btn-primary:hover {
    background: var(--navy-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(31, 48, 71, 0.4);
}

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

.btn-secondary {
    background: var(--terracotta);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

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

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title {
    font-weight: 700;
    color: var(--text);
    font-size: 1.1rem;
}

.save-status {
    font-size: 0.85rem;
    margin-top: 0.75rem;
    color: var(--navy);
    font-weight: 500;
}

.save-status.error {
    color: #c45a4a;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.media-item {
    border-radius: 16px;
    overflow: hidden;
    background: #f0ebe5;
    position: relative;
    aspect-ratio: 1;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item.link-item {
    background: linear-gradient(135deg, var(--bg-warm) 0%, var(--sand) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
}

.media-item.link-item .link-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--navy);
}

.media-item.link-item .link-label {
    font-size: 0.8rem;
    color: var(--text);
    word-break: break-word;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 500;
}

.media-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: 'Josefin Sans', sans-serif;
}

.upload-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.upload-modal.active {
    display: flex;
}

.upload-modal-content {
    background: var(--card);
    border-radius: 24px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.upload-modal h3 {
    margin: 0 0 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.upload-option {
    padding: 1rem;
    border: 2px solid #E8E0D8;
    border-radius: 16px;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.upload-option:hover {
    border-color: var(--navy);
    background: rgba(31, 48, 71, 0.03);
}

.upload-option label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.upload-option input[type="file"],
.upload-option input[type="url"] {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid #E8E0D8;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
}

.upload-option input[type="url"] {
    margin-bottom: 0.5rem;
}

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

.btn-cancel {
    background: transparent;
    border: 2px solid #E8E0D8;
    color: var(--muted);
    padding: 0.6rem 1.25rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #f0ebe5;
    border-color: #d0c8c0;
}

.upload-status {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    color: var(--muted);
}

.timezone-info {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    padding: 1rem 0;
}

@media (max-width: 600px) {
    main {
        padding: 0 0.75rem 1.5rem;
    }
    
    .header-banner {
        margin: 0.75rem 0 1rem;
        border-radius: 16px;
    }
    
    .section-card {
        border-radius: 16px;
        padding: 1.25rem;
    }
    
    .media-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

.calendar-loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted);
    font-size: 1.1rem;
}

.calendar-header {
    text-align: center;
    padding: 1.5rem 1rem 1rem;
}

.calendar-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 0.25rem;
}

.calendar-tagline {
    font-family: 'Josefin Slab', serif;
    font-size: 1rem;
    color: var(--muted);
    margin: 0;
    font-style: italic;
}

.calendar-controls {
    display: flex;
    justify-content: center;
    padding: 0 1rem 1rem;
    position: sticky;
    top: 52px;
    background: var(--bg);
    z-index: 50;
}

.month-dropdown {
    padding: 0.6rem 1.25rem;
    border: 2px solid #E8E0D8;
    border-radius: 20px;
    background: var(--card);
    font-size: 0.9rem;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    min-width: 180px;
}

.month-dropdown:focus {
    outline: none;
    border-color: var(--navy);
}

.timeline-container {
    position: relative;
    padding: 0 1rem 5rem;
}

.timeline-line {
    position: absolute;
    left: 28px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--terracotta) 0%, var(--gold) 100%);
    border-radius: 3px;
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.timeline-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    transition: transform 0.15s;
}

.timeline-card:hover {
    transform: translateX(4px);
}

.timeline-card:active {
    transform: translateX(2px);
}

.timeline-card.today-card .timeline-card-content {
    border: 2px solid var(--gold);
}

.timeline-check {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #d0c8c0;
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}

.timeline-check.filled {
    background: var(--terracotta);
    border-color: var(--terracotta);
}

.timeline-card-content {
    flex: 1;
    background: var(--card);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.timeline-card:hover .timeline-card-content {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.timeline-date {
    font-family: 'Josefin Slab', serif;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.timeline-day-number {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--navy);
    background: rgba(31, 48, 71, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 0.4rem;
}

.timeline-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.timeline-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-reflection {
    background: var(--dusty-rose);
    color: #5a3d3a;
}

.badge-photo {
    background: var(--sky);
    color: white;
}

.badge-video {
    background: var(--gold);
    color: #5a4a20;
}

.today-floating-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--terracotta);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(196, 147, 122, 0.35);
    z-index: 100;
    transition: all 0.2s;
    font-family: 'Josefin Sans', sans-serif;
}

.today-floating-btn:hover {
    background: #b07f68;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(196, 147, 122, 0.45);
}

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

@media (max-width: 600px) {
    .timeline-line {
        left: 22px;
    }
    
    .timeline-check {
        width: 24px;
        height: 24px;
    }
    
    .timeline-card-content {
        padding: 0.875rem 1rem;
    }
    
    .calendar-controls {
        top: 48px;
    }
    
    .today-floating-btn {
        bottom: 16px;
        right: 16px;
        padding: 0.75rem 1.5rem;
    }
}

.login-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--card);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.login-container h1 {
    font-family: 'Josefin Sans', sans-serif;
    text-align: center;
    color: var(--navy);
    margin-bottom: 1.5rem;
}

.login-container input {
    width: 100%;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    border: 2px solid #E8E0D8;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
}

.login-container input:focus {
    outline: none;
    border-color: var(--navy);
}

.login-container button {
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Progress Page Styles */
.progress-header {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
}

.progress-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.5rem;
}

.progress-subtext {
    color: var(--muted);
    font-size: 1rem;
    margin: 0;
    font-style: italic;
}

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

.badge-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 1rem;
    padding-left: 0.25rem;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 600px) {
    .badge-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.badge-card {
    background: var(--card);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.badge-card.badge-earned {
    box-shadow: 0 6px 24px rgba(46, 127, 51, 0.15), 0 0 0 2px rgba(46, 127, 51, 0.1);
}

.badge-card.badge-locked {
    opacity: 0.7;
}

.badge-card.badge-locked .badge-image {
    filter: grayscale(60%);
}

.badge-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 0.75rem;
    border-radius: 8px;
}

.badge-name {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.badge-description {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.4;
}

.no-badges-message {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
    font-style: italic;
}
