/*
 * The Digital Curator Design System
 * 
 * Philosophy: Intentional Asymmetry, Tonal Depth, No-Line borders.
 * Derived from Stitch Design: e-wallet-system
 */

@font-face {
    font-family: 'Manrope';
    src: url('../fonts/manrope-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Manrope';
    src: url('../fonts/manrope-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Precise Color Tokens from Stitch */
    --primary: #001f41;
    --primary-container: #0f3460;
    --primary-fixed: #d5e3ff;
    --on-primary-container: #7f9dd0;
    
    --secondary: #b71d3f;
    --secondary-container: #fc536d;
    --secondary-fixed: #ffdadb;
    
    --tertiary: #351700;
    --tertiary-fixed: #ffdcc5;
    --on-tertiary-fixed: #301400;
    
    --surface: #f7f9fc;
    --surface-container-low: #f2f4f7;
    --surface-container-lowest: #ffffff;
    --surface-container-high: #e6e8eb;
    --surface-container-highest: #e0e3e6;
    --surface-bright: #f7f9fc;
    --surface-variant: #e0e3e6;
    
    --on-surface: #191c1e;
    --on-surface-variant: #43474f;
    --outline: #747780;
    --outline-variant: rgba(195, 198, 208, 0.15);
    
    /* Typography */
    --font-headline: 'Manrope', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    background-color: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .display-font {
    font-family: var(--font-headline);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary);
}

/* Layout - Sidebar and Main */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background-color: var(--surface-container-lowest);
    border-right: 0;
    position: fixed;
    height: 100vh;
    z-index: 1000; /* Higher z-index for mobile overlay */
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
}

.main-wrapper {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Toggle Classes */
.sidebar.collapsed {
    width: 80px;
    padding: 2.5rem 0.75rem;
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-link-curator span,
.sidebar.collapsed .upgrade-box {
    display: none;
}

.sidebar.collapsed .nav-link-curator {
    justify-content: center;
    padding: 0.75rem;
}

.main-wrapper.expanded {
    margin-left: 80px;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 31, 65, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px !important; /* Force width on mobile */
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0 !important;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

/* Global Top Nav */
.top-nav {
    padding: 1.5rem 2.5rem;
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 90;
}

/* Nav Item Styling */
.nav-link-curator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--on-surface-variant);
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.nav-link-curator:hover {
    background-color: var(--surface-container-low);
    color: var(--primary);
}

.nav-link-curator.active {
    background-color: var(--surface-container-high);
    color: var(--primary);
    border-left: 4px solid var(--secondary);
}

/* Cards - Bento Style */
.bento-card {
    background-color: var(--surface-container-lowest);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(25, 28, 30, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 0;
}

@media (max-width: 767.98px) {
    .bento-card {
        padding: 1.5rem;
    }
}

.bento-card:hover {
    box-shadow: 0 10px 30px rgba(25, 28, 30, 0.08);
}

.hero-balance-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
    color: var(--surface-container-lowest);
    border-radius: 1.5rem;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 31, 65, 0.2);
}

@media (max-width: 767.98px) {
    .hero-balance-card {
        padding: 2rem 1.5rem;
    }
    
    .hero-balance-card h1 {
        font-size: clamp(2rem, 10vw, 3rem) !important;
    }
    
    .hero-balance-card::after {
        width: 150px;
        height: 150px;
        top: -10%;
        right: -5%;
    }
}

.hero-balance-card::after {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: var(--secondary);
    opacity: 0.08;
    border-radius: 50%;
    filter: blur(60px);
}

/* Icons Wrapper */
.icon-box {
    width: 48px;
    height: 48px;
    background-color: var(--surface-container-high);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

/* Action Buttons */
.action-button {
    background: var(--surface-container-lowest);
    border: 0;
    border-radius: 1.25rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.action-button:hover {
    background: var(--surface-bright);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.action-button i {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

/* Badges */
.badge-curator {
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-secondary {
    background-color: var(--secondary);
    color: white;
}

/* Ghost Inputs */
.ghost-input {
    background-color: var(--surface-container-high);
    border: 0;
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    width: 100%;
}

.ghost-input:focus {
    outline: 0;
    box-shadow: 0 0 0 2px rgba(0, 31, 65, 0.2);
}

/* Mobile Table - Card Style Transformation */
@media (max-width: 991.98px) {
    .table-mobile-cards thead {
        display: none;
    }
    
    .table-mobile-cards tr {
        display: block;
        padding: 1.5rem;
        border-bottom: 1px solid var(--surface-container-low) !important;
        position: relative;
    }
    
    .table-mobile-cards td {
        display: block;
        padding: 0.5rem 0 !important;
        border: 0 !important;
        text-align: left !important;
    }
    
    .table-mobile-cards .mobile-hide {
        display: none !important;
    }
    
    /* Ensure action/amount is prominent */
    .table-mobile-cards .mobile-amount {
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        text-align: right !important;
    }
}
