/**
 * Sunlight App - Aligned with Site Theme
 * Card-based design matching apps page aesthetic
 * @version 7.0.0
 */

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

.app-page.app-sunlight,
body.sunlight-app-page {
    --sunlight-accent: #F59E0B;
    --sunlight-accent-dark: #D97706;
    --sunlight-logged: #10b981;
    --sunlight-logged-dark: #059669;
}

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

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

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

/* =============================================================================
   HERO SECTION (Card)
   ============================================================================= */

.hero-section {
    background: linear-gradient(180deg, #FFFBEB 0%, #FEF3C7 100%);
    border-radius: 16px;
    box-shadow: 0 5px 15px rgb(0 0 0 / 10%);
    border: 1px solid rgb(245 158 11 / 15%);
    padding: 32px 24px;
    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: 20px;
}

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

.hero-subtitle {
    font-size: 15px;
    color: #78716C;
    margin: 0;
    line-height: 1.6;
    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: #065F46;
}

/* =============================================================================
   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: 16px;
}

.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.status-badge--pending {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #92400E;
    border: 1px solid #FCD34D;
}

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

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

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

.sunlight-app-page .btn-primary.btn-primary {
    background: #222 !important;
    color: white !important;
    border: none !important;
    border-radius: 50px;
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
    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: #444 !important;
    box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
    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 8px rgba(16, 185, 129, 0.3);
}

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


/* =============================================================================
   STREAK DISPLAY (Card)
   ============================================================================= */

.streak-container {
    background: linear-gradient(180deg, #FFFBEB 0%, #FEF3C7 100%);
    border-radius: 16px;
    box-shadow: 0 5px 15px rgb(0 0 0 / 10%);
    border: 1px solid rgb(245 158 11 / 15%);
    padding: 20px 24px;
    text-align: center;
}

.streak-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--sunlight-accent);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
}

/* =============================================================================
   WEEK VIEW (Card)
   ============================================================================= */

.week-progress {
    background: linear-gradient(180deg, #FFFBEB 0%, #FEF3C7 100%);
    border-radius: 16px;
    box-shadow: 0 5px 15px rgb(0 0 0 / 10%);
    border: 1px solid rgb(245 158 11 / 15%);
    padding: 20px 24px;
}

.week-progress-title {
    font-size: 13px;
    font-weight: 600;
    color: #92400E;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 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: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

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

.week-view--dots .day-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e5e5;
    border: 2px solid #d4d4d4;
    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);
    border-color: var(--sunlight-accent-dark);
    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: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.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: #222;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgb(0 0 0 / 20%);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

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

.toast-success {
    background: #10b981;
}

.toast-error {
    background: #ef4444;
}

.toast-info {
    background: #3b82f6;
}

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

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

    .hero-section {
        padding: 24px 20px;
    }

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

    .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;
    }

    .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: 11px;
    }

    .streak-container,
    .week-progress {
        padding: 16px 20px;
    }
}
