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

/* ========== CSS VARIABLES ========== */
:root {
    --primary:       #6366f1;
    --primary-light: #a5b4fc;
    --primary-dark:  #4338ca;
    --accent:        #f43f5e;
    --accent-light:  #fb7185;
    --bg:            #0a0f1e;
    --surface:       #111827;
    --surface-light: #1f2937;
    --surface-hover: #374151;
    --text:          #f1f5f9;
    --text-muted:    #94a3b8;
    --glass:         rgba(17, 24, 39, 0.85);
    --border:        rgba(255,255,255,0.08);
    --success:       #10b981;
    --warning:       #f59e0b;
    --danger:        #ef4444;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Cairo', sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
    text-align: right;
    direction: rtl;
}

a { text-decoration: none; }

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity:0; transform:translateY(24px); }
    to   { opacity:1; transform:translateY(0); }
}
@keyframes glow {
    0%,100% { box-shadow:0 0 10px rgba(99,102,241,0.3); }
    50%      { box-shadow:0 0 30px rgba(99,102,241,0.6); }
}
@keyframes float {
    0%,100% { transform:translateY(0); }
    50%     { transform:translateY(-8px); }
}
.fade-in { animation: fadeIn 0.7s ease-out forwards; }

/* ========== LAYOUT ========== */
.container { max-width:1200px; margin:0 auto; padding:0 2rem; }

/* ========== NAVBAR ========== */
.navbar {
    position: fixed; top:0; left:0; right:0; z-index:1000;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    transition: all 0.3s;
}
.navbar .container { display:flex; justify-content:space-between; align-items:center; }

.navbar-brand {
    font-size: 1.4rem; font-weight: 800; color: var(--text);
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; display: flex; align-items: center; gap: 0.5rem;
}

.navbar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
    -webkit-text-fill-color: initial;
}

.nav-links { display:flex; align-items:center; gap:1.5rem; }
.nav-links a {
    color:var(--text-muted); font-weight:500; font-size:0.95rem;
    transition:color 0.2s; padding:0.3rem 0;
}
.nav-links a:hover, .nav-links a.active { color:var(--primary-light); }
.nav-links a.active { border-bottom: 2px solid var(--primary-light); }
.nav-btn { padding:0.5rem 1.25rem !important; border-radius:10px; }

/* ========== HERO ========== */
.hero {
    padding: 9rem 0 5rem; text-align:center; position:relative; overflow:hidden;
}
.hero::before {
    content:''; position:absolute; top:-20%; left:50%; transform:translateX(-50%);
    width:700px; height:700px;
    background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
    z-index:-1;
}
.hero-badge {
    display:inline-block; background:rgba(99,102,241,0.12); color:var(--primary-light);
    border:1px solid rgba(99,102,241,0.3); border-radius:999px;
    padding:0.4rem 1.2rem; font-size:0.85rem; font-weight:600; margin-bottom:1.5rem;
}
.hero h1 {
    font-size:3.8rem; font-weight:800; line-height:1.1;
    margin-bottom:1.5rem; letter-spacing:-0.02em;
}
.hero h1 span { color:var(--primary-light); }
.hero p { font-size:1.2rem; color:var(--text-muted); max-width:580px; margin:0 auto 2.5rem; }
.hero-btns { display:flex; gap:1rem; justify-content:center; flex-wrap:wrap; }
.btn-lg { padding:1rem 2.5rem !important; font-size:1rem; }

.hero-stats { display:flex; gap:2rem; justify-content:center; margin-top:3rem; flex-wrap:wrap; }
.hero-stats .stat {
    display:flex; align-items:center; gap:0.5rem;
    background:var(--surface); border:1px solid var(--border);
    padding:0.6rem 1.4rem; border-radius:999px; font-size:0.9rem; font-weight:600;
}

/* ========== PROJECT PLAN ========== */
.project-plan {
    padding: 5rem 0; background:var(--surface);
}
.section-header { text-align:center; margin-bottom:3rem; }
.section-badge {
    display:inline-block; background:rgba(99,102,241,0.12); color:var(--primary-light);
    border:1px solid rgba(99,102,241,0.3); border-radius:999px;
    padding:0.4rem 1.2rem; font-size:0.85rem; font-weight:600; margin-bottom:1rem;
}
.section-header h2 { font-size:2.5rem; font-weight:800; margin-bottom:0.5rem; }
.section-header h2 span { color:var(--primary-light); }
.section-header p { color:var(--text-muted); }

.plan-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:1.5rem; }
.plan-card {
    background:var(--bg); border:1px solid var(--border);
    border-radius:24px; padding:2rem; transition:all 0.3s;
}
.plan-card:hover { border-color:var(--primary-light); transform:translateY(-4px); }
.plan-icon { font-size:2.5rem; margin-bottom:1rem; }
.plan-card h3 { font-size:1.2rem; font-weight:700; margin-bottom:0.8rem; color:var(--primary-light); }
.plan-card p { color:var(--text-muted); font-size:0.95rem; margin-bottom:1rem; }
.plan-list { list-style:none; }
.plan-list li { padding:0.3rem 0; font-size:0.9rem; color:var(--text-muted); }
.plan-list li strong { color:var(--text); }
.arch-badge {
    display:inline-block; background:rgba(99,102,241,0.1); color:var(--primary-light);
    border:1px solid rgba(99,102,241,0.2); padding:0.3rem 0.8rem; border-radius:8px;
    font-size:0.75rem; font-weight:600; margin-top:0.8rem;
}

/* ========== POSTS SECTION ========== */
.posts-section { padding:5rem 0; }
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(330px, 1fr)); gap:1.5rem; }

.card {
    background:var(--surface); border:1px solid var(--border);
    border-radius:24px; padding:2rem;
    transition:all 0.3s cubic-bezier(0.4,0,0.2,1);
    display:flex; flex-direction:column;
}
.card:hover { transform:translateY(-8px); border-color:var(--primary-light); background:var(--surface-light); }
.card-category {
    display:inline-block; background:rgba(99,102,241,0.12); color:var(--primary-light);
    border:1px solid rgba(99,102,241,0.2); border-radius:999px;
    padding:0.25rem 0.8rem; font-size:0.75rem; font-weight:600; margin-bottom:1rem;
}
.card-title { font-size:1.3rem; font-weight:700; margin-bottom:0.8rem; }
.card-excerpt { color:var(--text-muted); font-size:0.95rem; flex:1; margin-bottom:1.2rem; }
.card-footer { border-top:1px solid var(--border); padding-top:1rem; }
.card-meta { display:flex; gap:1rem; flex-wrap:wrap; }
.author-badge, .date-badge {
    font-size:0.8rem; color:var(--text-muted); font-weight:500;
}
.empty-notice {
    grid-column:1/-1; text-align:center; padding:2rem;
    background:var(--surface); border:1px dashed var(--border);
    border-radius:16px; color:var(--text-muted);
}
.empty-notice a { color:var(--primary-light); }

/* ========== BUTTONS ========== */
.btn {
    display:inline-block; padding:0.8rem 1.8rem; border-radius:12px;
    font-weight:600; text-decoration:none; transition:all 0.25s;
    cursor:pointer; border:none; font-family:'Cairo',sans-serif; font-size:0.95rem;
}
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-dark); box-shadow:0 8px 20px rgba(99,102,241,0.35); transform:translateY(-1px); }
.btn-outline { border:1px solid var(--border); color:var(--text); background:transparent; }
.btn-outline:hover { background:var(--surface-light); border-color:var(--primary-light); }

.btn-edit {
    background:rgba(99,102,241,0.1); color:var(--primary-light);
    border:1px solid rgba(99,102,241,0.3); padding:0.4rem 1rem;
    border-radius:8px; cursor:pointer; font-size:0.85rem; font-family:'Cairo',sans-serif;
    transition:all 0.2s; text-decoration:none; display:inline-block;
}
.btn-edit:hover { background:rgba(99,102,241,0.2); }

.btn-delete {
    background:rgba(239,68,68,0.1); color:#f87171;
    border:1px solid rgba(239,68,68,0.3); padding:0.4rem 1rem;
    border-radius:8px; cursor:pointer; font-size:0.85rem; font-family:'Cairo',sans-serif;
    transition:all 0.2s;
}
.btn-delete:hover { background:rgba(239,68,68,0.2); }

/* ========== FORMS / AUTH ========== */
.auth-wrapper {
    min-height:100vh; display:flex; align-items:center; justify-content:center;
    padding: 6rem 1rem 2rem;
}
.auth-form {
    background:var(--surface); padding:3rem; border-radius:32px;
    border:1px solid var(--border); width:100%; max-width:460px;
    box-shadow:0 25px 60px rgba(0,0,0,0.4);
}
.auth-form h2 { text-align:center; font-size:1.8rem; font-weight:800; margin-bottom:0.5rem; }
.auth-form .subtitle { text-align:center; color:var(--text-muted); margin-bottom:2.5rem; }

.input-group { margin-bottom:1.4rem; }
.input-group label { display:block; margin-bottom:0.5rem; color:var(--text-muted); font-size:0.875rem; font-weight:600; }
.input-field {
    width:100%; background:var(--bg); border:1px solid var(--border);
    padding:0.9rem 1rem; border-radius:12px; color:var(--text);
    font-family:'Cairo',sans-serif; font-size:0.95rem; transition:border 0.2s;
}
.input-field:focus { outline:none; border-color:var(--primary-light); box-shadow:0 0 0 3px rgba(99,102,241,0.1); }

textarea.input-field { resize:vertical; }

.text-danger { color:#f87171; font-size:0.8rem; margin-top:0.3rem; display:block; }

/* ========== ADMIN PAGES ========== */
.admin-hero { padding:8rem 0 4rem; }
.admin-header { margin-bottom:3rem; }
.admin-header h1 { font-size:3rem; font-weight:800; }
.admin-header h1 span { color:var(--primary-light); }
.admin-header p { color:var(--text-muted); margin-top:0.5rem; }

.stats-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px,1fr)); gap:1.5rem; margin-bottom:3rem; }
.stat-card {
    background:var(--surface); border:1px solid var(--border); border-radius:20px;
    padding:2rem; display:flex; align-items:center; gap:1.5rem; transition:all 0.3s;
}
.stat-card:hover { border-color:var(--primary-light); transform:translateY(-3px); }
.stat-icon-big { font-size:2.5rem; animation:float 3s ease-in-out infinite; }
.stat-info h2 { font-size:2.5rem; font-weight:800; color:var(--primary-light); }
.stat-info p  { color:var(--text-muted); font-size:0.9rem; }

.quick-actions h3 { font-size:1.3rem; font-weight:700; margin-bottom:1.5rem; }
.actions-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px,1fr)); gap:1rem; }
.action-card {
    background:var(--surface); border:1px solid var(--border); border-radius:20px;
    padding:1.8rem; display:flex; flex-direction:column; gap:0.5rem;
    transition:all 0.3s; cursor:pointer;
}
.action-card:hover { border-color:var(--primary-light); transform:translateY(-4px); background:var(--surface-light); }
.action-card span  { font-size:2rem; }
.action-card strong { font-size:1rem; color:var(--text); }
.action-card small  { color:var(--text-muted); font-size:0.82rem; }
.highlight-action { border-color:rgba(99,102,241,0.4); background:rgba(99,102,241,0.05); }

.admin-page { padding:8rem 0 4rem; }
.page-header { display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:2.5rem; flex-wrap:wrap; gap:1rem; }
.page-header h2 { font-size:2rem; font-weight:800; }
.page-header h2 span { color:var(--primary-light); }

.form-card { background:var(--surface); border:1px solid var(--border); border-radius:24px; padding:2.5rem; }

/* ========== TABLES ========== */
.table-wrapper { background:var(--surface); border:1px solid var(--border); border-radius:24px; overflow:hidden; }
table { width:100%; border-collapse:collapse; }
th { text-align:right; padding:1.2rem 1.5rem; background:var(--surface-light); color:var(--text-muted); font-weight:700; font-size:0.9rem; }
td { padding:1.2rem 1.5rem; border-top:1px solid var(--border); font-size:0.95rem; }
tr:hover td { background:rgba(255,255,255,0.02); }

.badge-cat {
    display:inline-block; background:rgba(99,102,241,0.12); color:var(--primary-light);
    border:1px solid rgba(99,102,241,0.2); border-radius:999px;
    padding:0.2rem 0.8rem; font-size:0.8rem; font-weight:600;
}

/* ========== ALERTS ========== */
.alert-error {
    background:rgba(239,68,68,0.1); border:1px solid rgba(239,68,68,0.3);
    color:#f87171; padding:1rem 1.5rem; border-radius:12px; margin-bottom:1.5rem;
}

/* ========== FOOTER ========== */
footer {
    padding:3rem 0; border-top:1px solid var(--border); text-align:center; color:var(--text-muted);
}
.footer-brand { display:flex; align-items:center; justify-content:center; gap:0.5rem; margin-bottom:0.8rem; font-size:1.1rem; }
.footer-tech { font-size:0.8rem; margin-top:0.5rem; }
.footer-tech strong { color:var(--primary-light); }
