/* ====================================
   برامج بلس - Main Stylesheet
   Dark App Store Design
   ==================================== */

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

:root {
    --bg-primary: #000000;
    --bg-secondary: #1a1a2e;
    --bg-card: #1c1c1e;
    --bg-card-hover: #2c2c2e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --accent-purple: #6C5CE7;
    --accent-blue: #0a84ff;
    --accent-cyan: #30d158;
    --accent-green: #30d158;
    --accent-gradient: linear-gradient(135deg, #6C5CE7 0%, #a855f7 100%);
    --card-radius: 16px;
    --btn-radius: 18px;
    --shadow-card: 0 4px 20px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(108,92,231,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    background: var(--bg-primary);
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    max-width: 500px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ====== Header / Navbar ====== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.navbar-brand .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.navbar-brand .brand-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.navbar-brand .brand-sub {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-actions .search-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
}

.navbar-actions .profile-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #2c2c2e;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

/* ====== Slider / Banner ====== */
.slider-section {
    padding: 16px;
}

.slider-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: #1c1c1e;
}

.slide {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
}

.slide.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
}

.slide-content h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 5px;
}

.slide-content p {
    font-size: 13px;
    color: #ccc;
    line-height: 1.4;
}

.slider-nav {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 5;
}

.slider-nav button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: 0.3s;
}

.dot.active {
    background: white;
    width: 15px;
    border-radius: 10px;
}

/* ====== Category Tabs ====== */
.category-tabs {
    padding: 5px 16px 15px;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tabs-inner {
    display: flex;
    gap: 10px;
}

.category-tab {
    padding: 8px 18px;
    border-radius: 20px;
    background: #1c1c1e;
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-tab i { font-size: 12px; }

.category-tab.active {
    background: var(--accent-blue);
}

.category-tab:nth-child(2).active { background: #af52de; }
.category-tab:nth-child(3).active { background: #007aff; }

/* ====== App Cards ====== */
.apps-section {
    padding: 0 16px 100px;
}

.app-card {
    display: flex;
    align-items: center;
    background: #1c1c1e;
    padding: 12px;
    border-radius: 18px;
    margin-bottom: 12px;
    cursor: pointer;
    flex-direction: row-reverse; /* Icons on the right for RTL */
}

.app-icon {
    width: 62px;
    height: 62px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
}

.app-info {
    flex: 1;
    margin-right: 15px;
    text-align: right;
}

.app-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.app-developer {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-start;
}

.app-developer i { color: #0a84ff; font-size: 10px; }

.app-meta {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    justify-content: flex-start;
}

.badge {
    font-size: 10px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.app-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
}

.btn-install {
    background: #2c2c2e;
    color: #0a84ff;
    border: none;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.app-size {
    font-size: 10px;
    color: var(--text-secondary);
}

/* ====== Bottom Nav ====== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: rgba(18,18,18,0.95);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 25px;
    border-top: 1px solid rgba(255,255,255,0.05);
    z-index: 1000;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #8e8e93;
    gap: 5px;
}

.bottom-nav a i { font-size: 20px; }
.bottom-nav a span { font-size: 10px; font-weight: 500; }
.bottom-nav a.active { color: #0a84ff; }

/* ====== Popup & Toast ====== */
.install-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.install-popup.active { display: flex; }

.install-popup-content {
    background: #1c1c1e;
    width: 85%;
    max-width: 320px;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
}

.app-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    margin-bottom: 15px;
}

.btn-confirm {
    width: 100%;
    background: #0a84ff;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    margin-top: 20px;
    font-size: 16px;
}

.btn-cancel {
    width: 100%;
    background: transparent;
    color: #8e8e93;
    border: none;
    padding: 12px;
    font-size: 14px;
    margin-top: 5px;
}

.toast {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(44,44,46,0.95);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 3000;
    transition: 0.3s;
}

.toast.show { transform: translateX(-50%) translateY(0); }

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

.empty-state {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
}

.empty-state i { font-size: 40px; margin-bottom: 10px; opacity: 0.3; }
