
/* style.css */
:root {
    --bg-color: #0f0f0f;
    --card-bg: #1a1a1a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --border-color: rgba(255, 255, 255, 0.05);
    --font-main: 'Rubik', sans-serif;
}
[dir="rtl"] :root {
    --font-main: 'Cairo', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- UTILS --- */
.container { max-width: 1028px; margin: 0 auto; padding: 0 1.5rem; }
.text-center { text-align: center; }
.hidden { display: none; }

/* --- NAVIGATION --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; }

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* Simulating the "P" box in the logo */
.logo::before {
    content: 'P';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background-color: var(--accent);
    color: #000;
    border-radius: 0.5rem;
    font-weight: bold;
}

.nav-links { display: flex; gap: 1rem; }

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px; /* full rounded */
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}
.btn-primary {
    background-color: var(--accent);
    color: #000;
}
.btn-primary:hover {
    box-shadow: 0 0 15px var(--accent);
    transform: translateY(-2px);
}
.btn-outline {
    border-color: rgba(255,255,255,0.1);
    background: transparent;
    color: var(--text-muted);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
    border-color: #fff;
}

/* --- H Font --- */
h1 {
    font-size: 2rem;
    margin: 0 0 20px 0;
}
/* --- HERO SECTION --- */
.hero {
    padding: 8rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
/* Decorative Blob */
.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: var(--accent);
    opacity: 0.05;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    color: var(--text-main);
}
.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 48rem;
    margin: 0 auto;
    font-weight: 300;
}

@media (min-width: 768px) {
    .hero h1 { font-size: 4.5rem; }
}

/* --- SECTIONS --- */
.section {
    padding: 1rem;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 3rem;
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    backdrop-filter: blur(4px);
}
/* Centering titles logic if needed, but preview uses specific layout. 
   In Preview.tsx: Flex container with lines. 
   We will approximate nicely. */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}
.section-line { flex: 1; height: 1px; background: rgba(255,255,255,0.1); }

/* --- GRID & CARDS --- */
.grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}
@media (min-width: 768px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

.card-image {
    height: 14rem;
    overflow: hidden;
    position: relative;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.card:hover .card-image img {
    transform: scale(1.1);
}
.card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--card-bg), transparent);
    opacity: 0.6;
}

.card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.date {
    font-size: 0.75rem;
    font-family: monospace;
    padding: 0.25rem 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--accent);
    border-radius: 0.25rem;
    width: fit-content;
    margin-bottom: 0.75rem;
}

.card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}
.card:hover h3 { color: var(--accent); }

.card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    margin-top: auto;
    width: 100%;
    padding: 0.75rem;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s;
}
.read-more:hover {
    background-color: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* Row Card (Articles) */
.row-card {
     background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}
.row-card:hover { background-color: rgba(255,255,255,0.02); }
.row-img {
    border-radius: 0.75rem;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    height: 16rem;
}
.row-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.row-card:hover .row-img img { transform: scale(1.1); }

.row-card .card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: center;
}
.row-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.row-card .read-more {
    width: auto; 
    border: none; 
    padding: 0; 
    text-align: left; 
    color: rgba(255,255,255,0.7);
}
.row-card .read-more:hover { background: none; color: var(--accent); }
[dir="rtl"] .row-card .read-more { text-align: right; }


/* --- FOOTER --- */
footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    background: rgba(0,0,0,0.2);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}
footer a:hover { color: var(--accent); }

/* --- ADMIN PANEL STYLES --- */
/* These override/augment basics for the dashboard */
.sidebar {
    background-color: #18181b;
    border-right: 1px solid var(--border-color);
}
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--border-color); }

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--text-muted);
    border-radius: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}
.nav-link:hover { background-color: rgba(255,255,255,0.05); color: #fff; }
.nav-link.active {
    background-color: var(--accent);
    color: #000;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    background-color: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    color: #fff;
    font-family: inherit;
    transition: border-color 0.3s;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background-color: rgba(0,0,0,0.5);
}

table { width: 100%; border-collapse: collapse; }
th {
    text-align: start;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border-color);
}
td {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
tr:hover td { background-color: rgba(255,255,255,0.02); }

.action-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    margin-inline-end: 0.5rem;
    display: inline-block;
}
.action-btn:hover { color: var(--accent); background: rgba(16, 185, 129, 0.1); }
.action-btn.delete:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

/* Toast */
.toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: #2a2a2a;
    border: 1px solid var(--accent);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.4s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-icon {
    width: 1.5rem; height: 1.5rem;
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
}

/* --- LIGHTBOX --- */
#lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 10000; display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; backdrop-filter: blur(5px); }
#lightbox.active { display: flex; opacity: 1; }
.lightbox-content { position: relative; max-width: 90%; max-height: 90%; display: flex; justify-content: center; align-items: center; }
.lightbox-content img { max-width: 100%; max-height: 90vh; border-radius: 8px; box-shadow: 0 0 50px rgba(0,0,0,0.5); object-fit: contain; }

.lightbox-close { position: absolute; top: 20px; right: 20px; background: rgba(0,0,0,0.5); border: none; color: white; font-size: 30px; cursor: pointer; padding: 10px; border-radius: 50%; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; transition: 0.2s; z-index: 10001; }
.lightbox-close:hover { background: rgba(255,255,255,0.2); color: #ef4444; }

.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); border: none; color: white; font-size: 30px; cursor: pointer; padding: 15px; border-radius: 50%; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; transition: 0.2s; z-index: 10001; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (max-width: 768px) {
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-close { top: 10px; right: 10px; }
}

/* =========================================
   تنسيق شبكة الصور مع تأثير تحويم احترافي
   ========================================= */

/* =========================================
   تنسيق شبكة الصور مع تعديلات الموبايل
   ========================================= */

.gallery-grid {
    display: grid;
    /* لشاشات الكمبيوتر والتابلت:
       يتم استخدام auto-fill مع حد أدنى 220 بكسل
    */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 30px;
    margin: 0 auto;
    max-width: 1200px;
}

/* --- تخصيص العرض للموبايل (أقل من 768 بكسل) --- */
@media (max-width: 768px) {
    .gallery-grid {
        /*
           هنا نجبر الشبكة أن تكون عمودين بالتساوي:
           repeat(2, 1fr) تعني عمودين
           إذا أردت 3 أعمدة غير الرقم 2 إلى 3
        */
        grid-template-columns: repeat(2, 1fr); 
        
        /* تقليل المسافات والهوامش لتناسب الشاشة الصغيرة */
        gap: 10px; 
        padding: 10px;
    }
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    display: block;
    
    /* الخصائص الجمالية */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform, box-shadow, filter;
}

/* --- تأثير التحويم (Hover Effect) --- */
/* يفضل تعطيل أو تقليل تأثير التحويم القوي على الموبايل لتجنب التعليق، 
   لذلك نجعله يعمل فقط على الشاشات التي تدعم الماوس (hover: hover) */
@media (hover: hover) {
    .gallery-grid img:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 
            0 20px 40px rgba(0, 0, 0, 0.15),
            0 10px 15px rgba(0, 0, 0, 0.1);
        filter: brightness(1.05);
    }
}
/* Admin Panel Styles */
.admin-wrapper { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: #1a1a1a; padding: 20px; transition: width 0.3s ease; position: relative; }
.sidebar.collapsed { width: 70px; }
.sidebar.collapsed .nav-item span, .sidebar.collapsed .sidebar-header h3 { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.toggle-btn { background: none; border: 1px solid #333; color: #fff; cursor: pointer; padding: 5px 10px; border-radius: 5px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 10px; }
.nav-item { padding: 10px; color: #aaa; text-decoration: none; border-radius: 5px; white-space: nowrap; overflow: hidden; }
.nav-item:hover { background: #333; color: #fff; }
.main-content { flex: 1; padding: 20px; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.admin-form { display: flex; flex-direction: column; gap: 15px; max-width: 800px; margin-bottom: 30px; }
.admin-form input, .admin-form textarea { padding: 10px; background: #222; border: 1px solid #333; color: #fff; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table td { padding: 10px; border-bottom: 1px solid #333; }