/**
 * Sunlight App - Card-Based Dashboard Design
 * @version 7.0.0
 */

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

.app-sunlight {
    --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;

    /* Override app accent for dashboard cards */
    --app-accent: var(--sunlight-primary);
    --app-accent-dark: var(--sunlight-accent);
    --app-accent-light: rgba(245, 158, 11, 0.1);
    --card-bg: #ffffff;
    --card-border: rgba(245, 158, 11, 0.15);
    --card-shadow: rgba(245, 158, 11, 0.1);
    --card-shadow-hover: rgba(245, 158, 11, 0.2);
}

/* =============================================================================
   DASHBOARD LAYOUT
   ============================================================================= */

.sunlight-dashboard {
    background: linear-gradient(180deg, #FFFBEB 0%, #FEF3C7 50%, #FDE68A 100%);
    min-height: 100vh;
    padding: calc(var(--header-height, 60px) + 20px) 16px 32px;
}

@media (min-width: 640px) {
    .sunlight-dashboard {
        padding: calc(var(--header-height, 60px) + 24px) 24px 40px;
    }
}

/* =============================================================================
   HERO CARD STYLING
   ============================================================================= */

.sunlight-dashboard .hero-card {
    border: 2px solid var(--card-border);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 251, 235, 0.9) 100%
    );
}

.sunlight-dashboard .hero-card .hero-icon {
    font-size: 5rem;
    margin-bottom: var(--spacing-md, 1rem);
    transition: transform 0.3s ease-in-out;
}

.sunlight-dashboard .hero-card .hero-title {
    color: var(--sunlight-dark);
    font-size: 1.75rem;
}

.sunlight-dashboard .hero-card .hero-subtitle {
    color: #78716C;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.sunlight-dashboard .hero-card--logged {
    background: linear-gradient(
        135deg,
        rgba(209, 250, 229, 0.3) 0%,
        rgba(255, 255, 255, 0.95) 50%,
        rgba(209, 250, 229, 0.3) 100%
    );
    border-color: rgba(5, 150, 105, 0.2);
}

.sunlight-dashboard .hero-card--logged .hero-title {
    color: #047857;
}

.sunlight-dashboard .hero-card--logged .hero-subtitle {
    color: #065F46;
}

.sunlight-dashboard .hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm, 0.75rem);
    margin-top: var(--spacing-lg, 1.5rem);
    width: 100%;
    max-width: 280px;
}

/* =============================================================================
   SUN TO CHECKMARK ANIMATION (PRESERVED)
   ============================================================================= */

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

/* =============================================================================
   QUICK ACTION BUTTON STYLING
   ============================================================================= */

.sunlight-dashboard .quick-action-btn {
    background: linear-gradient(145deg, #FBBF24 0%, #F59E0B 50%, #D97706 100%);
    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);
    font-weight: 600;
    border-radius: 16px;
    min-width: 200px;
}

.sunlight-dashboard .quick-action-btn:hover:not(:disabled) {
    background: linear-gradient(145deg, #FCD34D 0%, #FBBF24 50%, #F59E0B 100%);
    box-shadow:
        0 6px 20px rgba(245, 158, 11, 0.5),
        0 3px 6px rgba(0, 0, 0, 0.12);
}

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

.sunlight-dashboard .quick-action-btn.logged:hover {
    transform: none;
    box-shadow:
        0 4px 14px rgba(16, 185, 129, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.sunlight-dashboard .quick-action-btn--secondary {
    background: transparent;
    color: #757575;
    border: 1.5px solid #bdbdbd;
    box-shadow: none;
    min-width: auto;
    padding: 10px 20px;
    font-size: 0.875rem;
}

.sunlight-dashboard .quick-action-btn--secondary:hover {
    background: #fafafa;
    border-color: #9e9e9e;
    color: #616161;
    box-shadow: none;
    transform: none;
}

/* =============================================================================
   STAT CARDS ENHANCEMENT
   ============================================================================= */

.sunlight-dashboard .stat-value {
    color: var(--sunlight-primary);
}

.sunlight-dashboard .stat-label {
    color: var(--sunlight-accent);
}

.sunlight-dashboard .stat-trend--up {
    background: linear-gradient(145deg, #F59E0B 0%, #D97706 100%);
    color: #FFFFFF;
}

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

.sunlight-dashboard .week-view {
    padding: var(--spacing-sm, 0.75rem) 0;
}

.sunlight-dashboard .week-day {
    padding: var(--spacing-md, 1rem) var(--spacing-sm, 0.5rem);
    border-radius: var(--border-radius-lg, 12px);
}

.sunlight-dashboard .week-day--today {
    background: rgba(251, 191, 36, 0.12);
    border: 2px solid rgba(251, 191, 36, 0.3);
}

.sunlight-dashboard .week-day-label {
    font-weight: 600;
    color: #78716C;
    text-transform: uppercase;
}

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

.sunlight-dashboard .week-day-dot {
    width: 24px;
    height: 24px;
    background: linear-gradient(145deg, #E7E5E4, #D6D3D1);
    border: 2px solid #D6D3D1;
}

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

.sunlight-dashboard .week-day--today .week-day-dot:not(.week-day-dot--filled) {
    background: linear-gradient(145deg, #FBBF24, #F59E0B);
    border-color: var(--sunlight-accent);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.sunlight-dashboard .week-day-date {
    font-weight: 600;
    color: var(--text-secondary, #666);
}

.sunlight-dashboard .week-day--today .week-day-date {
    color: var(--sunlight-dark);
}

.sunlight-dashboard .week-day[data-logged="true"] .week-day-label,
.sunlight-dashboard .week-day[data-logged="true"] .week-day-date {
    color: #059669;
}

/* =============================================================================
   STATUS INDICATOR OVERRIDES
   ============================================================================= */

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

.sunlight-dashboard .status-indicator--success {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    color: #047857;
    border: 1px solid #34D399;
}

/* =============================================================================
   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, #F59E0B, #D97706);
}

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

@media (max-width: 380px) {
    .sunlight-dashboard .hero-card .hero-icon {
        font-size: 4rem;
    }

    .sunlight-dashboard .hero-card .hero-title {
        font-size: 1.5rem;
    }

    .sunlight-dashboard .hero-card .hero-subtitle {
        font-size: 0.875rem;
    }

    .sunlight-dashboard .stat-value {
        font-size: 2rem;
    }

    .sunlight-dashboard .week-day {
        padding: var(--spacing-sm, 0.5rem) var(--spacing-xs, 0.25rem);
    }

    .sunlight-dashboard .week-day-dot {
        width: 20px;
        height: 20px;
    }

    .sunlight-dashboard .week-day-label {
        font-size: 0.625rem;
    }

    .sunlight-dashboard .week-day-date {
        font-size: 0.75rem;
    }
}

/* =============================================================================
   DARK THEME SUPPORT
   ============================================================================= */

[data-theme="dark"] .sunlight-dashboard {
    background: linear-gradient(180deg, #1E1A16 0%, #2D2520 50%, #3D3530 100%);
    --card-bg: #2D2520;
    --card-border: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sunlight-dashboard .hero-card {
    background: linear-gradient(
        135deg,
        rgba(45, 37, 32, 0.95) 0%,
        rgba(61, 53, 48, 0.9) 100%
    );
}

[data-theme="dark"] .sunlight-dashboard .hero-card .hero-title {
    color: #FCD34D;
}

[data-theme="dark"] .sunlight-dashboard .hero-card .hero-subtitle {
    color: #A8A29E;
}

/* =============================================================================
   REDUCED MOTION
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
    .sunlight-dashboard .dashboard-card,
    .sunlight-dashboard .quick-action-btn,
    .sunlight-dashboard .hero-icon,
    .toast {
        transition: none;
    }

    .sunlight-dashboard .dashboard-card:hover,
    .sunlight-dashboard .quick-action-btn:hover {
        transform: none;
    }
}
