/* ===== PYRAMID ENGINEERING OFFICE — Brand CSS ===== */
:root {
    --navy:         #1E2B6E;
    --navy-dark:    #141D50;
    --navy-light:   #2B3A9E;
    --silver:       #8A96B0;
    --silver-light: #C8CDD8;
    --bg:           #F4F6FA;
    --white:        #FFFFFF;
    --dark:         #1A1C2A;
    --muted:        #6B7280;
    --border:       #DDE1EC;
}

*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Cairo', sans-serif; color: var(--dark); background: var(--white); margin: 0; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-light); }
img { max-width: 100%; }

/* ===== NAVBAR ===== */
.navbar {
    background: var(--white);
    border-bottom: 3px solid var(--navy);
    box-shadow: 0 2px 16px rgba(30,43,110,.08);
    position: sticky; top: 0; z-index: 1000;
    padding: 0 0;
}
.navbar .container {
    display: flex; align-items: center;
    justify-content: space-between;
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    height: 80px;
}
.navbar-brand img { height: 70px; }
.nav-links { display: flex; align-items: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
    padding: 8px 16px; border-radius: 6px;
    font-weight: 600; color: var(--dark);
    transition: background .2s, color .2s;
    font-size: .95rem;
}
.nav-links a:hover, .nav-links a.active { background: var(--bg); color: var(--navy); }

.nav-right { display: flex; align-items: center; gap: 10px; }
.lang-btn {
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 20px; padding: 4px 14px;
    font-weight: 700; font-size: .85rem; cursor: pointer;
    color: var(--navy); transition: background .2s;
}
.lang-btn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 4px; }
.nav-toggle span { display: block; width: 24px; height: 2.5px; background: var(--navy); border-radius: 2px; }

/* Mobile menu */
.mobile-menu {
    display: none; position: fixed; inset: 0; background: rgba(20,29,80,.55);
    z-index: 2000; align-items: flex-start; justify-content: flex-end;
}
.mobile-menu.open { display: flex; }
.mobile-menu-inner {
    background: var(--white); width: 280px; height: 100%;
    padding: 24px 20px; overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0,0,0,.15);
}
.mobile-menu-inner ul { list-style: none; padding: 0; margin: 20px 0 0; }
.mobile-menu-inner ul li + li { margin-top: 4px; }
.mobile-menu-inner ul a {
    display: block; padding: 12px 16px; border-radius: 8px;
    font-weight: 600; color: var(--dark);
    transition: background .2s, color .2s;
}
.mobile-menu-inner ul a:hover { background: var(--bg); color: var(--navy); }
.menu-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--navy); float: right; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 24px; border-radius: 8px;
    font-weight: 700; font-size: .9rem; cursor: pointer;
    border: 2px solid transparent; transition: .2s;
}
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-white { background: #fff; color: var(--navy); border-color: #fff; }
.btn-white:hover { background: var(--bg); }
.btn-sm { padding: 6px 16px; font-size: .82rem; }
.btn-danger { background: #dc3545; color: #fff; border-color: #dc3545; }
.btn-danger:hover { background: #b02a37; }

/* ===== PAGE BANNER ===== */
.page-banner {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
    color: #fff; padding: 56px 0 48px; position: relative; overflow: hidden;
}
.page-banner::before {
    content: ''; position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 32px 32px;
}
.page-banner .container { position: relative; }
.page-banner h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin-bottom: 8px; }
.breadcrumb { display: flex; gap: 6px; align-items: center; font-size: .85rem; color: rgba(255,255,255,.65); }
.breadcrumb a { color: rgba(255,255,255,.65); }
.breadcrumb a:hover { color: #fff; }

/* ===== SECTION ===== */
.section { padding: 72px 0; }
.section-alt { background: var(--bg); }
.section-heading { text-align: center; margin-bottom: 48px; }
.section-heading h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; color: var(--dark); margin-bottom: 10px; }
.section-heading p { color: var(--muted); font-size: .95rem; }
.divider {
    display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px;
}
.divider span { display: block; width: 56px; height: 2px; background: var(--silver-light); border-radius: 1px; }
.divider-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--navy); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}

/* ===== CONTAINER ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== HERO (Home) ===== */
.hero {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
    color: #fff; padding: 100px 0; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 40px 40px;
}
.hero-content { position: relative; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; margin-bottom: 16px; }
.hero p { font-size: 1.15rem; color: rgba(255,255,255,.8); max-width: 600px; margin: 0 auto 32px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== CARD ===== */
.card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden;
    transition: box-shadow .3s, transform .3s, border-color .3s;
}
.card:hover { box-shadow: 0 8px 28px rgba(30,43,110,.12); transform: translateY(-4px); border-color: var(--navy); }
.card-img { height: 200px; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.card-img img { max-height: 170px; max-width: 90%; object-fit: contain; }
.card-body { padding: 18px; }
.card-title { font-weight: 700; font-size: .95rem; margin-bottom: 6px; color: var(--dark); }
.card-text { font-size: .85rem; color: var(--muted); line-height: 1.6;
             display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== GRID ===== */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 991px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ===== PROJECT CARD ===== */
.project-card {
    position: relative; border-radius: 14px; overflow: hidden;
    min-height: 260px; display: flex; align-items: flex-end;
    box-shadow: 0 4px 20px rgba(30,43,110,.12);
    transition: transform .3s, box-shadow .3s;
}
.project-card:hover { transform: translateY(-5px); box-shadow: 0 12px 32px rgba(30,43,110,.22); }
.project-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.project-card:hover img { transform: scale(1.06); }
.project-overlay { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(20,29,80,.85) 0%, transparent 60%); }
.project-body { position: relative; z-index: 2; padding: 20px; color: #fff; }
.project-tag {
    display: inline-block; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
    padding: 2px 10px; border-radius: 12px; font-size: .72rem; font-weight: 700;
    text-transform: uppercase; margin-bottom: 6px;
}
.project-name { font-size: 1rem; font-weight: 700; margin: 0; }

/* ===== CONTACT FORM ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 32px; }
@media (max-width: 768px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info { background: linear-gradient(160deg, var(--navy-dark), var(--navy)); color: #fff; border-radius: 16px; padding: 36px; }
.contact-info h3 { font-weight: 800; margin-bottom: 28px; }
.info-item { display: flex; gap: 14px; margin-bottom: 20px; }
.info-icon { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.info-label { font-size: .78rem; color: rgba(255,255,255,.6); margin-bottom: 2px; }
.info-value { font-size: .92rem; }
.contact-form-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 36px; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; font-size: .87rem; margin-bottom: 6px; color: var(--dark); }
.form-control {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
    border-radius: 8px; font-size: .9rem; font-family: inherit;
    transition: border-color .2s, box-shadow .2s; outline: none;
}
.form-control:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30,43,110,.12); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 576px) { .form-row { grid-template-columns: 1fr; } }
.alert { padding: 12px 18px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ===== STATS ===== */
.stats-bar {
    background: linear-gradient(135deg, var(--navy-dark), var(--navy));
    color: #fff; padding: 56px 0;
}
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; }
@media (max-width: 767px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }
.stat-box { text-align: center; padding: 20px; border-right: 1px solid rgba(255,255,255,.12); }
.stat-box:last-child { border-right: none; }
.stat-num { font-size: clamp(2rem,4vw,3rem); font-weight: 900; line-height: 1; }
.stat-suf { font-size: 1.3rem; font-weight: 700; opacity: .8; }
.stat-lbl { font-size: .88rem; color: rgba(255,255,255,.7); margin-top: 6px; }

/* ===== FOOTER ===== */
footer {
    background: linear-gradient(160deg, var(--navy-dark), var(--navy));
    color: #fff; padding: 56px 0 0;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { color: rgba(255,255,255,.7); font-size: .9rem; line-height: 1.8; margin: 12px 0 20px; }
.footer-title { font-size: .75rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--silver-light); margin-bottom: 16px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li + li { margin-top: 8px; }
.footer-links a { color: rgba(255,255,255,.7); transition: color .2s, padding-left .2s; display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.footer-links a:hover { color: #fff; padding-left: 4px; }
.footer-contact-item { display: flex; gap: 10px; margin-bottom: 12px; color: rgba(255,255,255,.75); font-size: .88rem; }
.footer-contact-item i { color: var(--silver-light); flex-shrink: 0; margin-top: 3px; }
.social-links { display: flex; gap: 8px; margin-top: 16px; }
.social-link {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 14px; transition: background .2s, transform .2s;
}
.social-link:hover { background: rgba(255,255,255,.25); transform: translateY(-2px); color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 16px 0; text-align: center;
    font-size: .82rem; color: rgba(255,255,255,.45);
}

/* ===== WA BUBBLE ===== */
.wa-bubble {
    position: fixed; bottom: 28px; right: 28px;
    width: 52px; height: 52px; border-radius: 50%;
    background: #25D366; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; box-shadow: 0 4px 16px rgba(37,211,102,.4);
    z-index: 1050; transition: transform .25s, box-shadow .25s;
}
.wa-bubble:hover { transform: scale(1.1); box-shadow: 0 6px 22px rgba(37,211,102,.55); color: #fff; }

/* ===== ADMIN LAYOUT ===== */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 250px; flex-shrink: 0;
    background: var(--navy-dark);
    color: #fff; display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
    overflow-y: auto;
}
.sidebar-brand { padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand img { height: 48px; filter: brightness(0) invert(1); }
.sidebar-brand p { margin: 6px 0 0; font-size: .75rem; color: rgba(255,255,255,.55); }
.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-section { font-size: .68rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.35); padding: 12px 20px 4px; }
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; color: rgba(255,255,255,.7);
    font-size: .88rem; font-weight: 600; transition: background .2s, color .2s;
}
.sidebar-link:hover, .sidebar-link.active { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active { border-left: 3px solid var(--silver-light); }
.admin-main { margin-left: 250px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.admin-topbar {
    background: var(--white); border-bottom: 1px solid var(--border);
    padding: 0 24px; height: 64px; display: flex; align-items: center;
    justify-content: space-between; position: sticky; top: 0; z-index: 90;
    box-shadow: 0 1px 8px rgba(30,43,110,.06);
}
.admin-topbar h1 { font-size: 1.1rem; font-weight: 700; color: var(--dark); margin: 0; }
.admin-content { padding: 28px 24px; flex: 1; }

/* Admin table */
.table-card { background: #fff; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.table-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.table-head h2 { font-size: 1rem; font-weight: 700; margin: 0; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--bg); padding: 12px 16px; text-align: left; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
td { padding: 12px 16px; border-top: 1px solid var(--border); font-size: .88rem; vertical-align: middle; }
tr:hover td { background: var(--bg); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-primary { background: rgba(30,43,110,.1); color: var(--navy); }

/* Admin form */
.form-card { background: #fff; border-radius: 12px; border: 1px solid var(--border); padding: 28px; max-width: 800px; }

/* Stat cards */
.stat-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; margin-bottom: 28px; }
@media (max-width: 900px) { .stat-cards { grid-template-columns: repeat(2,1fr); } }
.stat-card {
    background: #fff; border-radius: 12px; border: 1px solid var(--border);
    padding: 22px 20px; display: flex; align-items: center; gap: 16px;
}
.stat-card-icon {
    width: 50px; height: 50px; border-radius: 12px;
    background: rgba(30,43,110,.08); color: var(--navy);
    display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.stat-card-num { font-size: 1.8rem; font-weight: 900; line-height: 1; color: var(--dark); }
.stat-card-lbl { font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; }
.pagination a, .pagination span {
    padding: 7px 14px; border-radius: 8px; font-size: .85rem;
    border: 1.5px solid var(--border); color: var(--dark);
    transition: background .2s, border-color .2s;
}
.pagination a:hover { background: var(--bg); border-color: var(--navy); color: var(--navy); }
.pagination .active span { background: var(--navy); color: #fff; border-color: var(--navy); }

/* RTL support */
[dir="rtl"] .sidebar-link.active { border-left: none; border-right: 3px solid var(--silver-light); }
[dir="rtl"] th { text-align: right; }
[dir="rtl"] .footer-links a:hover { padding-left: 0; padding-right: 4px; }
[dir="rtl"] .wa-bubble { right: auto; left: 28px; }

/* Responsive nav */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
    .admin-sidebar { transform: translateX(-100%); transition: transform .3s; }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
}

/* Utility */
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:32px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.text-muted{color:var(--muted)}.text-center{text-align:center}.text-navy{color:var(--navy)}
.fw-bold{font-weight:700}.fw-900{font-weight:900}
.d-flex{display:flex}.align-center{align-items:center}.gap-2{gap:16px}.gap-1{gap:8px}
.justify-between{justify-content:space-between}
.w-full{width:100%}
