/* assets/css/style.css */

/* ============================================
   المتغيرات والإعدادات الأساسية
   ============================================ */
:root {
    --primary: #667eea;
    --primary-dark: #0a1a2a;
    --secondary: #facc15;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============================================
   الوضع الليلي
   ============================================ */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .glass-nav,
body.dark-mode .tools-section,
body.dark-mode .image-card {
    background: rgba(30, 41, 59, 0.95);
    color: #e2e8f0;
}

body.dark-mode .category-card {
    background: rgba(30, 41, 59, 0.95);
}

body.dark-mode .image-info {
    background: #1e293b;
}

/* ============================================
   الشريط العلوي
   ============================================ */
.glass-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--primary-gradient, linear-gradient(135deg, #667eea, #764ba2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

.nav-actions {
    display: flex;
    gap: 0.75rem;
}

.glass-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
}

.glass-btn:hover {
    background: var(--primary-color, #667eea);
    color: white;
    transform: translateY(-2px);
}

/* ============================================
   قسم الهيرو
   ============================================ */
.hero-section {
    margin: 2rem;
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
}

.hero-content {
    background: var(--primary-gradient, linear-gradient(135deg, #667eea, #764ba2));
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-content::before {
    content: '✨';
    position: absolute;
    font-size: 200px;
    opacity: 0.1;
    top: -50px;
    right: -50px;
    transform: rotate(15deg);
    pointer-events: none;
}

.hero-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

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

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    border-radius: 50px;
    text-align: center;
    color: white;
}

.stat-card i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-card span {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.stat-card small {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ============================================
   الأقسام
   ============================================ */
.categories-section {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--secondary);
    margin: 0.5rem auto 0;
    border-radius: 5px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.25rem;
}

.category-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.category-card:hover::before {
    left: 100%;
}

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

.category-card.active {
    border: 2px solid var(--primary-color);
    background: rgba(255, 255, 255, 1);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.category-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.category-badge {
    font-size: 0.7rem;
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
}

/* ============================================
   شريط الأدوات
   ============================================ */
.tools-section {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.tools-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
}

.tools-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tools-group label {
    font-weight: 600;
    color: #333;
}

.modern-select {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    background: white;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.modern-select:hover {
    border-color: var(--primary-color);
}

.code-box {
    flex: 2;
    display: flex;
    gap: 0.75rem;
    min-width: 250px;
}

.code-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-family: monospace;
    font-size: 0.75rem;
    background: #f8fafc;
    direction: ltr;
}

.copy-btn {
    background: var(--primary-gradient, linear-gradient(135deg, #667eea, #764ba2));
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ============================================
   معرض الصور
   ============================================ */
.gallery-section {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.gallery-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.image-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

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

.image-wrapper {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    padding: 2rem;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-wrapper img {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.image-card:hover .image-wrapper img {
    transform: scale(1.1);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.overlay-icon {
    background: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.overlay-icon:hover {
    transform: scale(1.1);
}

.image-info {
    padding: 1rem;
    text-align: center;
    background: white;
}

.image-name {
    font-size: 0.75rem;
    color: #666;
    background: #f8fafc;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    display: inline-block;
}

/* ============================================
   ترقيم الصفحات
   ============================================ */
.pagination-modern {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.pagination-modern a,
.pagination-modern span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 1rem;
    background: white;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: #333;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.pagination-modern a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.pagination-modern .active {
    background: var(--primary-color);
    color: white;
}

.pagination-dots {
    background: transparent !important;
    box-shadow: none !important;
}

/* ============================================
   التذييل
   ============================================ */
.main-footer {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #94a3b8;
    margin-top: 4rem;
    padding: 3rem 2rem 1.5rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h4 {
    font-size: 1.25rem;
    color: white;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.footer-column h4::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--secondary);
    margin-top: 0.5rem;
}

.footer-column p {
    line-height: 1.8;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: #94a3b8;
    text-decoration: none;
    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--secondary);
    transform: translateX(5px);
    display: inline-block;
}

.stats-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary);
    color: #1a1a2e;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   أزرار مساعدة
   ============================================ */
.go-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-gradient, linear-gradient(135deg, #667eea, #764ba2));
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 99;
    box-shadow: var(--shadow-lg);
    color: white;
    font-size: 1.25rem;
}

.go-top.show {
    opacity: 1;
    visibility: visible;
}

.go-top:hover {
    transform: translateY(-5px) scale(1.1);
}

.toast-notification {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
}

.empty-state i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.empty-state code {
    background: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
}

/* ============================================
   استجابة
   ============================================ */
@media (max-width: 1024px) {
    .hero-title { font-size: 2.5rem; }
    .gallery-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero-section { margin: 1rem; }
    .hero-content { padding: 2rem 1rem; }
    .categories-section, .tools-section, .gallery-section { padding: 0 1rem; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .tools-container { flex-direction: column; }
    .code-box { width: 100%; }
}

@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(1, 1fr) !important; }
    .hero-stats { gap: 1rem; }
    .stat-card { padding: 0.5rem 1rem; }
    .stat-card span { font-size: 1rem; }
    .toast-notification { white-space: normal; text-align: center; }
}


/* ============================================
   الأقسام - شريط منزلق (Slider)
   ============================================ */
.categories-slider {
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.slider-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem 1rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.slider-controls {
    display: flex;
    gap: 0.5rem;
}

.slider-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 0.8rem;
}

.slider-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.slider-wrapper {
    position: relative;
}

.slider-container {
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border-radius: 15px;
}

.slider-container::-webkit-scrollbar {
    height: 4px;
}

.slider-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.slider-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.categories-slider-grid {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    min-width: min-content;
}

.slider-category-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 0.5rem 1.2rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    cursor: pointer;
}

.slider-category-card:hover {
    transform: translateY(-3px);
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.slider-category-card.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.slider-category-card.active .slider-category-name {
    color: white;
}

.slider-category-icon {
    font-size: 1.1rem;
}

.slider-category-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
}

.active-indicator {
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: white;
    border-radius: 3px;
}

/* وضع ليلي */
body.dark-mode .slider-category-card {
    background: rgba(30, 41, 59, 0.95);
}

body.dark-mode .slider-category-name {
    color: #e2e8f0;
}

body.dark-mode .slider-category-card.active {
    background: var(--primary-color);
}

body.dark-mode .slider-btn {
    background: rgba(30, 41, 59, 0.95);
    color: white;
}

/* استجابة */
@media (max-width: 768px) {
    .categories-slider {
        padding: 0 1rem;
    }
    
    .slider-category-card {
        padding: 0.4rem 1rem;
    }
    
    .slider-category-icon {
        font-size: 0.9rem;
    }
    
    .slider-category-name {
        font-size: 0.7rem;
    }
    
    .slider-title {
        font-size: 0.85rem;
    }
    
    .slider-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .slider-category-card {
        padding: 0.3rem 0.8rem;
    }
    
    .slider-category-name {
        font-size: 0.65rem;
    }
}