/*
Theme Name: دليل البريد المصري - النسخة الاحترافية
Theme URI: https://ais-dev-r2y5dhyqxdqbpyasf7xyxh-734912167575.europe-west2.run.app
Author: AIS Agent
Author URI: https://ai.studio/build
Description: دليل شامل ومفصل لجميع مكاتب البريد المصري مع ميزات البحث المتقدم، الفلترة حسب المحافظة، وتحديد المواقع القريبة باستخدام نظام تحديد المواقع العالمي (GPS).
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: egypt-post-guide
*/

:root {
    --primary: #1d4ed8;
    --primary-dark: #1e3a8a;
    --secondary: #60a5fa;
    --accent: #facc15;
    --bg: #f8fafc;
    --text: #0f172a;
    --text-light: #64748b;
    --white: #ffffff;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    background: var(--primary);
    color: white;
    padding: 0.6rem;
    border-radius: 1rem;
    display: flex;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-dark);
    line-height: 1;
}

.logo-text p {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links { display: none; gap: 2.5rem; }
@media (min-width: 1024px) { .nav-links { display: flex; } }

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.nav-links a:hover { color: var(--primary); transform: translateY(-2px); }

.btn-nearby {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--white);
    border: 2px solid #e2e8f0;
    padding: 0.6rem 1.2rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-light);
}

.btn-nearby.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2);
}

/* Hero */
.hero {
    background: var(--primary-dark);
    padding: 6rem 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://www.transparenttextures.com/patterns/cubes.png');
    opacity: 0.1;
}

.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }

.hero h2 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 2rem;
    line-height: 1.1;
}

.hero h2 span { color: var(--secondary); }

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 1.5rem 4rem 1.5rem 1.5rem;
    border-radius: 3rem;
    border: none;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    outline: none;
}

.search-box i {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.5rem;
}

/* Main Content */
.main-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 4rem 0;
}

@media (min-width: 1024px) {
    .main-layout { grid-template-columns: 300px 1fr; }
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 2rem; }

.filter-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #f1f5f9;
}

.filter-card h3 {
    font-size: 1.1rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-dark);
}

.gov-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.gov-btn {
    width: 100%;
    text-align: right;
    padding: 0.8rem 1rem;
    border: none;
    background: none;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 0.75rem;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.gov-btn:hover { background: #f8fafc; color: var(--text); }
.gov-btn.active { background: var(--primary); color: white; }

.services-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.service-tag {
    padding: 0.4rem 0.8rem;
    background: #f1f5f9;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    border: 2px solid transparent;
}
.service-tag.active {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
}

/* Results */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.results-header h3 { font-size: 1.5rem; font-weight: 900; }

.office-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.office-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.office-card:hover { transform: translateY(-5px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); border-color: var(--secondary); }

.office-card h4 {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.office-info { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.info-item { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; color: var(--text-light); font-weight: 600; }
.info-item i { color: var(--primary); width: 16px; }

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.postal-code { background: #f1f5f9; padding: 0.25rem 0.75rem; border-radius: 0.5rem; font-size: 0.75rem; font-weight: 900; }
.btn-details { color: var(--primary); font-weight: 900; font-size: 0.85rem; display: flex; align-items: center; gap: 0.25rem; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal {
    background: var(--white);
    width: 100%;
    max-width: 800px;
    border-radius: 3rem;
    overflow: hidden;
    position: relative;
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    background: var(--primary-dark);
    padding: 3rem;
    color: white;
    position: relative;
}

.btn-close {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
}

.modal-body { padding: 3rem; }

.modal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}
@media (min-width: 768px) { .modal-grid { grid-template-columns: 1fr 1fr; } }

.modal-info-group h5 {
    font-size: 0.7rem;
    font-weight: 900;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.modal-item { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.modal-item-icon { background: #eff6ff; padding: 0.75rem; border-radius: 1rem; color: var(--primary); }
.modal-item-text p:first-child { font-size: 0.7rem; font-weight: 800; color: var(--text-light); }
.modal-item-text p:last-child { font-size: 1.1rem; font-weight: 900; color: var(--text); }

.modal-services { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.modal-service-tag { background: #eff6ff; color: var(--primary); padding: 0.5rem 1rem; border-radius: 0.75rem; font-size: 0.8rem; font-weight: 800; }

.btn-map {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 1.2rem;
    border-radius: 1.5rem;
    border: none;
    font-weight: 900;
    font-size: 1.1rem;
    margin-top: 2rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(29, 78, 216, 0.2);
}

/* Footer */
footer { background: #020617; color: #94a3b8; padding: 6rem 0; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 4rem; }
.footer-logo h2 { color: white; font-weight: 900; margin-bottom: 1.5rem; }
.footer-links h4 { color: white; font-weight: 900; margin-bottom: 1.5rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.75rem; font-weight: 700; }

/* Loader */
#loader {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem;
    background: white;
    border-radius: 3rem;
    border: 4px dashed #f1f5f9;
}
