@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
    --primary: #6c5ce7;
    --primary-dark: #5a4bd1;
    --secondary: #00cec9;
    --accent: #fd79a8;
    --dark: #0a0a1a;
    --dark-card: #12122a;
    --dark-border: #1e1e3e;
    --text: #e8e8f0;
    --text-muted: #b0b0cc;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --gradient-1: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    --gradient-2: linear-gradient(135deg, #00cec9 0%, #81ecec 100%);
    --gradient-3: linear-gradient(135deg, #fd79a8 0%, #e17055 100%);
}

* { box-sizing: border-box; }

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--dark);
    color: var(--text);
    overflow-x: hidden;
    direction: rtl;
}

/* ─── NAVBAR ─── */
.navbar {
    background: rgba(10, 10, 26, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--dark-border);
    padding: 12px 0;
}
.navbar-brand {
    font-weight: 900;
    font-size: 1.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    transition: 0.3s;
    margin: 0 6px;
}
.nav-link:hover, .nav-link.active {
    color: #fff !important;
}
.cart-badge {
    background: var(--gradient-1);
    color: #fff;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 11px;
    margin-right: 4px;
}

/* ─── HERO ─── */
.hero {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 50%, #0a0a1a 100%);
    padding: 140px 0 100px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(108,92,231,0.12) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(0,206,201,0.08) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(253,121,168,0.06) 0%, transparent 50%);
    animation: heroGlow 10s ease-in-out infinite alternate;
}
.hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(108,92,231,0.3), transparent),
        radial-gradient(2px 2px at 40% 70%, rgba(0,206,201,0.2), transparent),
        radial-gradient(2px 2px at 80% 40%, rgba(253,121,168,0.2), transparent),
        radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.15), transparent),
        radial-gradient(1px 1px at 10% 60%, rgba(108,92,231,0.15), transparent),
        radial-gradient(1px 1px at 90% 80%, rgba(0,206,201,0.15), transparent);
    animation: twinkle 8s ease-in-out infinite alternate;
}
@keyframes twinkle {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}
@keyframes heroGlow {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-30px, 30px) rotate(1deg); }
}
.hero h1 {
    font-weight: 900;
    font-size: 3.2rem;
    margin-bottom: 16px;
    position: relative;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.hero h1 span {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-bottom: 32px;
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.hero-btn {
    background: var(--gradient-1);
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.05rem;
    transition: 0.3s;
    position: relative;
    box-shadow: 0 4px 20px rgba(108,92,231,0.3);
}
.hero-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(108,92,231,0.5);
    color: #fff;
}
.hero-screenshot {
    animation: heroFloat 4s ease-in-out infinite;
}
@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.hero-img-wrap {
    filter: drop-shadow(0 20px 40px rgba(108,92,231,0.2));
}

/* ─── SECTION TITLES ─── */
.section-title {
    font-weight: 800;
    font-size: 1.8rem;
    margin-bottom: 8px;
}
.section-sub {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 40px;
}

/* ─── PRODUCT CARD ─── */
.product-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 16px;
    overflow: hidden;
    transition: 0.4s;
    height: 100%;
}
.product-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 20px 60px rgba(108,92,231,0.15);
}
.product-card .img-wrap {
    height: 200px;
    overflow: hidden;
    background: #1a1a30;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.4s;
}
.product-card:hover .img-wrap img {
    transform: scale(1.05);
}
.product-card .card-body {
    padding: 20px;
}
.product-card .category-badge {
    background: rgba(108,92,231,0.15);
    color: var(--primary);
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 50px;
    font-weight: 500;
}
.product-card h5 {
    font-weight: 700;
    margin: 10px 0 6px;
    font-size: 1.05rem;
}
.product-card .desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card .price {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--secondary);
}
.product-card .old-price {
    color: #e17055;
    text-decoration: line-through;
    font-size: 0.9rem;
    margin-right: 8px;
    opacity: 0.8;
}
.product-card .add-cart-btn {
    background: var(--gradient-1);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 8px 20px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: 0.3s;
    width: 100%;
    margin-top: 12px;
}
.product-card .add-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108,92,231,0.3);
}

/* ─── FEATURES / SERVICE CARDS ─── */
.service-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    transition: 0.4s;
    height: 100%;
}
.service-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}
.service-card .icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: rgba(108,92,231,0.12);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary);
}
.service-card h5 { font-weight: 700; }
.service-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ─── FOOTER ─── */
footer {
    background: #060612;
    border-top: 1px solid var(--dark-border);
    padding: 40px 0 20px;
}
footer h6 { font-weight: 700; margin-bottom: 16px; }
footer a { color: var(--text-muted); text-decoration: none; display: block; margin-bottom: 8px; transition: 0.3s; }
footer a:hover { color: #fff; padding-right: 4px; }

/* ─── PRODUCT DETAIL ─── */
.product-detail .main-img {
    border-radius: 16px;
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
}
.feature-list {
    list-style: none;
    padding: 0;
}
.feature-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--dark-border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.feature-list li::before {
    content: '✓';
    color: var(--success);
    font-weight: bold;
}

/* ─── CART / CHECKOUT ─── */
.cart-item {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.cart-item h6 { font-weight: 700; }
.cart-item .price { color: var(--secondary); font-weight: 700; }

/* ─── ADMIN ─── */
.admin-sidebar {
    background: var(--dark-card);
    border-left: 1px solid var(--dark-border);
    min-height: 100vh;
    padding: 20px;
}
.admin-sidebar a {
    display: block;
    padding: 10px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: 0.3s;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: rgba(108,92,231,0.12);
    color: #fff;
}
.stat-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    padding: 20px;
}
.stat-card .num {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
}
.stat-card .label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ─── UTILITIES ─── */
.text-gradient { background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.bg-dark-card { background: var(--dark-card); }
.border-dark { border-color: var(--dark-border) !important; }
.form-control, .form-select, .qty-input {
    background: #1a1a30;
    border: 1px solid var(--dark-border);
    color: #fff;
    border-radius: 8px;
}
.form-control:focus, .form-select:focus, .qty-input:focus {
    background: #1a1a30;
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(108,92,231,0.15);
}
.form-check-input {
    background-color: #1a1a30;
    border-color: var(--dark-border);
}
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
.form-check-label {
    color: var(--text);
}
.form-label {
    color: var(--text);
}
.breadcrumb-item a { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb { background: transparent; }
.list-group-item {
    background: var(--dark-card);
    border-color: var(--dark-border);
    color: var(--text);
}
.list-group-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.list-group-item a {
    color: var(--text);
}
.alert-info {
    background: rgba(0,206,201,0.1);
    border-color: rgba(0,206,201,0.2);
    color: var(--secondary);
}
.table { color: var(--text) !important; --bs-table-bg: transparent !important; --bs-table-border-color: var(--dark-border) !important; }
.table > :not(caption) > * > * { color: var(--text) !important; background-color: transparent !important; }
.table th { color: var(--text-muted) !important; background-color: var(--dark-border) !important; border-color: var(--dark-border) !important; }
.table td { color: var(--text) !important; background-color: var(--dark-card) !important; border-color: var(--dark-border) !important; }
.table-dark { --bs-table-bg: var(--dark-card); --bs-table-border-color: var(--dark-border); }
.table-dark th {
    background: var(--dark-card);
    border-color: var(--dark-border);
    color: var(--text);
}
.table td {
    border-color: var(--dark-border);
    color: var(--text);
}
.alert { border-radius: 12px; }
.badge { border-radius: 50px; }

/* ─── LTR PHONE NUMBERS ─── */
bdi, .ltr { direction: ltr; unicode-bidi: embed; }

/* ─── SCREENSHOT GALLERY ─── */
.screenshot-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--dark-border);
    background: var(--dark-card);
    transition: all 0.3s ease;
    cursor: pointer;
}
.screenshot-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(108,92,231,0.2);
}
.screenshot-card img {
    transition: transform 0.3s ease;
}
.screenshot-card:hover img {
    transform: scale(1.02);
}
.screenshot-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10,10,26,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}
.screenshot-card:hover .screenshot-overlay {
    opacity: 1;
}
.screenshot-overlay i {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
#screenshotGallery .screenshot-card img {
    aspect-ratio: 1366/723;
    object-fit: cover;
}

/* Lightbox overrides */
.lightbox .lb-nav a.lb-prev,
.lightbox .lb-nav a.lb-next {
    opacity: 1;
}
.lb-data .lb-details .lb-caption {
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
}
.lb-outerContainer {
    background: var(--dark-card) !important;
    border-radius: 12px !important;
}
.lb-container { padding: 4px; }
.lb-data .lb-number { font-family: 'Tajawal', sans-serif !important; color: var(--text-muted) !important; }
.lightbox .lb-image { border-radius: 8px !important; }

/* ─── ANIMATIONS ─── */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* ─── CATEGORY CARDS ─── */
.cat-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    transition: 0.4s;
    height: 100%;
}
.cat-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 20px 60px rgba(108,92,231,0.15);
}
.cat-card i {
    font-size: 2.8rem;
    margin-bottom: 16px;
    display: block;
}
.cat-card h5 {
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .hero { padding: 60px 0 40px; }
    .hero .btn-lg { font-size: 0.9rem; padding: 10px 20px; }
}
