/* Sunlight App CSS - Simplified with Original Animation */
/* @version 6.1.0 */

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

.app-page.app-sunlight,
body.sunlight-app-page {
    --sunlight-primary: #F59E0B;
    --sunlight-secondary: #FBBF24;
    --sunlight-accent: #D97706;
    --sunlight-light: #FFFBEB;
    --sunlight-warm: #FEF3C7;
    --sunlight-dark: #92400E;
    --sunlight-logged: #059669;
    --sunlight-logged-light: #D1FAE5;
    --sunlight-logged-dark: #047857;
    --gradient-warm: linear-gradient(180deg, #FFFBEB 0%, #FEF3C7 50%, #FDE68A 100%);
}

/* =============================================================================
   BASE STYLES
   ============================================================================= */

.sunlight-app-page {
    background: var(--gradient-warm);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* =============================================================================
   HERO SECTION
   ============================================================================= */

.hero-section {
    text-align: center;
    padding: 16px 20px 20px;
}

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

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

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

.hero-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--sunlight-dark);
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 16px;
    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;
}

/* Reduced motion preference */
@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: 10px 20px;
    border-radius: 24px;
    font-size: 14px;
    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;
    box-shadow: 0 2px 8px rgba(252, 211, 77, 0.3);
}

.status-badge--logged {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    color: #047857;
    border: 1px solid #34D399;
    box-shadow: 0 2px 8px rgba(52, 211, 153, 0.3);
}

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

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

.sunlight-app-page .btn-primary.btn-primary {
    background: linear-gradient(145deg, #FBBF24 0%, #F59E0B 50%, #D97706 100%) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 16px;
    padding: 18px 48px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 4px 14px rgba(245, 158, 11, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    min-height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 220px;
}

.sunlight-app-page .btn-primary.btn-primary:hover {
    background: linear-gradient(145deg, #FCD34D 0%, #FBBF24 50%, #F59E0B 100%) !important;
    box-shadow:
        0 6px 20px rgba(245, 158, 11, 0.5),
        0 3px 6px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

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

.sunlight-app-page .btn-primary.btn-primary:disabled,
.sunlight-app-page .btn-primary.btn-primary.logged {
    background: linear-gradient(145deg, #34D399 0%, #10B981 50%, #059669 100%) !important;
    color: #FFFFFF !important;
    cursor: default;
    box-shadow:
        0 4px 14px rgba(16, 185, 129, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Undo Button */
.undo-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: transparent;
    border: 1.5px solid #bdbdbd;
    border-radius: 10px;
    color: #757575;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-10px);
}

.undo-button.visible {
    opacity: 1;
    transform: translateX(0);
}

.undo-button:hover {
    background: #fafafa;
    border-color: #9e9e9e;
    color: #616161;
}

/* =============================================================================
   STREAK DISPLAY
   ============================================================================= */

.streak-container {
    text-align: center;
}

.streak-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(145deg, #F59E0B 0%, #D97706 100%);
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

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

.week-progress {
    margin-top: 10px;
}

.week-progress-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--sunlight-dark);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    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: 14px;
    transition: all 0.2s ease;
}

.week-view--dots .week-day.today {
    background: rgba(251, 191, 36, 0.12);
    border: 2px 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: linear-gradient(145deg, #E7E5E4, #D6D3D1);
    border: 2px solid #D6D3D1;
    transition: all 0.2s ease;
}

.week-view--dots .week-day.logged .day-dot {
    background: linear-gradient(145deg, #34D399, #10B981);
    border-color: #059669;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.week-view--dots .week-day.today .day-dot {
    background: linear-gradient(145deg, #FBBF24, #F59E0B);
    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: linear-gradient(145deg, #34D399, #10B981);
    border-color: #059669;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.week-view--dots .day-label {
    font-size: 14px;
    font-weight: 600;
    color: #78716C;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.week-view--dots .week-day.today .day-label {
    color: var(--sunlight-dark);
    font-weight: 700;
}

.week-view--dots .week-day.logged .day-label {
    color: #059669;
}

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

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

.toast {
    background: #1F2937;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

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

.toast-success {
    background: linear-gradient(145deg, #10B981, #059669);
}

.toast-error {
    background: linear-gradient(145deg, #EF4444, #DC2626);
}

.toast-info {
    background: linear-gradient(145deg, #3B82F6, #2563EB);
}

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

@media (max-width: 380px) {
    .app-container {
        padding: 16px 12px 24px;
    }

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

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

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

    .sunlight-app-page .btn-primary.btn-primary {
        padding: 16px 36px;
        font-size: 16px;
        min-width: 200px;
    }

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