/* ==========================================================================
   1. UMUMIY VA BAZAVIY STILLAR
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* ==========================================================================
   2. ADMIN PANEL / DASHBOARD STILLARI
   ========================================================================== */
.admin-body { 
    background-color: #f9fafb; 
    color: #111827; 
    min-height: 100vh; 
}

/* FAQAT KOMPYUTER VA NOUTBUKLAR UCHUN STANDART 3 TAlIK USTUN (Keng ekranlarda ishlaydi) */
@media (min-width: 1101px) {
    body {
        display: grid; 
        grid-template-columns: 240px 1fr 400px; 
        overflow: hidden;
        height: 100vh;
    }
}

/* ==========================================================================
   4. MOBIL VA PLANSHETLAR UCHUN MUKAMMAL RESPONSIVE STILLAR
   ========================================================================== */

@media (max-width: 1100px) {
    body {
        grid-template-columns: 240px 1fr;
    }
    .preview-area {
        grid-column: span 2;
        height: auto;
        padding: 40px 20px;
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
}

@media (max-width: 768px) {
    .admin-body {
        grid-template-columns: 1fr;
        height: auto;
        overflow-y: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
        border-top: none;
        border-right: none;
        padding: 0 20px;
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: space-between;
        z-index: 9999;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    }
    
    .logo-wrapper {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .logo-icon {
        width: 42px;
        height: 42px;
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #ffffff;
        font-weight: 800;
        font-size: 16px;
        box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2);
    }
    
    .logo-text {
        font-size: 22px;
        font-weight: 800;
        color: #111827;
        text-decoration: none;
        letter-spacing: -0.5px;
    }
    .logo-text span { color: #2563eb; }

    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        border: none;
        background: none;
        padding: 8px;
    }
    .menu-toggle span {
        display: block;
        width: 24px;
        height: 2.5px;
        background: #1f2937;
        border-radius: 2px;
        transition: 0.2s;
    }

    .menu-list-wrapper {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
        padding: 15px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
        flex-direction: column;
        gap: 8px;
    }
    
    .sidebar.menu-open .menu-list-wrapper { display: flex !important; }
    .menu-list { flex-direction: column !important; gap: 6px; width: 100%; }
    .menu-item a { width: 100%; padding: 12px; font-size: 14px; background: #f9fafb; border-radius: 10px; }
    
    .logout-form { width: 100%; margin-top: 4px; }
    .logout-btn { width: 100%; padding: 12px; font-size: 14px; text-align: center; border-radius: 10px; }

    .content-area {
        padding: 110px 15px 30px 15px !important;
        height: auto;
        overflow-y: visible;
    }

    .grid-2 { grid-template-columns: 1fr !important; gap: 14px; }
    .card-box { padding: 16px; margin-bottom: 16px; }
    .preview-area { grid-column: span 1; background: #f3f4f6; padding: 40px 15px; border-top: 1px solid #e5e7eb; display: flex !important; justify-content: center; width: 100%; }
    .phone-mockup { width: 100%; max-width: 310px; height: 600px; border: 10px solid #111827; }
}

@media (min-width: 769px) {
    .menu-toggle { display: none !important; }
    .logo-wrapper { display: block; }
}

.sidebar {
    background: #ffffff; 
    border-right: 1px solid #e5e7eb; 
    padding: 24px 16px; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    height: 100vh; 
}
.logo { font-size: 20px; font-weight: 800; color: #111827; text-decoration: none; margin-bottom: 30px; display: block; padding-left: 8px; }
.logo span { color: #7c3aed; }
.menu-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.menu-item a { display: flex; align-items: center; gap: 12px; padding: 12px; color: #4b5563; text-decoration: none; font-size: 14px; font-weight: 600; border-radius: 12px; transition: 0.2s; }
.menu-item.active a, .menu-item a:hover { background: #f3f4f6; color: #111827; }

.logout-form { width: 100%; }
.logout-btn { background: #fef2f2; color: #dc2626 !important; border: 1px solid #fee2e2; width: 100%; text-align: left; cursor: pointer; padding: 12px; font-size: 14px; font-weight: 600; border-radius: 12px; transition: 0.2s; }
.logout-btn:hover { background: #fee2e2; }

.content-area { padding: 40px; overflow-y: auto; background: #f9fafb; height: 100vh; }
.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.content-header h1 { font-size: 24px; font-weight: 700; color: #111827; }

.card-box { background: #ffffff; border: 1px solid #e5e7eb; padding: 24px; border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.02); margin-bottom: 24px; }
.card-box h3 { font-size: 14px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 16px; }

.form-group { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: block; font-size: 13px; font-weight: 600; color: #4b5563; margin-bottom: 6px; }

input[type="text"], input[type="url"], textarea { width: 100%; border: 1px solid #d1d5db; padding: 12px 14px; border-radius: 12px; font-size: 14px; outline: none; transition: 0.2s; background: #ffffff; color: #111827; }
input:focus, textarea:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1); }

.input-prefix-group { display: flex; border: 1px solid #d1d5db; border-radius: 12px; overflow: hidden; }
.input-prefix { background: #f3f4f6; border-right: 1px solid #d1d5db; padding: 0 14px; display: flex; align-items: center; color: #6b7280; font-size: 14px; font-weight: 500; }
.input-prefix-group input { border: none; border-radius: 0; flex: 1; }

.color-group { display: flex; align-items: center; gap: 12px; border: 1px solid #d1d5db; padding: 6px 12px; border-radius: 12px; background: #ffffff; }
input[type="color"] { width: 32px; height: 32px; border: none; cursor: pointer; background: none; }

.btn-primary { background: #7c3aed; color: #ffffff; padding: 14px; border: none; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; width: 100%; transition: 0.2s; box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15); margin-bottom: 30px; }
.btn-primary:hover { background: #6d28d9; }

.links-title { font-size: 16px; font-weight: 700; color: #111827; margin-top: 10px; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px; }
.link-item { display: flex; justify-content: space-between; align-items: center; border: 1px solid #e5e7eb; padding: 16px 20px; border-radius: 12px; background: #ffffff; margin-bottom: 12px; gap: 15px; box-shadow: 0 1px 2px rgba(0,0,0,0.01); }
.link-info { flex: 1; min-width: 0; }
.link-info strong { display: block; font-size: 14px; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-info span { display: block; font-size: 12px; color: #6b7280; font-family: monospace; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-delete { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.btn-delete:hover { background: #fee2e2; }

.preview-area { background: #f3f4f6; display: flex; align-items: center; justify-content: center; height: 100vh; border-left: 1px solid #e5e7eb; padding: 30px; }
.phone-mockup { width: 100%; max-width: 320px; height: 100%; max-height: 640px; border: 12px solid #111827; border-radius: 40px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15); display: flex; flex-direction: column; align-items: center; padding: 40px 20px; overflow-y: auto; }

.alert-success-box { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: 14px; border-radius: 12px; font-size: 14px; margin-bottom: 20px; font-weight: 500; }

/* ==========================================================================
   3. OMMAVIY SAHIFA STILLARI
   ========================================================================== */
.user-body { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 50px 20px 30px 20px; }
.main-block { width: 100%; max-width: 480px; display: flex; flex-direction: column; align-items: center; text-align: center; }

.avatar-container, .phone-avatar { 
    width: 96px; 
    height: 96px; 
    border-radius: 50%; 
    margin-bottom: 20px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 36px; 
    font-weight: 700; 
    text-transform: uppercase; 
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3); 
    border: 4px solid #4f46e5; 
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%); 
    color: #ffffff; 
    overflow: hidden; 
}

.avatar-img, .phone-avatar img { width: 100%; height: 100%; object-fit: cover; }
.title, .phone-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.5px; }
.bio, .phone-bio { font-size: 14px; opacity: 0.85; line-height: 1.6; margin-bottom: 35px; max-width: 400px; padding: 0 10px; text-align: center; }

.links-container, .phone-links { width: 100%; display: flex; flex-direction: column; gap: 16px; }

/* Link tugmalari */
.link-btn, .phone-link-btn { 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%; 
    padding: 16px 20px; 
    background: rgba(255, 255, 255, 0.12); 
    border: none;
    color: inherit;
    text-decoration: none; 
    border-radius: 14px; 
    font-weight: 600; 
    font-size: 16px; 
    text-align: center; 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s ease-in-out;
}

.link-btn:hover { 
    background: rgba(255, 255, 255, 0.22); 
    transform: translateY(-2px); 
    box-shadow: 0 5px 10px rgba(0,0,0,0.15); 
}
.phone-link-btn { pointer-events: none; }

/* ── LINK ICON ── */
.link-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.link-btn-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px !important;
    height: 32px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.link-btn-icon svg {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px;
    display: block;
}
.link-btn-text {
    text-align: center;
    width: 100%;
}

.footer { font-size: 13px; opacity: 0.5; margin-top: 40px; text-align: center; color: inherit; }
.footer a { color: inherit; text-decoration: none; font-weight: bold; }
.footer a:hover { text-decoration: underline; }

/* ==========================================================================
   DESKTOP LOGOTIP
   ========================================================================== */
.logo-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 30px !important;
}

.logo-icon {
    display: flex !important;
    width: 42px !important;
    height: 42px !important;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
    border-radius: 12px !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 16px !important;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2) !important;
}

.logo-text {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #111827 !important;
    text-decoration: none !important;
    letter-spacing: -0.5px !important;
}
.logo-text span { color: #2563eb !important; }