/* Fincozy - Personal Finance App Styles */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Round');

/* CSS Variables for Design System */
html {
    touch-action: pan-x pan-y;
    overscroll-behavior-y: none;
    -webkit-text-size-adjust: 100%;
}

body {
    overscroll-behavior-y: none;

}

:root {
    /* Purple & White Theme */
    --primary: #7C3AED;
    --primary-light: #8B5CF6;
    --primary-dark: #6D28D9;

    /* Light Mode Colors */
    --background-light: #F8FAFC;
    --card-light: #FFFFFF;
    --text-primary-light: #0F172A;
    --text-secondary-light: #64748B;
    --border-light: #E2E8F0;

    /* Dark Mode Colors */
    --background-dark: #0F172A;
    --card-dark: #1E293B;
    --text-primary-dark: #F8FAFC;
    --text-secondary-dark: #94A3B8;
    --border-dark: #334155;

    /* Accent Colors */
    --emerald: #10B981;
    --rose: #F43F5E;
    --amber: #F59E0B;
    --blue: #3B82F6;
    --orange: #F97316;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;

    /* 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);
    --shadow-primary: 0 10px 25px -5px rgba(124, 58, 237, 0.3);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
    background-color: var(--background-light);
    color: var(--text-primary-light);
    transition: background-color var(--transition-base), color var(--transition-base);
}

.dark body {
    background-color: var(--background-dark);
    color: var(--text-primary-dark);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
}

p {
    line-height: 1.6;
}

/* Layout */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 6rem;
    /* Space for bottom nav */
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 3rem 1.5rem 2rem;
    padding-top: calc(3rem + env(safe-area-inset-top));
    border-radius: 0 0 2.5rem 2.5rem;
    box-shadow: 0 10px 25px -5px rgba(124, 58, 237, 0.2);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(40px);
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.header-title {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
}

.header-total {
    text-align: center;
    color: white;
}

.header-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.9;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.header-amount {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    margin-top: 1rem;
}

/* Card Styles */
.card {
    background: var(--card-light);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

.dark .card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary-light);
}

.dark .card-subtitle {
    color: var(--text-secondary-dark);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--card-light);
    color: var(--text-primary-light);
    border: 1px solid var(--border-light);
}

.dark .btn-secondary {
    background: var(--card-dark);
    color: var(--text-primary-dark);
    border-color: var(--border-dark);
}

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

.btn-icon-lg {
    width: 3.5rem;
    height: 3.5rem;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: calc(6.5rem + env(safe-area-inset-bottom));
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-xl), var(--shadow-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 40;
}

.fab:hover {
    transform: scale(1.1);
}

.fab:active {
    transform: scale(0.9);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-light);
    padding: 0.75rem 1rem 2rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    z-index: 50;
}

.dark .bottom-nav {
    background: rgba(15, 23, 42, 0.8);
    border-top-color: var(--border-dark);
}

.nav-container {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    justify-content: space-evenly; /* Changed from space-between to space-evenly */
    align-items: center;
    gap: 0.25rem; /* Add small gap for better spacing */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    color: var(--text-secondary-light);
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
}

.dark .nav-item {
    color: var(--text-secondary-dark);
}

.nav-item:hover {
    background: rgba(124, 58, 237, 0.1);
}

.nav-item.active {
    color: var(--primary);
    background: rgba(124, 58, 237, 0.1);
}

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

.nav-label {
    font-size: 0.625rem;
    font-weight: 600;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

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

.dark .form-label {
    color: var(--text-primary-dark);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    background: var(--card-light);
    color: var(--text-primary-light);
    transition: all var(--transition-base);
}

.dark .form-input,
.dark .form-select,
.dark .form-textarea {
    background: var(--card-dark);
    border-color: var(--border-dark);
    color: var(--text-primary-dark);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.dark .progress-bar {
    background: var(--border-dark);
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: rgba(124, 58, 237, 0.1);
    color: var(--primary);
}

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

.badge-danger {
    background: rgba(244, 63, 94, 0.1);
    color: var(--rose);
}

/* List Styles */
.list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-item {
    background: var(--card-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-base);
    cursor: pointer;
}

.dark .list-item {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.list-item:active {
    transform: scale(0.98);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--card-light);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.5rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform var(--transition-base);
}

.dark .modal {
    background: var(--card-dark);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Utility Classes */
.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--emerald);
}

.text-danger {
    color: var(--rose);
}

.text-muted {
    color: var(--text-secondary-light);
}

.dark .text-muted {
    color: var(--text-secondary-dark);
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-base {
    font-size: 1rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

.text-4xl {
    font-size: 2.25rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

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

.text-right {
    text-align: right;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.hidden {
    display: none;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

.dark ::-webkit-scrollbar-thumb {
    background: var(--border-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary-light);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary-dark);
}

/* ============================================
   PROFILE AVATAR ICON (Header)
   ============================================ */

.profile-avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    text-decoration: none;
    flex-shrink: 0;
}

.dark .profile-avatar-btn {
    border-color: var(--background-dark);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.5);
}

.profile-avatar-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

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

/* Profile Page Avatar */
.profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #A78BFA 0%, #8B5CF6 100%);
    border-radius: 50%;
    width: 7rem;
    height: 7rem;
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    border: 4px solid white;
}

/* ============================================
   SIGN OUT POPUP OVERRIDES
   ============================================ */

/* Center the popup vertically and horizontally */
#signOutModal {
    align-items: center !important;
    justify-content: center !important;
}

/* Override slide-up animation with scale/fade */
#signOutModal .modal {
    width: 90%;
    max-width: 320px;
    border-radius: var(--radius-xl);
    transform: scale(0.95);
    opacity: 0;
    transition: all var(--transition-base);
    margin: 0;
}

#signOutModal.active .modal {
    transform: scale(1);
    opacity: 1;
}

/* ============================================
   DELETE ACCOUNT MODAL STYLES
   ============================================ */

.btn-danger {
    background: rgba(244, 63, 94, 0.1);
    color: var(--rose);
    border: 1px solid transparent;
}

.btn-danger-hover:hover {
    background: rgba(244, 63, 94, 0.2);
}

.btn-continue-danger {
    background: var(--rose);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.btn-continue-danger:hover {
    background: #E11D48;
}

.btn-continue-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.modal-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.modal-icon.danger {
    background: rgba(244, 63, 94, 0.1);
    color: var(--rose);
}

.warning-box {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1rem 0;
    color: #991B1B;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.deletion-list {
    background: var(--background-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1rem 0;
}

.dark .deletion-list {
    background: var(--background-dark);
}

.deletion-list h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark .deletion-list h4 {
    color: var(--text-secondary-dark);
}

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

.deletion-list li {
    padding: 0.25rem 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.deletion-list li .material-icons-round {
    color: var(--rose);
    font-size: 1.125rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-actions button {
    flex: 1;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
}

.loading-overlay.active {
    display: flex;
}

/* ============================================
   RESPONSIVE DESIGN - Mobile First
   ============================================ */

/* Extra Small Devices (iPhone SE, Galaxy S8) - 320px to 375px */
@media (max-width: 375px) {
    /* Bottom Navigation - Reduce spacing for 6 tabs */
    .nav-item {
        padding: 0.5rem 0.25rem;
        gap: 0.125rem;
    }
    
    .nav-icon {
        font-size: 1.25rem;
    }
    
    .nav-label {
        font-size: 0.5rem;
        font-weight: 600;
    }
    
    /* Header - Reduce sizes */
    .header {
        padding: 2rem 1rem 1.5rem;
        padding-top: calc(2rem + env(safe-area-inset-top));
        border-radius: 0 0 2rem 2rem;
    }
    
    .header-title {
        font-size: 1rem;
    }
    
    .header-amount {
        font-size: 2.25rem;
    }
    
    .header-label {
        font-size: 0.625rem;
    }
    
    /* Buttons - Ensure minimum touch target */
    .btn {
        min-height: 44px;
        font-size: 0.875rem;
    }
    
    .btn-icon {
        min-width: 40px;
        min-height: 40px;
    }
    
    /* Profile Avatar */
    .profile-avatar-btn {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.75rem;
    }
    
    /* Modal - Full width on small screens */
    .modal {
        width: calc(100% - 2rem);
        max-width: 100%;
        margin: 1rem;
    }
    
    /* Forms - Better spacing */
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.625rem 0.875rem;
    }
    
    /* Container - Reduce padding */
    .container {
        padding: 0 0.75rem;
    }
    
    /* Cards */
    .card {
        padding: 1rem;
    }
    
    /* List items */
    .list-item {
        padding: 0.875rem;
    }
    
    /* FAB */
    .fab {
        width: 3rem;
        height: 3rem;
        bottom: 6rem;
        right: 1rem;
    }
}

/* Small Devices (iPhone 12/13, Pixel) - 376px to 428px */
@media (min-width: 376px) and (max-width: 428px) {
    .nav-item {
        padding: 0.5rem 0.5rem;
    }
    
    .nav-label {
        font-size: 0.5625rem;
    }
    
    .nav-container {
        justify-content: space-evenly;
        padding: 0 0.5rem;
    }
}

/* Large Phones (iPhone 14 Pro Max, Pixel 7 Pro) - 429px to 480px */
@media (min-width: 429px) and (max-width: 480px) {
    .nav-container {
        justify-content: center; /* CENTER the tabs */
        padding: 0 2rem; /* Equal padding left and right */
        gap: 0.75rem; /* Space between tabs */
        flex-wrap: nowrap; /* Keep on one line */
    }
    
    .nav-item {
        padding: 0.5rem 0.75rem;
        flex: 0 0 auto; /* Fixed size, don't grow or shrink */
        min-width: 55px; /* Minimum width for each tab */
    }
    
    .nav-label {
        font-size: 0.625rem;
        white-space: nowrap; /* Don't wrap text */
    }
    
    .nav-icon {
        font-size: 1.5rem;
    }
}

/* Medium Devices (Large Phones) - 481px to 768px */
@media (min-width: 481px) and (max-width: 768px) {
    .nav-container {
        max-width: 100%;
        padding: 0 1.5rem;
        justify-content: center; /* Center on these screens too */
        gap: 1rem;
    }
    
    .nav-item {
        flex: 0 0 auto;
    }
    
    .header-amount {
        font-size: 3.5rem;
    }
    
    .container {
        padding: 0 1.5rem;
    }
}

/* Tablets (iPad, Android Tablets) - 769px to 1024px */
@media (min-width: 769px) {
    /* Center content on tablets */
    .page {
        max-width: 768px;
        margin: 0 auto;
    }
    
    .bottom-nav {
        max-width: 768px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .header {
        border-radius: 0 0 2.5rem 2.5rem;
    }
    
    .nav-container {
        max-width: 600px;
    }
    
    .nav-item {
        padding: 0.75rem 1.5rem;
    }
    
    .nav-label {
        font-size: 0.75rem;
    }
    
    .nav-icon {
        font-size: 1.75rem;
    }
    
    .header-amount {
        font-size: 4rem;
    }
    
    .container {
        padding: 0 2rem;
    }
    
    /* Modals - Better sizing */
    .modal {
        max-width: 500px;
    }
}

/* Large Tablets & Desktop - 1025px+ */
@media (min-width: 1025px) {
    .page {
        max-width: 1024px;
    }
    
    .bottom-nav {
        max-width: 1024px;
    }
    
    .header {
        padding: 4rem 3rem 3rem;
        padding-top: calc(4rem + env(safe-area-inset-top));
    }
    
    .container {
        max-width: 900px;
        margin: 0 auto;
        padding: 0 2rem;
    }
    
    .modal {
        max-width: 600px;
    }
}

/* Landscape Orientation - Special handling */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 1rem 1.5rem 1rem;
        padding-top: calc(1rem + env(safe-area-inset-top));
    }
    
    .header-amount {
        font-size: 2rem;
    }
    
    .bottom-nav {
        padding: 0.5rem 1rem 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
    
    .fab {
        bottom: 4.5rem;
    }
}

/* Safe Area Support for Notched Devices */
@supports (padding: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }
    
    .header {
        padding-top: calc(3rem + env(safe-area-inset-top));
    }
    
    @media (max-width: 375px) {
        .header {
            padding-top: calc(2rem + env(safe-area-inset-top));
        }
    }
}

/* Fix for very small screens (iPhone SE 1st gen - 320px) */
@media (max-width: 320px) {
    .nav-item {
        padding: 0.5rem 0.125rem;
        min-width: 45px;
    }
    
    .nav-label {
        font-size: 0.45rem;
    }
    
    .nav-icon {
        font-size: 1.125rem;
    }
    
    .header-title {
        font-size: 0.875rem;
    }
    
    .header-amount {
        font-size: 2rem;
    }
}

/* High DPI Displays (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper icons and text */
    .material-icons-round {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}