@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;800&display=swap');

:root {
    --primary-color: #2ecc71; 
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Cairo', sans-serif; background: var(--bg-gradient); color: var(--text-main); min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.flex { display: flex; align-items: center; justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }

/* Glassmorphism */
.glass-panel { background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: var(--glass-border); border-radius: 16px; box-shadow: var(--glass-shadow); }
.glass-input { width: 100%; padding: 12px 15px; margin-bottom: 15px; background: rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.8); border-radius: 10px; font-family: 'Cairo'; outline: none; transition: 0.3s; }
.glass-input:focus { background: rgba(255,255,255,0.9); box-shadow: 0 0 10px rgba(0,0,0, 0.1); border-color: var(--primary-color); }
.btn-primary { background: var(--primary-color); color: white; border: none; padding: 10px 20px; border-radius: 10px; cursor: pointer; font-family: 'Cairo'; font-weight: bold; transition: 0.3s; display: inline-block; text-align: center; width: 100%;}
.btn-primary:hover { filter: brightness(0.85); transform: translateY(-2px); }

/* Navbar */
header { padding: 20px 0; position: relative; z-index: 9999; }
.navbar { padding: 15px 30px; position: relative; z-index: 9999; }
.logo-container { display: flex; align-items: center; gap: 15px; }
.logo-img { height: 45px; border-radius: 8px; object-fit: contain; }
.logo a { font-size: 1.5rem; font-weight: 800; color: var(--primary-color); line-height: 1.2;}
.menu-icon { font-size: 1.8rem; color: var(--primary-color); cursor: pointer; }

/* Menu */
.nav-menu { position: absolute; top: 80px; left: 30px; background: white; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); width: 200px; padding: 10px 0; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: 0.3s ease; z-index: 1000; }
.nav-menu.active { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu a { display: block; padding: 10px 20px; color: var(--text-main); font-weight: bold; transition: 0.3s; }
.nav-menu a:hover { background: #f4f6f9; color: var(--primary-color); }

/* Language Dropdown */
.lang-dropdown { position: relative; display: inline-block; }
.lang-btn { background: rgba(255,255,255,0.8); color: var(--primary-color); border: 2px solid var(--primary-color); padding: 5px 12px; border-radius: 20px; font-weight: 800; font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: 0.3s; user-select: none; }
.lang-btn:hover { background: var(--primary-color); color: white; }
.lang-menu { position: absolute; top: 130%; left: 50%; transform: translateX(-50%); background: white; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); overflow: hidden; opacity: 0; visibility: hidden; transition: 0.3s; min-width: 110px; z-index: 10000; display: flex; flex-direction: column; }
.lang-dropdown:hover .lang-menu { opacity: 1; visibility: visible; top: 115%; }
/* الكلاس الجديد الذي يتم تفعيله بالضغط (الهواتف) */
.lang-menu.show { opacity: 1; visibility: visible; top: 115%; }
.lang-menu a { padding: 10px; text-align: center; color: var(--text-main); font-weight: bold; font-size: 0.9rem; border-bottom: 1px solid #eee; transition: 0.3s; }
.lang-menu a:last-child { border-bottom: none; }
.lang-menu a:hover { background: #f4f6f9; color: var(--primary-color); }

/* Image Slider */
.hero-slider-wrapper { position: relative; width: 100%; max-width: 1200px; margin: 0 auto 30px auto; border-radius: 20px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.1); z-index: 1; }
.slider-container { display: flex; transition: transform 0.5s ease-in-out; height: 400px; }
.slide { min-width: 100%; height: 100%; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.3); backdrop-filter: blur(5px); color: white; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; transition: 0.3s; z-index: 10; display: flex; align-items: center; justify-content: center; }
.slider-btn:hover { background: rgba(255,255,255,0.6); color: var(--primary-color); }
.slider-btn.prev { left: 15px; }
.slider-btn.next { right: 15px; }
.slider-dots { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 10; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; transition: 0.3s; }
.dot.active { background: white; transform: scale(1.2); }

/* Offer Cards */
.offer-card { padding: 15px; transition: 0.3s; display: flex; flex-direction: column; text-align: center; }
.offer-card:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(31, 38, 135, 0.15); }
.offer-img-link { display: block; overflow: hidden; border-radius: 12px; margin-bottom: 15px; }
.offer-img { aspect-ratio: 4 / 3; height: 200px; background-size: cover; background-position: center; transition: transform 0.4s ease; }
.offer-img-link:hover .offer-img { transform: scale(1.08); } 
.offer-card h2 { font-size: 1.2rem; margin-bottom: 10px; color: var(--text-main); }
.offer-price { color: var(--primary-color); font-weight: bold; font-size: 1.1rem; margin-bottom: 15px; }
.offer-card .btn-primary { margin-top: auto; }

/* Filter Tags */
.filter-tags { display: flex; justify-content: center; gap: 10px; margin-bottom: 40px; flex-wrap: wrap; }
.filter-tag { padding: 8px 20px; background: rgba(255,255,255,0.6); border: 1px solid var(--primary-color); color: var(--text-main); border-radius: 20px; font-weight: bold; transition: 0.3s; }
.filter-tag:hover, .filter-tag.active { background: var(--primary-color); color: white; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

/* Footer */
.footer-section { background: var(--glass-bg); backdrop-filter: blur(10px); border-top: var(--glass-border); padding: 15px 0; margin-top: auto; box-shadow: 0 -5px 20px rgba(0,0,0,0.02); }
.footer-compact-flex { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 25px; text-align: center; }
.footer-item { color: var(--text-main); font-size: 0.95rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: bold; }
.footer-item i { color: var(--primary-color); font-size: 1rem; }
.footer-separator { margin: 0 5px; color: #ccc; font-weight: normal; }

/* Admin Global Classes */
.admin-body { display: flex; background: #f4f6f9; margin: 0; min-height: 100vh; flex-direction: row;}
.sidebar { width: 260px; background: white; height: 100vh; padding: 25px 20px; box-shadow: -2px 0 10px rgba(0,0,0,0.05); position: fixed; right: 0; overflow-y: auto; z-index: 100;}
.sidebar h2 { color: #2c3e50; margin-bottom: 30px; font-size: 1.8rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 8px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 15px; text-decoration: none; border-radius: 12px; transition: 0.3s; color: #7f8c8d; font-weight: 600; }
.sidebar-nav a i { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-nav a:hover { background: #f4f6f9; color: var(--primary-color); transform: translateX(-5px); }
.sidebar-nav a.active { color: white; background: var(--primary-color); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.archive-link { position: relative; margin-right: 20px; font-size: 0.9em !important; padding: 8px 15px !important; border-right: 2px solid var(--primary-color); border-radius: 0 0 0 12px !important; background: rgba(0,0,0,0.02); }
.archive-link.active { border: none; margin: 0; border-radius: 12px !important; }
.logout-link { color: #e74c3c !important; margin-top: 20px !important; }
.logout-link:hover { background: rgba(231, 76, 60, 0.1) !important; transform: translateX(-5px); }

.main-content { margin-right: 260px; padding: 40px; width: calc(100% - 260px); }
.grid-form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }

.flex-filters { display: flex; gap: 20px; }
.flex-filters > div { flex: 1; width: 100%; }
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
.table-responsive table { width: 100%; min-width: 700px; border-collapse: collapse; }

/* 📱 Mobile Responsiveness */
@media (max-width: 768px) {
    .container { padding: 0 10px; }
    .grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    .contact-grid { grid-template-columns: 1fr !important; gap: 15px; }
    .grid-2-1, .grid-form { grid-template-columns: 1fr !important; }
    .flex { flex-direction: column; gap: 15px; text-align: center; }
    h1 { font-size: 1.6rem !important; }
    
    .offer-card { padding: 10px; }
    .offer-img-link { margin-bottom: 10px; }
    .offer-img { aspect-ratio: 3 / 4; height: auto; } 
    .offer-card h2 { font-size: 1rem !important; margin-bottom: 5px; }
    .offer-price { font-size: 0.9rem !important; margin-bottom: 10px; }
    .btn-primary { padding: 8px 5px; font-size: 0.8rem; }

    /* 💡 التعديلات الجديدة لشريط التنقل (Navbar) في الهواتف */
    .navbar { flex-direction: row; padding: 10px 15px; justify-content: space-between; align-items: center; }
    .logo-container { gap: 8px; }
    .logo-img { height: 35px; }
    .logo a { font-size: 1.1rem; line-height: 1.2; }
    .lang-btn { padding: 4px 8px; font-size: 0.8rem; }
    .nav-menu { left: 15px; top: 70px; z-index: 10000; }
    
    .slider-container { height: 200px; }
    .hero-slider-wrapper { border-radius: 12px; margin-bottom: 20px; }
    
    .footer-section { padding: 12px 0; }
    .footer-compact-flex { flex-direction: column; gap: 6px; }
    .footer-item { font-size: 0.8rem; flex-wrap: wrap; }
    .footer-item i { font-size: 0.85rem; }
    
    .admin-body { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 1000; padding: 15px 10px 10px 10px; border-radius: 0 0 20px 20px; box-shadow: 0 5px 20px rgba(0,0,0,0.06); margin-bottom: 15px; }
    .sidebar h2 { text-align: start; margin-bottom: 12px; font-size: 1.4rem; padding: 0 10px; }
    .sidebar-nav { display: flex; flex-direction: row; overflow-x: auto; white-space: nowrap; gap: 10px; padding-bottom: 5px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .sidebar-nav::-webkit-scrollbar { display: none; }
    .sidebar-nav a { flex: 0 0 auto; padding: 8px 18px; font-size: 0.9rem; border-radius: 20px; transform: none !important; border: 1px solid #e0e0e0; background: white; color: var(--text-main); }
    .sidebar-nav a i { display: none; }
    .sidebar-nav a.active { border: none; background: var(--primary-color); color: white; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
    .archive-link { margin: 0; border: 1px solid #e0e0e0; border-radius: 20px !important; font-size: 0.9rem !important; padding: 8px 18px !important; background: white; }
    .logout-link { margin-top: 0 !important; border-color: #fbdada !important; color: #e74c3c !important; }

    .main-content { margin-right: 0; width: 100%; padding: 10px 15px; }
    .flex-filters { flex-direction: column; gap: 10px; }
    .stat-card-container { grid-template-columns: 1fr !important; }
}