/* =====================================================
   G4Store - Premium Digital & Gaming Stylesheet
   ===================================================== */

:root {
    /* الألوان الأساسية - طابع الألعاب والتقنية */
    --primary: #4F46E5;         /* Electric Indigo */
    --primary-light: #6366F1;
    --primary-dark: #3730A3;
    --primary-50: #EEF2FF;
    --primary-100: #E0E7FF;

    /* لون ثانوي مميز للفت الانتباه (أزرار، بادجات) */
    --accent: #06B6D4;          /* Neon Teal */
    --accent-light: #22D3EE;

    /* ألوان الخلفيات والنصوص */
    --bg: #F8FAFC;              /* خلفية فاتحة ومريحة للعين */
    --surface: #FFFFFF;
    --border: #E2E8F0;

    --text: #0F172A;
    --text-muted: #64748B;
    --text-light: #94A3B8;

    /* ألوان التنبيهات */
    --success: #10B981;
    --success-bg: #ECFDF5;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --info: #4F46E5;
    --info-bg: #EEF2FF;

    /* المسافات والانحناءات */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* ظلال عصرية ناعمة */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(79, 70, 229, 0.15), 0 8px 10px -6px rgba(79, 70, 229, 0.05);

    --font: 'Cairo', 'Tajawal', sans-serif;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: var(--transition); }
img { max-width: 100%; display: block; border-radius: inherit; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; transition: var(--transition); }
input, textarea, select { font-family: inherit; font-size: 15px; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header ===== */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 20px;
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.5px;
}
.logo img { height: 42px; width: auto; border-radius: var(--radius-sm); }
.logo-accent { color: var(--accent); }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 15px;
    position: relative;
}
.main-nav a:hover, .main-nav a.active { color: var(--primary); }
.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 4px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 420px;
}
.search-box input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid transparent;
    border-radius: 40px;
    background: var(--bg);
    transition: var(--transition);
}
.search-box input:focus { 
    border-color: var(--primary-light); 
    background: var(--surface); 
    box-shadow: 0 0 0 4px var(--primary-50);
}
.search-box svg {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 15px;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-primary { 
    background: linear-gradient(135deg, var(--primary), var(--primary-light)); 
    color: #fff; 
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.btn-primary:hover { 
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35); 
}
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(0.92); transform: translateY(-2px); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.92); transform: translateY(-2px); }
.btn-ghost { background: var(--primary-50); color: var(--primary); }
.btn-ghost:hover { background: var(--primary-100); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 15px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.service-card:hover { 
    transform: translateY(-6px); 
    box-shadow: var(--shadow-lg); 
    border-color: var(--primary-50);
}
.service-card .thumb {
    aspect-ratio: 16/10;
    background: var(--primary-50);
    position: relative;
    overflow: hidden;
}
.service-card .thumb img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.5s ease; 
}
.service-card:hover .thumb img { transform: scale(1.05); }

.service-card .badge-official {
    position: absolute; 
    top: 12px; 
    right: 12px;
    background: var(--accent); 
    color: #fff;
    font-size: 11px; 
    font-weight: 800;
    padding: 6px 12px; 
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}
.service-card .body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.service-card .seller-line { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; }
.service-card .seller-line img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.service-card .title { font-weight: 800; font-size: 16px; line-height: 1.5; color: var(--text); margin-bottom: 16px; }
.service-card .meta { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-top: auto; }
.service-card .price-row {
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px dashed var(--border); padding-top: 14px; margin-top: 14px;
}
.service-card .price { font-weight: 900; color: var(--primary); font-size: 18px; }
.rating { display: flex; align-items: center; gap: 4px; color: var(--warning); font-weight: 800; font-size: 14px; }
.rating svg { width: 16px; height: 16px; fill: var(--warning); }

/* ===== Grid ===== */
.grid { display: grid; gap: 24px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ===== Forms ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 700;
    font-size: 13.5px;
    margin-bottom: 7px;
    color: var(--text);
}
.hint { font-size: 12.5px; color: var(--text-light); margin-top: 5px; }

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: var(--transition);
}
.form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--primary-50); }
textarea.form-control { resize: vertical; min-height: 100px; }
.input-group { display: flex; gap: 10px; }
.input-group .form-control { flex: 1; }

select.form-control {
    color: var(--text);
    background-color: var(--surface);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 16px;
    padding-right: 16px;
    padding-left: 38px;
    cursor: pointer;
}
select.form-control option {
    color: var(--text);
    background-color: var(--surface);
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition);
}
.radio-card:hover { border-color: var(--primary-light); }
.radio-card.checked { border-color: var(--primary); background: var(--primary-50); }
.radio-card input { margin-top: 4px; accent-color: var(--primary); }

/* ===== Alerts / Badges ===== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th, table td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
table th { color: var(--text-muted); font-weight: 700; font-size: 13px; background: var(--bg); }
table tr:hover td { background: var(--primary-50); }

/* ===== Dashboard Layout ===== */
.dash-layout { display: flex; min-height: calc(100vh - 76px); position: relative; }
.dash-sidebar {
    width: 260px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: 24px 16px;
    flex-shrink: 0;
}
.nav-section-title {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 800;
    padding: 16px 12px 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dash-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 3px;
}
.dash-sidebar a:hover { background: var(--primary-50); color: var(--primary); }
.dash-sidebar a.active { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }

.count { 
    margin-right: auto;
    background: var(--danger); 
    color: #fff; 
    font-size: 11px; 
    padding: 2px 8px; 
    border-radius: 10px; 
}

.dash-main { flex: 1; padding: 32px; max-width: 100%; overflow-x: hidden; }

/* زرار فتح القائمة على الموبايل فقط */
.dash-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--primary-50);
    color: var(--primary);
    border: none;
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 14px;
    margin: 0 0 18px;
    cursor: pointer;
    box-sizing: border-box;
}
.dash-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 199;
}

.page-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 14px; }
.page-title h1 { font-size: 23px; font-weight: 900; }
.page-title p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.stat-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}
.stat-box .stat-label { font-size: 13px; color: var(--text-muted); font-weight: 700; }
.stat-box .stat-value { font-size: 27px; font-weight: 900; color: var(--primary); }
.stat-box .stat-value.success { color: var(--success); }
.stat-box .stat-value.warning { color: var(--warning); }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 64px 20px; color: var(--text-muted); }
.empty-state svg { width: 56px; height: 56px; margin: 0 auto 16px; opacity: .4; }
.empty-state h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }

/* ===== Footer ===== */
.site-footer {
    background: var(--text);
    color: #B5BCC9;
    padding: 56px 0 26px;
    margin-top: 64px;
}
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.site-footer a { color: #B5BCC9; font-size: 13.5px; display: block; margin-bottom: 10px; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #2A3447; margin-top: 32px; padding-top: 22px; text-align: center; font-size: 13px; color: #7C8696; }

/* ===== Tabs (Mobile Optimized) ===== */
.tabs { 
    display: flex; 
    gap: 8px; 
    border-bottom: 2px solid var(--border); 
    margin-bottom: 28px; 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
    padding: 14px 20px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}
.tabs a.active, .tabs a:hover { color: var(--primary); border-color: var(--primary); }

/* ===== صفحة عرض الخدمة وتفاصيلها ===== */
.service-detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 30px; }

/* ===== اختيار الصورة الأساسية للخدمة ===== */
.primary-image-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.primary-image-option { position: relative; cursor: pointer; display: block; }

/* ===== Responsive & Mobile First ===== */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px) {
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .dash-layout { flex-direction: column; }
    .dash-menu-toggle { display: flex; }
    .dash-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        z-index: 200;
        transform: translateX(100%);
        transition: transform .25s ease;
        overflow-y: auto;
        box-shadow: var(--shadow-lg);
    }
    .dash-sidebar.open { transform: translateX(0); }
    .dash-sidebar-overlay.open { display: block; }
    .dash-main { padding: 24px; }
    .service-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; padding: 12px 0; }
    .main-nav { display: none; }
    .search-box { max-width: 100%; order: 3; margin-top: 10px; }

    .container { padding: 0 16px; }

    .service-card .thumb { aspect-ratio: 16/9; }
    .service-card .body { padding: 16px; }

    .page-title h1 { font-size: 20px; }
}

@media (max-width: 480px) {
    /* على أصغر الشاشات كارت واحد فقط */
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; gap: 20px; }
    .search-box input { padding: 14px 45px 14px 16px; font-size: 16px; }
    .btn { padding: 14px 20px; width: 100%; }
}