/* Apple iOS Inset Grouped Theme Palette */
:root {
    --bg-color: #000000;                  /* Pure iOS OLED Black */
    --group-bg: #1c1c1e;                /* iOS System Grouped Background */
    --group-bg-active: #2c2c2e;         /* iOS Active Cell Background */
    --accent-color: #0a84ff;             /* Apple System Blue */
    --accent-gradient: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%);
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;           /* iOS System Gray */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.18);
    --radius-group: 18px;                /* iOS Standard Grouped Radius */
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #07090e;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.mobile-container {
    width: 100%;
    max-width: 430px; /* Kompüterdə dizaynın uzanmaması üçün mobil çərçivə ölçüsü */
    background: 
        radial-gradient(circle at 50% 0%, rgba(124, 58, 237, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
        #07090e;
    
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-top: 0 !important;
    padding-bottom: 20px;
    
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
}

#homePage, #settingsPage {
    width: 100%;
    box-sizing: border-box;
}

/* Yalnız İdarəetmə Paneli aktiv olanda daxili scroll aktivləşsin */
#settingsPage.page.active {
    height: calc(100vh - 20px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 50px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: calc(100% + 32px) !important;
    
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: 12px;
    padding-left: 16px;
    padding-right: 16px;
    
    position: sticky;
    top: 0;
    z-index: 100;
    
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 0.5px solid transparent;
    
    margin-left: -16px !important;
    margin-right: -16px !important;
    
    box-sizing: border-box;
    transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
}

.app-header.scrolled {
    background: rgba(7, 9, 14, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.08) !important;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px; /* İkon ile yazı arasındaki mesafeyi de biraz yakınlaştırıyoruz */
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--group-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0.5px solid var(--border-highlight);
    color: var(--accent-color);
    transition: transform 0.15s ease;
}

.avatar:active {
    transform: scale(0.92);
}

.username {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.icon-btn {
    background: var(--group-bg);
    border: 0.5px solid var(--border-highlight);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.15s ease, background 0.15s;
}

.icon-btn:active {
    transform: scale(0.92);
    background: var(--group-bg-active);
}

.stat-card {
    /* Soldan sağa bənövşəyi, sağdan sola mavi və aralarında boşluq olmayan keçid */
    background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
    padding: 22px;
    border-radius: var(--radius-group);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 12px 30px -8px rgba(124, 58, 237, 0.35);
    position: relative;
    overflow: hidden;
    border: 0.5px solid rgba(255, 255, 255, 0.25);
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer;
}

.stat-card:active {
    transform: scale(0.97);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    opacity: 0.95;
}

.badge {
    background: rgba(255, 255, 255, 0.22);
    padding: 4px 12px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 12px;
    font-weight: 600;
}

.stat-amount {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-amount .currency {
    font-size: 22px;
    opacity: 0.9;
}

.progress-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    height: 5px;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    width: 70%;
    height: 100%;
    background: #ffffff;
    border-radius: 3px;
}

.stat-footer {
    display: flex;
    gap: 16px;
    border-top: 0.5px solid rgba(255, 255, 255, 0.22);
    padding-top: 12px;
    font-size: 13px;
    font-weight: 500;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* iOS Inset Grouped Form Section - Daha dərin və şüşə effektli */
.form-section {
    background: rgba(28, 28, 30, 0.65); /* Yüngül şəffaf tünd fond */
    backdrop-filter: blur(25px);         /* Arxanı blurlayan buzlu şüşə effekti */
    -webkit-backdrop-filter: blur(25px);
    padding: 20px;
    border-radius: var(--radius-group);
    border: 0.5px solid rgba(255, 255, 255, 0.12); /* İncə titanyum çərçivə xətti */
    width: 100%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.form-section h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.form-section h3 i {
    color: var(--accent-color);
    font-size: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    width: 100%;
}

.input-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 2px;
}

/* Input xanalarını daha səliqəli və dərin edirik */
.input-group input, .input-group select {
    background: rgba(0, 0, 0, 0.35);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px; /* İOS-da input şrifti 16px-dən kiçik olanda avtomatik zoom edir, ideal ölçüdür */
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.input-group input:focus, .input-group select:focus {
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.55);
    box-shadow: 0 0 12px rgba(10, 132, 255, 0.25);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

/* "Yadda Saxla" düyməsini daha parlaq və cəlbedici edirik */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #0a84ff 0%, #0062cc 100%);
    border: none;
    color: #ffffff;
    padding: 15px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    box-shadow: 0 8px 25px rgba(10, 132, 255, 0.35);
    transition: transform 0.15s ease, opacity 0.15s;
}

.submit-btn:active {
    transform: scale(0.97);
    opacity: 0.85;
}

/* Page management */
.page {
    display: none;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.page.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* iOS Sheet / Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal-content {
    background: var(--group-bg);
    border: 0.5px solid var(--border-highlight);
    padding: 22px;
    border-radius: 24px;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

/* Toast Banner Style */
#toastNotification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 32, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    color: var(--text-primary);
    border: 0.5px solid var(--border-highlight);
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2000;
    transition: top 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    max-width: 90%;
}

#toastNotification.show {
    top: 20px;
}

#toastNotification.success {
    border-color: #30d158;
    color: #30d158;
}

#toastNotification.error {
    border-color: #ff453a;
    color: #ff453a;
}

#modalCarList {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Nömrələr/maşınlar arasındakı boşluq */
}

/* Tarixçə Qeydləri Üçün iOS Çərçivə Stili */
.history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 0.5px solid var(--border-color);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s ease;
}

.history-item:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.98);
}

.history-item .item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(10, 132, 255, 0.15);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.history-item .item-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.history-item .item-details p {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Progress Bar Rəngləri */
.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.4s ease, background-color 0.4s ease;
}

.progress-green { background-color: #30d158; box-shadow: 0 0 10px rgba(48, 209, 88, 0.5); }
.progress-orange { background-color: #ff9f0a; box-shadow: 0 0 10px rgba(255, 159, 10, 0.5); }
.progress-red { background-color: #ff453a; box-shadow: 0 0 10px rgba(255, 69, 58, 0.5); }

/* Yüklənmə Fırlanma Animasiyası (Yalnız Mavi Hissə) */
.spinner {
    width: 36px;
    height: 36px;
    border: 3.5px solid transparent; /* Boz fon tamamilə silindi və şəffaf oldu */
    border-top-color: var(--accent-color); /* Yalnız fırlanan hissə mavi rəngdədir */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Şifrə modalındakı mavi işıq saçmanı ləğv etmək üçün */
#pinModal input:focus, 
#pinModal .modal-content {
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    outline: none !important;
}