/* 
   ✨ PREMIUM UI ENHANCEMENTS
   Cards, Fonts, and Shining Effects
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700;800&family=Lexend:wght@300;400;500;600;700;800&display=swap');

:root {
    --premium-blue: #0066FF;
    --premium-blue-light: #E7F0FF;
    --premium-success: #10B981;
    --premium-gray-text: #94A3B8;
    --premium-bg: #F9FAFB;
    --premium-fg: #0F172A;
    --premium-card-bg: #FFFFFF;
    --premium-border: rgba(0, 0, 0, 0.08);
    --premium-card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shining-duration: 2.5s;
}

/* 🌙 DARK MODE OVERRIDES */
html.dark {
    --premium-bg: #020204;
    --premium-fg: #f0f0f8;
    --premium-card-bg: #08080a;
    --premium-border: rgba(255, 255, 255, 0.1);
    --premium-card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --premium-blue-light: rgba(0, 102, 255, 0.1);
}

/* 🖋️ PREMIUM TYPOGRAPHY DESIGN SYSTEM */
body, input, button, select, textarea, .nav-item, .nav-link {
    font-family: 'Inter', 'Plus Jakarta Sans', sans-serif !important;
    background-color: var(--premium-bg) !important;
    color: var(--premium-fg) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6, .text-outfit, .display-title {
    font-family: 'Outfit', sans-serif !important;
    letter-spacing: -0.03em !important; /* Slightly tighter for that premium look */
    font-weight: 800 !important; /* Extra bold for main headers */
    color: var(--premium-fg) !important;
}

.display-title {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.5rem !important;
}


.text-muted, .small, p.text-muted {
    color: red;
    font-weight: 400;
    line-height: 1.6;
}

.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-medium { font-weight: 500 !important; }

/* Labels like "TOTAL P&L" - Using Lexend for Premium Clarity */
p.text-muted.small.fw-semibold.text-uppercase, 
.text-uppercase.small.fw-semibold {
    font-family: 'Lexend', sans-serif !important;
    letter-spacing: 0.06em !important;
    font-size: 0.65rem !important;
    color: #64748B !important;
    opacity: 0.9;
}

.subtitle-premium {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    color: #64748B !important; /* Fixed: Slightly darker for better visibility */
    letter-spacing: 0.01em !important;
    opacity: 1 !important;
}



/* 💎 PREMIUM CARDS */
.card, .card-custom {
    background: var(--premium-card-bg); /* Use variable */
    border: 1px solid var(--premium-border) !important;
    box-shadow: var(--premium-card-shadow) !important;
    border-radius: 28px !important; 
    padding: 1.5rem !important;
    transition: all 0.3s ease !important;
    margin-bottom: 1rem !important;
    position: relative;
    overflow: hidden;
}

/* Ensure background variable is used for default cards */
.card:not([style*="background"]):not(.bg-gradient-blue):not([class*="bg-"]) {
    background: var(--premium-card-bg) !important;
}

/* Specific Gradient Card (Total P&L style) */
.card.bg-gradient-blue {
    background: linear-gradient(135deg, #E0EBFF 0%, #F0F5FF 100%) !important;
}

/* Fix Visibility on ALL Gradient Cards (Subscription etc.) */
.card[style*="background: linear-gradient"], 
.card[style*="background:linear-gradient"] {
    color: #FFFFFF !important;
}

.card[style*="background: linear-gradient"] .text-muted,
.card[style*="background:linear-gradient"] .text-muted,
.card[style*="background: linear-gradient"] .small,
.card[style*="background:linear-gradient"] .small {
    color: rgba(255, 255, 255, 0.8) !important;
}

.card[style*="background: linear-gradient"] p,
.card[style*="background:linear-gradient"] p,
.card[style*="background: linear-gradient"] h3,
.card[style*="background:linear-gradient"] h3 {
    color: #FFFFFF !important;
}


/* ✨ SHINING EFFECT */
.card::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    transition: none;
    pointer-events: none;
    z-index: 1;
}

.card:hover::after {
    animation: shine var(--shining-duration) infinite linear;
}

@keyframes shine {
    0% { left: -60%; }
    100% { left: 160%; }
}

/* 🌟 HOVER ENHANCEMENTS */
.card:hover {
    transform: translateY(-5px) scale(1.01) !important;
    box-shadow: 0 20px 50px -15px rgba(0, 64, 128, 0.2), 0 0 1px rgba(0, 102, 255, 0.2) !important;
    border-color: rgba(0, 102, 255, 0.3) !important;
}

/* 📈 PREMIUM STATS & BADGES */
.badge-today, .badge-pill, .badge-total {
    background: #E0EBFF !important;
    color: var(--premium-blue) !important; /* Forced visibility */
    border: 1px solid rgba(0, 102, 255, 0.2) !important;
    font-weight: 700 !important;
    font-size: 0.65rem !important;
    text-transform: uppercase;
    padding: 0.4rem 0.8rem !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Icon Backgrounds (Pastels from Image) */
.icon-bg-blue { background: #E7F0FF !important; border-radius: 12px !important; color: #0066FF !important; }
.icon-bg-yellow { background: #FFF9E7 !important; border-radius: 12px !important; color: #F59E0B !important; }
.icon-bg-purple { background: #F5F0FF !important; border-radius: 12px !important; color: #7C3AED !important; }
.icon-bg-green { background: #E7FFF3 !important; border-radius: 12px !important; color: #10B981 !important; }

.icon-bg-blue, .icon-bg-yellow, .icon-bg-purple, .icon-bg-green {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* 🛠️ UTILITIES */
.shadow-custom {
    box-shadow: var(--premium-shadow) !important;
}

.rounded-2xl {
    border-radius: 20px !important;
}

/* 🖱️ INTERACTIVE ELEMENTS */
.nav-item, .btn, .filter-pill {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-primary {
    background: linear-gradient(135deg, #0066FF, #0052CC) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3) !important;
}

.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 102, 255, 0.4) !important;
}

/* 🎬 ANIMATIONS */
.fade-in {
    animation: fadeSlideUp 0.5s ease forwards;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Glassy Navbar (if applicable) */
.bottom-nav, .desktop-nav {
    background: var(--premium-bg) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    opacity: 0.95;
}

/* Shining Glow for important numbers */
.number-animate, .fw-bold.text-success,  h2.fw-bold {
    font-family: 'Lexend', sans-serif !important;
    color: var(--premium-fg) !important;
    font-size: 1.6rem !important; /* Slightly reduced for better balance */
    letter-spacing: -0.04em !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    text-shadow: none !important;
    line-height: 1.2 !important;
}

/* Period Filters (Pill design from image) */
.filter-pill {
    background: #F1F5F9 !important;
    color: #64748B !important; /* Forced visibility */
    border: none !important;
    border-radius: 10px !important;
    padding: 0.5rem 1.25rem !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
}

.filter-pill.active {
    background: var(--premium-blue) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2) !important;
}

/* 📊 New Period Filter Buttons */
.btn-filter-period {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 16px !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    transition: all 0.25s ease;
    cursor: pointer;
}

.btn-filter-period i {
    font-size: 1.1rem;
}

.btn-filter-period:hover {
    background: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
    transform: translateY(-1px);
}

.btn-filter-period.active {
    background: var(--premium-blue) !important;
    border-color: var(--premium-blue) !important;
    color: #FFFFFF !important;
    box-shadow: 0 8px 20px -4px rgba(0, 102, 255, 0.3) !important;
}

.btn-filter-period.active i {
    color: #FFFFFF !important;
}

/* Remove animations that might distract from the clean look */
.card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.08) !important;
}
/* 📱 MOBILE RESPONSIVE OVERRIDES */
@media (max-width: 768px) {
    .page-container {
        padding: 0.5rem !important;
    }

    .card, .card-custom {
        padding: 1rem !important;
        border-radius: 20px !important;
    }

    h1, .display-title {
        font-size: 1.3rem !important;
        letter-spacing: -0.02em !important;
    }


    .number-animate, h2.fw-bold {
        font-size: 1.2rem !important;
    }

    .icon-bg-blue, .icon-bg-yellow, .icon-bg-purple, .icon-bg-green {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    .filter-pill {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.75rem !important;
        border-radius: 8px !important;
    }

    .badge-today, .badge-pill, .badge-total {
        font-size: 0.55rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* Stack fixes for mobile */
    .d-flex.flex-md-row {
        flex-direction: column !important;
    }
}

@media (max-width: 480px) {
    .card, .card-custom {
        padding: 0.85rem !important;
    }
    
    .number-animate, h2.fw-bold {
        font-size: 1.25rem !important;
    }
}
