/* ==========================================================================
   Stokkhata Admin Panel CSS
   ========================================================================== */

:root {
    --admin-sidebar-w:  260px;
    --admin-header-h:   64px;
    --admin-primary:    #4F46E5;
    --admin-dark:       #0F172A;
    --admin-sidebar-bg: #1E293B;
    --admin-sidebar-hover: rgba(255,255,255,0.08);
    --admin-sidebar-active: rgba(79,70,229,0.25);
    --admin-body-bg:    #F1F5F9;
    --admin-card-bg:    #fff;
    --admin-border:     #E2E8F0;
    --admin-text:       #334155;
    --admin-text-muted: #64748B;
    --admin-radius:     12px;
    --admin-shadow:     0 1px 8px rgba(0,0,0,0.07);
    --transition:       all 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--admin-body-bg);
    color: var(--admin-text);
    margin: 0;
    font-size: 0.9rem;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.admin-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--admin-sidebar-w);
    background: var(--admin-sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-brand {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.sidebar-brand .bi { color: var(--admin-primary); font-size: 1.4rem; }

.sidebar-toggle { background: none; border: none; color: rgba(255,255,255,0.6); cursor: pointer; font-size: 1.1rem; }

.sidebar-nav { padding: 16px 12px; flex: 1; }

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.3);
    padding: 0 8px;
    margin-bottom: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    position: relative;
}

.sidebar-link:hover {
    background: var(--admin-sidebar-hover);
    color: #fff;
}

.sidebar-link.active {
    background: var(--admin-sidebar-active);
    color: #fff;
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px; bottom: 4px;
    width: 3px;
    background: var(--admin-primary);
    border-radius: 0 2px 2px 0;
}

.sidebar-link .bi { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-badge {
    margin-left: auto;
    background: #EF4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 100px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--admin-primary), #0EA5E9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.9rem;
    flex-shrink: 0;
}

.user-info { min-width: 0; }
.user-name { color: #fff; font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(255,255,255,0.45); font-size: 0.7rem; }

.sidebar-logout {
    background: none; border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer; font-size: 1.1rem;
    padding: 4px 8px; border-radius: 6px;
    transition: var(--transition);
}
.sidebar-logout:hover { color: #EF4444; background: rgba(239,68,68,0.1); }

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1039;
}

/* ==========================================================================
   MAIN AREA
   ========================================================================== */
.admin-main {
    margin-left: var(--admin-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    position: sticky;
    top: 0;
    height: var(--admin-header-h);
    background: #fff;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.header-left { display: flex; align-items: center; gap: 16px; }

.sidebar-toggle-btn {
    background: none; border: none;
    color: var(--admin-text);
    cursor: pointer; padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
}
.sidebar-toggle-btn:hover { background: var(--admin-body-bg); }

.page-title { font-size: 1rem; font-weight: 700; color: var(--admin-dark); }
.breadcrumb { margin: 0; }
.breadcrumb-item a { color: var(--admin-primary); text-decoration: none; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--admin-text-muted); }

.header-icon-btn {
    color: var(--admin-text-muted);
    font-size: 1rem;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    transition: var(--transition);
}
.header-icon-btn:hover { background: var(--admin-body-bg); color: var(--admin-primary); }

.user-avatar-sm {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--admin-primary), #0EA5E9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.8rem;
}

.header-user { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 500; }

.admin-content {
    flex: 1;
    padding: 28px;
}

/* ==========================================================================
   CARDS
   ========================================================================== */
.admin-card {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    overflow: hidden;
}

.admin-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--admin-border);
    background: #FAFBFC;
    font-weight: 600;
}

.admin-card-body { padding: 20px; }

/* ==========================================================================
   STAT CARDS
   ========================================================================== */
.stat-card {
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--admin-shadow);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent, var(--admin-primary));
}

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.stat-card.has-alert::before { animation: pulse 2s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.stat-icon {
    width: 44px; height: 44px;
    background: color-mix(in srgb, var(--accent, var(--admin-primary)) 12%, transparent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    color: var(--accent, var(--admin-primary));
}

.stat-value { font-size: 2rem; font-weight: 800; color: var(--admin-dark); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--admin-text-muted); font-weight: 500; }

.stat-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--accent, var(--admin-primary));
    font-weight: 600;
    text-decoration: none;
    margin-top: auto;
}
.stat-link:hover { text-decoration: underline; }

/* ==========================================================================
   TABLES
   ========================================================================== */
.admin-table { font-size: 0.875rem; }
.admin-table thead th { background: #F8FAFC; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--admin-text-muted); border-bottom: 1px solid var(--admin-border); padding: 12px 16px; }
.admin-table td { padding: 14px 16px; vertical-align: middle; border-bottom: 1px solid #F1F5F9; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: #F8FAFC; }

.drag-handle { cursor: grab; padding: 14px 8px 14px 16px !important; }
.drag-handle:active { cursor: grabbing; }

/* ==========================================================================
   BUTTONS — extra small
   ========================================================================== */
.btn-xs {
    font-size: 0.75rem !important;
    padding: 3px 10px !important;
    line-height: 1.5;
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */
.form-control, .form-select {
    border-color: var(--admin-border);
    font-size: 0.9rem;
    border-radius: 8px;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.form-label { font-size: 0.85rem; margin-bottom: 6px; }
.input-group-text { border-color: var(--admin-border); background: #F8FAFC; }

/* ==========================================================================
   BILINGUAL TABS
   ========================================================================== */
.bilingual-tabs { border: 1px solid var(--admin-border); border-radius: 8px; padding: 4px; background: #F8FAFC; display: inline-flex; gap: 4px; }
.bilingual-tabs .nav-link { padding: 6px 16px; border-radius: 6px !important; font-size: 0.8rem; font-weight: 600; color: var(--admin-text-muted); }
.bilingual-tabs .nav-link.active { background: var(--admin-primary) !important; color: #fff !important; }

/* ==========================================================================
   QUICK ACTIONS
   ========================================================================== */
.quick-actions { padding: 8px; }
.quick-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--admin-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}
.quick-action-item:hover { background: #F8FAFC; color: var(--admin-primary); }
.quick-action-item .bi { font-size: 1rem; }

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.empty-state { text-align: center; padding: 40px 20px; }

/* ==========================================================================
   TESTIMONIAL AVATAR (admin)
   ========================================================================== */
.testimonial-avatar-sm {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--admin-primary), #0EA5E9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.75rem;
}

/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1E293B 0%, #312E81 50%, #4F46E5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper { width: 100%; max-width: 420px; }

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.3);
}

.login-logo {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, #4F46E5, #0EA5E9);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: #fff;
    margin: 0 auto;
}

.login-brand h4 { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 1.4rem; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1199.98px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .admin-main { margin-left: 0; }
    .admin-content { padding: 20px; }
}

@media (max-width: 767.98px) {
    .admin-header { padding: 0 16px; }
    .admin-content { padding: 16px; }
    .login-card { padding: 32px 24px; }
}

/* ==========================================================================
   MODERN & MINIMAL PRODUCT FORM
   ========================================================================== */

/* Modern Card Layout overrides */
.modern-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 8px -1px rgba(15, 23, 42, 0.02);
    margin-bottom: 1.75rem;
    transition: all 0.3s ease;
}
.modern-card:hover {
    box-shadow: 0 10px 30px -4px rgba(15, 23, 42, 0.06), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
}
.modern-card-header {
    padding: 20px 24px;
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modern-card-header h5, .modern-card-header h6 {
    font-weight: 700;
    color: var(--admin-dark);
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}
.modern-card-header .header-icon {
    font-size: 1.1rem;
    color: var(--admin-primary);
    background: rgba(79, 70, 229, 0.08);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modern-card-body {
    padding: 24px;
}

/* Modern Form Controls */
.modern-form-group {
    margin-bottom: 1.5rem;
}
.modern-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 8px;
    display: inline-block;
}
.modern-input, .modern-select, .modern-textarea {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 0.875rem;
    color: #1e293b;
    background-color: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.modern-input:focus, .modern-select:focus, .modern-textarea:focus {
    border-color: var(--admin-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
    background-color: #ffffff;
}
.modern-input::placeholder {
    color: #94a3b8;
}

/* Upload zone */
.modern-upload-zone {
    display: block;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
}
.modern-upload-zone:hover {
    border-color: var(--admin-primary);
    background: rgba(79, 70, 229, 0.02);
}
.upload-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #475569;
}
.upload-icon {
    font-size: 2rem;
    color: #94a3b8;
    margin-bottom: 8px;
    transition: transform 0.2s ease, color 0.2s ease;
}
.modern-upload-zone:hover .upload-icon {
    transform: translateY(-2px);
    color: var(--admin-primary);
}

/* iOS Toggle switch styling */
.modern-switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    background: #f8fafc;
}
.modern-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.modern-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.modern-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}
.modern-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.modern-switch input:checked + .modern-switch-slider {
    background-color: #10b981; /* green accent for active */
}
.modern-switch input:checked + .modern-switch-slider:before {
    transform: translateX(20px);
}

/* Variants Table */
.modern-table-card {
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    overflow: hidden;
}
.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.modern-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.modern-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.modern-table tr:last-child td {
    border-bottom: none;
}
.modern-table .form-control-sm {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    transition: all 0.15s ease;
}
.modern-table .form-control-sm:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

/* Gallery and existing files list styling */
.modern-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}
.modern-gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    transition: all 0.2s ease;
}
.modern-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.modern-gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.modern-gallery-item:hover .modern-gallery-overlay {
    opacity: 1;
}
.modern-gallery-remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    transition: transform 0.2s ease;
}
.modern-gallery-remove-btn:hover {
    transform: scale(1.1);
}
.modern-gallery-item.opacity-25 {
    opacity: 0.25;
    border-color: #ef4444;
}

/* Tag style minimal badge helper */
.tag-helper-text {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* ==========================================================================
   MODERN SETTINGS PAGE
   ========================================================================== */
.media-preview-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    background: #F8FAFC;
    overflow: hidden;
    padding: 8px;
}
.media-preview-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.media-preview-box.logo-box { width: 200px; height: 64px; }
.media-preview-box.favicon-box { width: 64px; height: 64px; }

.color-swatch-field { display: flex; align-items: center; gap: 10px; }
.color-swatch-input {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--admin-border);
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}
.color-swatch-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-swatch-input::-webkit-color-swatch { border: none; border-radius: 50%; }
.color-swatch-hex { max-width: 130px; font-family: 'Courier New', monospace; text-transform: uppercase; }

.settings-save-bar {
    position: sticky;
    bottom: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--admin-border);
    padding: 16px 4px;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    z-index: 10;
}

.bi-spin {
    animation: bi-spin-rotate 0.8s linear infinite;
}
@keyframes bi-spin-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

