/**
 * YON DAFTAR PRO - CSS STYLES
 * Mobile-first dizayn, 360-430px
 * Mavjud dizayn saqlanib qolindi
 */

/* ===================== */
/* O'ZGARUVCHILAR */
/* ===================== */
:root {
    --bg: #f0f2f5;
    --primary: #4361ee;
    --success: #2ec4b6;
    --danger: #e71d36;
    --warning: #ffa500;
    --card-bg: rgba(255, 255, 255, 0.95);
    --header-height: 180px;
    --bottom-nav-height: 70px;
}

/* ===================== */
/* UMUMIY SOZLAMALAR */
/* ===================== */
* {
    box-sizing: border-box;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--bg);
    margin: 0;
    padding: 0;
    font-size: 16px;
    animation: fadeIn 0.5s ease-in;
    overflow-x: hidden;
}

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

/* Input va textarealar uchun */
input, textarea {
    -webkit-user-select: text;
    user-select: text;
    font-size: 16px;
}

/* ===================== */
/* TEPADA APP BAR */
/* ===================== */
.app-bar {
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    color: white;
    padding: 35px 25px;
    border-radius: 0 0 35px 35px;
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    height: var(--header-height);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.app-bar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-bar-title h4 {
    font-weight: bold;
    margin: 0;
    letter-spacing: 1px;
}

.app-bar-title small {
    font-size: 11px;
    opacity: 0.75;
}

.app-bar-action {
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    border: none;
    color: white;
}

.app-bar-action:hover {
    background: rgba(255, 255, 255, 0.2);
}

.app-bar-content {
    margin-top: 15px;
}

.balans-display small {
    font-size: 10px;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balans-display h1 {
    font-weight: bold;
    margin: 5px 0 0 0;
    font-size: 2.5rem;
}

/* ===================== */
/* ASOSIY KONTENT */
/* ===================== */
.app-container {
    max-width: 500px;
    margin: 0 auto;
    background: transparent;
    min-height: 100vh;
    padding-top: calc(var(--header-height) + 20px);
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    padding-left: 15px;
    padding-right: 15px;
}

/* ===================== */
/* PASTKI NAVIGATSIYA */
/* ===================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 0;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.05);
    z-index: 1000;
    height: var(--bottom-nav-height);
}

.nav-item {
    text-align: center;
    color: #888;
    text-decoration: none;
    font-size: 11px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: 0.2s;
    padding: 5px;
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

.nav-item.active {
    color: var(--primary);
    font-weight: bold;
}

.nav-item:hover {
    color: var(--primary);
}

/* ===================== */
/* KARTOCHKALAR */
/* ===================== */
.card {
    background: white;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 15px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.tarix-card {
    background: white;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 15px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

/* ===================== */
/* TUGMALAR */
/* ===================== */
.btn {
    border-radius: 15px;
    padding: 15px;
    font-weight: 600;
    font-size: 15px;
    transition: 0.3s;
    border: none;
    cursor: pointer;
}

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

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

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

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

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

/* ===================== */
/* FORMA ELEMENTLARI */
/* ===================== */
.form-control {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    font-size: 16px;
    background: #f8f9fa;
    transition: 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-select {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    font-size: 16px;
    background: #f8f9fa;
    cursor: pointer;
}

/* ===================== */
/* BADGE */
/* ===================== */
.badge {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

/* ===================== */
/* MODAL */
/* ===================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 25px;
    padding: 25px;
    max-width: 90%;
    width: 400px;
    position: relative;
}

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

.modal-close {
    background: #f0f0f0;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===================== */
/* LOADING */
/* ===================== */
.loading {
    display: none;
    text-align: center;
    padding: 30px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================== */
/* TOAST XABAR */
/* ===================== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    z-index: 10001;
    font-size: 16px;
    display: none;
    animation: fadeInOut 2s ease-in-out;
}

.toast.show {
    display: block;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* ===================== */
/* BO'SH HOLAT */
/* ===================== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: 20px;
}

.empty-state i {
    font-size: 80px;
    opacity: 0.1;
}

.empty-state p {
    color: #888;
    margin-top: 15px;
}

/* ===================== */
/* AUTH SAHIFALARI */
/* ===================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
}

.icon-circle {
    width: 75px;
    height: 75px;
    background: #4361ee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

/* ===================== */
/* UTILITY CLASSLAR */
/* ===================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 30px; }

.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 30px; }

.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }
.p-5 { padding: 30px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

.fw-bold { font-weight: bold; }
.text-muted { color: #888; }

.w-100 { width: 100%; }

/* ===================== */
/* RESPONSIVE */
/* ===================== */
@media (max-width: 360px) {
    .app-bar {
        padding: 25px 15px;
    }
    
    .balans-display h1 {
        font-size: 2rem;
    }
}

@media (min-width: 500px) {
    .app-container {
        box-shadow: 0 0 30px rgba(0,0,0,0.1);
    }
}
