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

:root {
    --bg-main: #0a0f1d;
    --bg-surface: rgba(30, 41, 59, 0.7);
    --bg-card: rgba(51, 65, 85, 0.4);
    --primary: #fbbf24;
    --primary-glow: rgba(251, 191, 36, 0.3);
    --primary-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --success: #10b981;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --radius-lg: 1.5rem;
    --radius-md: 1rem;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

input, textarea {
    user-select: text;
    -webkit-user-select: text;
    font-size: 16px !important; /* iOS zoom prevention */
}

html, body {
    height: 100%;
    height: -webkit-fill-available;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(251, 191, 36, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    padding-bottom: calc(6rem + env(safe-area-inset-bottom));
    min-height: 100vh;
    min-height: -webkit-fill-available;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

body::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}


h1, h2, h3, .brand {
    font-family: 'Outfit', sans-serif;
}

.container {
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Header & Brand */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-top: 1rem;
}

.brand {
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.user-profile {
    width: 44px;
    height: 44px;
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: var(--glass-border);
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* Cards (Glassmorphism) */
.card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: var(--glass-border);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.card::after {
    content: '\f0d1'; /* Truck icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    bottom: -15px;
    right: -10px;
    font-size: 6rem;
    color: rgba(255, 255, 255, 0.03);
    transform: rotate(-15deg);
    pointer-events: none;
    z-index: -1;
}

/* Custom watermarks for specific cards */
.summary-card::after { content: '\f295'; font-size: 8rem; right: -20px; bottom: -30px; } /* Percentage % */
.fuel-card::after { content: '\f52f'; } /* Gas pump */
.tax-card::after { content: '\f543'; } /* Receipt/Tax */
.count-card::after { content: '\f0d1'; } /* Truck */
.km-card::after { content: '\f3fd'; } /* Tachometer/KM */
.modal-content .card::after { content: '\f05a'; } /* Info circle */
.invoice-card::after { content: '\f0d1'; } /* Truck icon */
.return-invoice-card::after { content: '\f0d1'; transform: scaleX(-1) rotate(15deg); } /* Flipped Truck */
.hgs-card::after { content: '\f018'; } /* Road */
.food-card::after { content: '\f2e7'; } /* Food/Utensils */
.commission-card::after { content: '\f2b5'; } /* Handshake */
.expense-card::after { content: '\f555'; } /* Wallet */

/* Animations */
@keyframes driving {
    0% { transform: translateX(0) rotate(-15deg); }
    50% { transform: translateX(-10px) rotate(-12deg); }
    100% { transform: translateX(0) rotate(-15deg); }
}

@keyframes drivingReverse {
    0% { transform: scaleX(-1) translateX(0) rotate(15deg); }
    50% { transform: scaleX(-1) translateX(-10px) rotate(12deg); }
    100% { transform: scaleX(-1) translateX(0) rotate(15deg); }
}

.invoice-card::after { animation: driving 4s ease-in-out infinite; }
.return-invoice-card::after { animation: drivingReverse 4s ease-in-out infinite; }

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.card-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.card-value.success {
    background: var(--success-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.125rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    font-size: 1rem;
    letter-spacing: 0.02em;
    user-select: none;
}

.btn:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #000;
    box-shadow: 0 10px 20px -5px rgba(251, 191, 36, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(251, 191, 36, 0.5);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--primary);
}

.btn-floating {
    position: fixed;
    bottom: 2.5rem;
    right: 1.5rem;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.5);
    font-size: 1.5rem;
    z-index: 10002;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    cursor: pointer;
}

.btn-floating.active {
    transform: rotate(135deg);
    background: var(--danger);
    color: #fff;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.5);
}

.floating-menu {
    position: fixed;
    bottom: 7.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.floating-menu.active {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-item {
    background: var(--bg-surface);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: var(--glass-border);
    padding: 0.75rem 1.25rem;
    border-radius: 1rem;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    white-space: nowrap;
}

.menu-item i {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}


/* Trip List Items */
.trip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    cursor: pointer;
}

.trip-item:active {
    background: rgba(255, 255, 255, 0.03);
}

.trip-item:last-child {
    border-bottom: none;
}

.trip-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.trip-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Form Styles */
.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

input, select, textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s;
    outline: none;
    appearance: none;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}


input:focus {
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.1);
}

/* Animations */
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.animate-up {
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-content {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 2rem 2rem 0 0;
    padding: 2rem 1.5rem;
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    border-top: var(--glass-border);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.modal-content::-webkit-scrollbar {
    width: 0;
    height: 0;
}

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

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    position: sticky;
    top: 0;
    background: inherit;
    padding-top: 0.5rem;
    padding-bottom: 1rem;
    margin-top: -0.5rem;
    z-index: 10;
}


.modal-close {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.detail-row span:first-child {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detail-row span:last-child {
    font-weight: 600;
}

/* Custom Accents */
.accent-glow {
    position: absolute;
    width: 100px;
    height: 100px;
    background: var(--primary);
    filter: blur(80px);
    opacity: 0.1;
    z-index: -1;
}
