/* ============================================
   MOBILE APP-LIKE DESIGN SYSTEM
   Modern, User-Friendly Interface
   ============================================ */

:root {
    /* Primary Colors - Modern Gradient Theme */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    
    /* Semantic Colors */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Neutral Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    /* line-height: 1.6; */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ============================================
   APP CONTAINER & LAYOUT
   ============================================ */

.app-container {
    max-width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--bg-secondary);
}

.app-content {
    padding: var(--spacing-md);
    padding-bottom: 100px; /* Space for bottom nav - increased to prevent content hiding */
}

@media (min-width: 768px) {
    .app-container {
        max-width: 480px;
        box-shadow: var(--shadow-xl);
    }
}

/* ============================================
   MOBILE APP HEADER
   ============================================ */

.app-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.app-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.app-header-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: var(--spacing-xs);
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.header-icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
}

.header-icon-btn:hover,
.header-icon-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 2px solid white;
    object-fit: cover;
}

/* ============================================
   BOTTOM NAVIGATION (MOBILE APP STYLE)
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: var(--spacing-sm) 0;
    z-index: 1000;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--primary-color);
    border-radius: var(--radius-full);
}

.bottom-nav-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.bottom-nav-label {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}



/* ============================================
   CARDS (MOBILE APP STYLE)
   ============================================ */

.app-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    transition: all var(--transition-base);
}

.app-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.app-card-title {
    /*   */
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.app-card-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.app-card-body {
    color: var(--text-secondary);
}

.app-card-footer {
    margin-top: var(--spacing-md);
    /* padding-top: var(--spacing-md); */
    border-top: 1px solid var(--border-color);
    /* display: flex; */
    justify-content: space-between;
    align-items: center;
}

/* ============================================
   BUTTONS (TOUCH-FRIENDLY)
   ============================================ */

.btn-app {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    min-height: 48px; /* Touch-friendly */
    box-shadow: var(--shadow-sm);
}

.btn-app:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-full {
    width: 100%;
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-full);
}

/* ============================================
   FORMS (MOBILE-OPTIMIZED)
   ============================================ */

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.form-input {
    width: 100%;
    padding: var(--spacing-md);
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    transition: all var(--transition-base);
    min-height: 48px; /* Touch-friendly */
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ============================================
   STATISTICS CARDS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.3;
}

/* ============================================
   LIST ITEMS (SWIPEABLE STYLE)
   ============================================ */

.app-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.app-list-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    cursor: pointer;
}

.app-list-item:hover,
.app-list-item:active {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.list-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.list-item-amount {
    font-weight: 700;
    font-size: 1.125rem;
}

.list-item-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============================================
   BADGES & CHIPS
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* ============================================
   MODAL (BOTTOM SHEET STYLE)
   ============================================ */

.modal-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--spacing-lg);
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform var(--transition-slow);
    z-index: 2000;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-mobile.show {
    transform: translateY(0);
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    margin: 0 auto var(--spacing-lg);
}

.modal-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: var(--bg-tertiary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--border-color);
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
    z-index: 1999;
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: all;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ============================================
   PULL TO REFRESH INDICATOR
   ============================================ */

.pull-indicator {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-base);
    z-index: 1001;
}

.pull-indicator.show {
    transform: translateX(-50%) scale(1);
}

.pull-indicator i {
    color: var(--primary-color);
    animation: pulse 1s infinite;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    background: white;
    border-radius: var(--radius-lg);
    margin: var(--spacing-lg) 0;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-md);
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-state-message {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

/* ============================================
   LOADING STATES
   ============================================ */

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

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

@media (max-width: 480px) {
    :root {
        --spacing-md: 0.875rem;
        --spacing-lg: 1.25rem;
    }
    
    .app-header {
        padding: var(--spacing-md);
    }
    
    .app-content {
        padding: var(--spacing-sm);
    }
    
    .stat-card {
        padding: var(--spacing-md);
    }
}

@media (min-width: 768px) {
    .bottom-nav {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .fab {
        right: calc(50% - 240px + var(--spacing-md));
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }

/* Hide scrollbar but keep functionality */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}