﻿/* ========================================
   جمعية الدعوة والإرشاد - النسخة المحسّنة
   ======================================== */

/* Variables */
:root {
    --primary: #0f172a;
    --secondary: #1e293b;
    --accent: #10b981;
    --accent-light: #34d399;
    --accent-dark: #059669;
    --gold: #f59e0b;
    --gold-light: #fbbf24;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f8fafc;
    --dark: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --gradient-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    --gradient-accent: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-arabic: 'Tajawal', 'Segoe UI', sans-serif;
    --font-display: 'Almarai', 'Tajawal', sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-arabic);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { 
    background: var(--gradient-accent); 
    border-radius: var(--radius-full); 
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); }

/* ========================================
   Loading Overlay
   ======================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========================================
   Navbar
   ======================================== */
.navbar-custom {
    background: var(--gradient-primary);
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.navbar-custom.scrolled {
    padding: 0.5rem 0;
    background: rgba(15, 23, 42, 0.95);
}

.navbar-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.navbar-brand img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1.2rem !important;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover { color: var(--accent-light) !important; }

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: var(--transition);
    transform: translateX(50%);
}

.nav-link:hover::after { width: 60%; }

/* Cart Icon */
.cart-icon {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.cart-icon:hover { background: rgba(255,255,255,0.1); }

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-full);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
    min-height: 100vh;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero-section::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    animation: float 8s ease-in-out infinite;
}

.hero-section::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

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

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-title span {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn-hero {
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.5);
    color: white;
}

.btn-hero-outline {
    background: transparent;
    color: white;
    border: 2px solid var(--accent);
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-hero-outline:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-3px);
}

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

.hero-image img {
    max-width: 100%;
    animation: heroFloat 6s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* Stats Box */
.stats-box {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 1.5rem 2rem;
    margin-top: 3rem;
    display: flex;
    gap: 2.5rem;
    border: 1px solid rgba(255,255,255,0.1);
}

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

.stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-light);
}

.stat-label {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
}

/* ========================================
   Products Section
   ======================================== */
.products-section {
    padding: 80px 0;
    background: var(--gray-50);
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gray-900);
    text-align: center;
    margin-bottom: 0.75rem;
}

.section-subtitle {
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

/* Categories Filter */
.categories-filter {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 2px solid var(--gray-200);
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    color: var(--gray-700);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Product Card */
.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: var(--gray-100);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-actions {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    transition: bottom 0.3s ease;
}

.product-card:hover .product-actions {
    bottom: 0;
}

.action-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    border: none;
    background: white;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    cursor: pointer;
}

.action-btn:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.1);
}

.product-info {
    padding: 1.25rem;
}

.product-category {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0.4rem 0;
    color: var(--gray-900);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.current-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent);
}

.old-price {
    font-size: 0.9rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

/* ========================================
   Cart Sidebar
   ======================================== */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.cart-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    left: -400px;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    box-shadow: var(--shadow-xl);
    z-index: 1100;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open { left: 0; }

.cart-header {
    padding: 1.25rem;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h4 {
    font-family: var(--font-display);
    font-weight: 700;
    margin: 0;
    font-size: 1.1rem;
}

.cart-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.cart-item-image {
    width: 70px;
    height: 70px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

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

.cart-item-details { flex: 1; }

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.cart-item-price {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.95rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    background: white;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.qty-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    padding: 8px;
}

.cart-item-remove:hover { transform: scale(1.2); }

.cart-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.cart-total span:last-child { color: var(--accent); }

.btn-checkout {
    width: 100%;
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.cart-empty i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--gray-300);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--gradient-primary);
    color: white;
    padding: 50px 0 25px;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--accent-light);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li { margin-bottom: 0.6rem; }

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-light);
    padding-right: 8px;
}

.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

.footer-bottom a {
    color: var(--accent-light);
    text-decoration: none;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
}

.custom-toast {
    background: white;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toastIn 0.4s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-toast.success i { color: var(--success); }
.custom-toast.error i { color: var(--danger); }

/* ========================================
   Quick View Modal
   ======================================== */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1rem 1.25rem;
}

.modal-title {
    font-family: var(--font-display);
    font-weight: 700;
}

.btn-close { filter: invert(1); }

/* ========================================
   Form Elements
   ======================================== */
.form-control,
.form-select {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-family: var(--font-arabic);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    outline: none;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--gray-700);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 992px) {
    .hero-title { font-size: 2.5rem; }
    .stats-box { gap: 1.5rem; }
    .stat-number { font-size: 1.6rem; }
}

@media (max-width: 768px) {
    .hero-title { font-size: 2rem; text-align: center; }
    .hero-subtitle { text-align: center; margin: 0 auto 2rem; }
    .hero-buttons { justify-content: center; }
    .stats-box { flex-wrap: wrap; justify-content: center; gap: 1rem; }
    .cart-sidebar { width: 100%; }
    .btn-hero, .btn-hero-outline { width: 100%; justify-content: center; }
}
