/**
 * Sunlight App - Your Daily Sun
 * Bright, optimistic, celebratory. One card that flows like a warm day.
 * @version 8.0.0
 */

/* =============================================================================
   THEME VARIABLES
   ============================================================================= */

.app-page.app-sunlight,
body.sunlight-app-page {
    --sunlight-accent: #D97706;
    --sunlight-accent-light: #F59E0B;
    --sunlight-accent-hover: #B45309;
    --sunlight-logged: #10b981;
    --sunlight-logged-dark: #059669;
    --sunlight-border: rgb(217 119 6 / 12%);
    --sunlight-tint: rgb(217 119 6 / 5%);
}

/* =============================================================================
   BASE LAYOUT
   ============================================================================= */

.sunlight-app-page {
    background-color: #FFFCF5;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.app-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 80px 20px 40px;
    display: flex;
    flex-direction: column;
}

/* =============================================================================
   UNIFIED SUNLIGHT CARD
   Combines hero + button + streak + week into one flowing experience
   ============================================================================= */

.sunlight-card {
    background: linear-gradient(180deg, #FFFDF5 0%, #FEF3C7 100%);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgb(217 119 6 / 8%);
    border: 1px solid var(--sunlight-border);
    padding: 36px 28px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* =============================================================================
   HERO SECTION (now part of unified card, no separate card styling)
   ============================================================================= */

.hero-section {
    text-align: center;
}

.sun-status {
    display: flex;
    justify-content: center;
    align-items: center;
}

.status-icon {
    font-size: 56px;
    display: block;
    transition: transform 0.3s ease-in-out;
}

.hero-message {
    margin-top: 16px;
}

.hero-title {
    font-size: 22px;
    font-weight: 700;
    color: #92400E;
    margin: 0 0 8px 0;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 15px;
    color: #A8A29E;
    margin: 0;
    line-height: 1.5;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

/* Logged state */
.hero-section.logged .hero-title {
    color: var(--sunlight-logged-dark);
}

.hero-section.logged .hero-subtitle {
    color: #6EE7B7;
}

/* =============================================================================
   SUN TO CHECKMARK ANIMATION
   ============================================================================= */

@keyframes sun-to-checkmark {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    5% {
        transform: scale(1.1) translateY(0);
        opacity: 0.9;
    }
    15% {
        transform: scale(1.2) translateY(-10px);
        opacity: 0.7;
    }
    25% {
        transform: scale(1.3) translateY(-15px);
        opacity: 0.4;
    }
    35% {
        transform: scale(1.4) translateY(-20px);
        opacity: 0.1;
    }
    45% {
        transform: scale(0);
        opacity: 0;
    }
    65% {
        transform: scale(0.7);
        opacity: 1;
    }
    85% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.sun-animation {
    animation: sun-to-checkmark 1s ease-in-out;
    will-change: transform, opacity;
    transform-origin: center center;
}

@media (prefers-reduced-motion: reduce) {
    .sun-animation {
        animation: none;
    }
}

/* =============================================================================
   STATUS BADGE
   ============================================================================= */

.status-label {
    text-align: center;
    margin-top: 12px;
}

.status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.status-badge--pending {
    background: var(--sunlight-tint);
    color: #92400E;
    border: 1.5px solid rgb(217 119 6 / 15%);
}

.status-badge--logged {
    background: var(--sunlight-logged);
    color: white;
    border: 1.5px solid var(--sunlight-logged);
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.sunlight-app-page .btn-primary.btn-primary {
    background: var(--sunlight-accent) !important;
    color: white !important;
    border: none !important;
    border-radius: 14px;
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 12px rgb(217 119 6 / 20%);
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 200px;
}

.sunlight-app-page .btn-primary.btn-primary:hover {
    background: var(--sunlight-accent-hover) !important;
    box-shadow: 0 4px 16px rgb(217 119 6 / 28%);
    transform: translateY(-1px);
}

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

.sunlight-app-page .btn-primary.btn-primary:disabled,
.sunlight-app-page .btn-primary.btn-primary.logged {
    background: var(--sunlight-logged) !important;
    color: white !important;
    cursor: default;
    box-shadow: 0 2px 12px rgb(16 185 129 / 20%);
}

.sunlight-app-page .btn-primary.btn-primary.logged:hover {
    transform: none;
}

/* =============================================================================
   STREAK & WEEK HEADER
   ============================================================================= */

.streak-container {
    width: 100%;
    text-align: center;
}

.streak-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--sunlight-accent-light);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

/* =============================================================================
   WEEK VIEW
   ============================================================================= */

.week-progress {
    width: 100%;
    padding-top: 4px;
    border-top: 1.5px dashed rgb(217 119 6 / 15%);
}

.week-progress-title {
    font-size: 12px;
    font-weight: 700;
    color: #92400E;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 16px 0 16px 0;
    text-align: center;
}

.week-view--dots {
    padding: 0;
}

.week-view--dots .week-days {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.week-view--dots .week-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    background: transparent;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.week-view--dots .week-day.today {
    background: rgb(217 119 6 / 8%);
    border: 1.5px solid rgb(217 119 6 / 15%);
}

.week-view--dots .week-day.logged {
    transform: scale(1.05);
}

.week-view--dots .day-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgb(217 119 6 / 8%);
    border: 2px solid rgb(217 119 6 / 15%);
    transition: all 0.2s ease;
}

.week-view--dots .week-day.logged .day-dot {
    background: var(--sunlight-logged);
    border-color: var(--sunlight-logged-dark);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.week-view--dots .week-day.today .day-dot {
    background: var(--sunlight-accent-light);
    border-color: var(--sunlight-accent);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.week-view--dots .week-day.today.logged .day-dot {
    background: var(--sunlight-logged);
    border-color: var(--sunlight-logged-dark);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.week-view--dots .day-label {
    font-size: 12px;
    font-weight: 700;
    color: #A8A29E;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.week-view--dots .week-day.today .day-label {
    color: #92400E;
}

.week-view--dots .week-day.logged .day-label {
    color: var(--sunlight-logged-dark);
}

/* Clickable logged days for undo */
.week-view--dots .week-day.logged.clickable {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.week-view--dots .week-day.logged.clickable:hover {
    transform: scale(1.1);
}

.week-view--dots .week-day.logged.clickable:hover .day-dot {
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.4);
}

.week-view--dots .week-day.logged.clickable:focus {
    outline: none;
}

.week-view--dots .week-day.logged.clickable:focus-visible .day-dot {
    outline: 2px solid var(--sunlight-logged);
    outline-offset: 2px;
}

/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */

.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--sunlight-accent);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgb(217 119 6 / 25%);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

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

.toast-success {
    background: #10b981;
    box-shadow: 0 4px 20px rgb(16 185 129 / 25%);
}

.toast-error {
    background: #ef4444;
    box-shadow: 0 4px 20px rgb(239 68 68 / 25%);
}

.toast-info {
    background: var(--sunlight-accent);
    box-shadow: 0 4px 20px rgb(217 119 6 / 25%);
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 480px) {
    .app-container {
        padding: 76px 16px 32px;
    }

    .sunlight-card {
        padding: 28px 20px 24px;
        border-radius: 16px;
        gap: 20px;
    }

    .hero-title {
        font-size: 20px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .status-icon {
        font-size: 48px;
    }

    .sunlight-app-page .btn-primary.btn-primary {
        padding: 14px 36px;
        font-size: 15px;
        min-width: 180px;
        border-radius: 12px;
    }

    .week-view--dots .week-days {
        gap: 2px;
    }

    .week-view--dots .week-day {
        padding: 10px 6px;
    }

    .week-view--dots .day-dot {
        width: 24px;
        height: 24px;
    }

    .week-view--dots .day-label {
        font-size: 10px;
    }

    .streak-container {
        padding: 0;
    }

    .week-progress {
        padding-top: 4px;
    }
}
