/**
 * TraidMod Professional Store Design
 * تصميم احترافي لمتجر ترايد مود
 */

/* ========================================
   CSS Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --dark-surface: #1e293b;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    background: none;
}

/* ========================================
   Container & Layout
   ======================================== */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* ========================================
   Professional Header
   ======================================== */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    gap: 30px;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo img,
.custom-logo-link img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.site-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-title a {
    color: inherit;
}

/* Navigation */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--light-bg);
    padding: 8px;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
}

.nav-menu > li > a {
    font-weight: 600;
    padding: 12px 24px;
    display: block;
    color: var(--text-secondary);
    transition: var(--transition);
    border-radius: 50px;
    position: relative;
    font-size: 14px;
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-toggle,
.user-menu-toggle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    cursor: pointer;
}

.search-toggle:hover,
.user-menu-toggle:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="1" fill="white" opacity="0.1"/><circle cx="10" cy="90" r="1" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 64px;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    letter-spacing: -2px;
}

.hero-content p {
    font-size: 22px;
    margin-bottom: 40px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 50px;
}

.stat-item {
    text-align: center;
    position: relative;
}

.stat-item::after {
    content: '';
    position: absolute;
    top: -10px;
    right: -30px;
    width: 1px;
    height: 60px;
    background: rgba(255,255,255,0.3);
}

.stat-item:last-child::after {
    display: none;
}

.stat-number {
    display: block;
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.stat-label {
    font-size: 16px;
    opacity: 0.8;
    font-weight: 500;
}

/* ========================================
   Apps Store Grid
   ======================================== */
.apps-store {
    padding: 80px 0;
    background: var(--white);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.app-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 0;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    group: hover;
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.app-card.featured {
    border: 2px solid var(--primary-color);
    position: relative;
}

.app-card.featured::before {
    content: 'مميز';
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: var(--white);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.app-image {
    height: 200px;
    background: linear-gradient(135deg, var(--light-bg), #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

.default-icon {
    font-size: 80px;
    opacity: 0.7;
}

.app-content {
    padding: 25px;
}

.app-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.3;
}

.app-version,
.app-size {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-badges {
    display: flex;
    gap: 8px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.modded {
    background: linear-gradient(135deg, #fef3c7, #fbbf24);
    color: #92400e;
}

.badge.premium {
    background: linear-gradient(135deg, #ddd6fe, #8b5cf6);
    color: #5b21b6;
}

.badge.type {
    background: linear-gradient(135deg, #dbeafe, #3b82f6);
    color: #1e40af;
}

.badge.new {
    background: linear-gradient(135deg, #fecaca, #ef4444);
    color: #991b1b;
}

.app-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.download-btn {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 14px 20px;
    border-radius: var(--border-radius);
    font-weight: 700;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.download-icon {
    font-size: 16px;
}

.detail-btn {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    font-size: 14px;
}

.detail-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

/* ========================================
   Categories Section
   ======================================== */
.categories-section {
    padding: 80px 0;
    background: var(--light-bg);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.category-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

.category-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.category-description {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.6;
}

.category-stats {
    margin-bottom: 25px;
}

.app-count {
    background: var(--light-bg);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    display: inline-block;
}

.category-link {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 14px 30px;
    border-radius: 50px;
    font-weight: 700;
    transition: var(--transition);
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

.category-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

/* ========================================
   Page Content
   ======================================== */
.page-content {
    padding: 60px 0;
    background: var(--white);
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 0;
    background: var(--light-bg);
    border-radius: var(--border-radius-lg);
}

.page-header h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.page-content-inner {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 18px;
}

.page-content-inner p {
    margin-bottom: 25px;
    color: var(--text-secondary);
}

.page-content-inner h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 40px 0 25px 0;
}

.page-content-inner h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 30px 0 20px 0;
}

/* ========================================
   Professional Footer
   ======================================== */
.site-footer {
    background: var(--dark-bg);
    color: var(--text-light);
    padding: 60px 0 0;
    margin-top: 80px;
}

.footer-widgets {
    padding-bottom: 50px;
    border-bottom: 1px solid var(--dark-surface);
}

.footer-widget-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 50px;
}

.footer-widget {
    color: var(--text-light);
}

.footer-widget .widget-title {
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 15px;
}

.footer-widget .widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.footer-widget p {
    line-height: 1.8;
    margin-bottom: 25px;
}

.footer-widget ul li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-widget ul li:last-child {
    border-bottom: none;
}

.footer-widget ul li a {
    color: var(--text-light);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-widget ul li a:hover {
    color: var(--primary-color);
    padding-right: 10px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.social-link {
    width: 50px;
    height: 50px;
    background: var(--dark-surface);
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
    font-size: 20px;
}

.social-link:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.footer-bottom {
    padding: 30px 0;
    text-align: center;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom p {
    margin: 0;
    font-size: 14px;
    color: var(--text-light);
}

.footer-links {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-light);
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* ========================================
   Back to Top Button
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    display: none;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* ========================================
   Loading States
   ======================================== */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        border-radius: var(--border-radius);
        margin-top: 10px;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero-content h1 {
        font-size: 48px;
    }
    
    .hero-stats {
        gap: 40px;
    }
    
    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-content h1 {
        font-size: 36px;
    }
    
    .hero-content p {
        font-size: 18px;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 30px;
    }
    
    .stat-item::after {
        display: none;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .footer-widget-area {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .back-to-top {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 28px;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    .apps-store,
    .categories-section {
        padding: 60px 0;
    }
    
    .app-content {
        padding: 20px;
    }
    
    .category-card {
        padding: 30px 20px;
    }
}

/* ========================================
   Dark Mode Support
   ======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --light-bg: #0f172a;
        --white: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --border-color: #334155;
    }
    
    .site-header {
        background: rgba(30, 41, 59, 0.95);
        border-color: var(--border-color);
    }
    
    .app-card,
    .category-card {
        background: var(--dark-surface);
        border-color: var(--border-color);
    }
    
    .page-content {
        background: var(--dark-bg);
    }
    
    .page-header {
        background: var(--dark-surface);
    }
}