:root {
    --bg-color: #f6f8fa;
    --text-main: #24292f;
    --text-muted: #57606a;
    --accent-color: #0969da;
    --accent-hover: #0349b4;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.1);
    --danger-color: #d1242f;
    --success-color: #2da44e;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(88, 166, 255, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(63, 185, 80, 0.1), transparent 25%);
    background-attachment: fixed;
    padding-top: 80px; /* Space for fixed nav */
}

/* Loading State */
.overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--bg-color); z-index: 1000; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.overlay.active { opacity: 1; pointer-events: all; }
.spinner { width: 50px; height: 50px; border: 4px solid var(--glass-border); border-top-color: var(--accent-color); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Main Navigation */
.main-nav {
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 100;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
    border-left: none; border-right: none; border-top: none;
}
.logo h2 { font-size: 1.5rem; margin:0; background: linear-gradient(90deg, #58a6ff, #bc8cff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.logo span { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.nav-links { list-style: none; display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--text-main); text-decoration: none; font-weight: 600; transition: color 0.3s; }
.nav-links a:hover, .nav-links a.active { color: var(--accent-color); }
.mobile-toggle { display: none; font-size: 1.5rem; cursor: pointer; }

/* Global Container */
.app-container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

/* Sections */
.page-section, .hidden { display: none !important; }
.page-section.active { display: block !important; animation: fadeIn 0.6s ease forwards; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Glassmorphism */
.glass-nav { background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--glass-border); }
.glass-card { background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--glass-border); border-radius: 16px; padding: 2.5rem; box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05); }

/* Typography */
h1 { font-size: 3rem; font-weight: 800; letter-spacing: 2px; margin-bottom: 0.5rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.4rem; margin-bottom: 0.5rem; font-weight: 600; }
p { color: var(--text-muted); line-height: 1.6; }
.subtitle { font-size: 1.1rem; margin-bottom: 2rem; font-weight: 300; }
.full-center { max-width: 450px; margin: 0 auto; text-align: center; }

/* Hero Section */
.hero { 
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    animation: hero-crossfade 24s infinite alternate ease-in-out;
    height: 60vh; min-height: 400px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem; border-color: transparent;
}
@keyframes hero-crossfade {
    0%, 20% { background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.6)), url('Pics/img4.jpeg'); }
    30%, 50% { background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.6)), url('Pics/img5.jpeg'); }
    60%, 80% { background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.6)), url('Pics/pic10.jpeg'); }
    90%, 100% { background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.6)), url('Pics/Pic1.jpeg'); }
}
.hero h1 { color: #fff; background: none; -webkit-text-fill-color: initial; text-shadow: 0 4px 10px rgba(0,0,0,0.5); margin-bottom: 1rem; }
.hero p { color: #f0f0f0; text-shadow: 0 2px 6px rgba(0,0,0,0.5); font-size: 1.25rem; }

/* Standard Hero Banners */
.hero-banner {
    height: 300px;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.hero-overlay {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    text-align: center;
    padding: 1rem;
}

.hero-overlay h2 { margin-bottom: 0.5rem; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero-overlay p { color: #f0f0f0; font-size: 1.2rem; }

/* Buttons & Inputs */
.primary-btn, .secondary-btn, .icon-btn { 
    background: var(--accent-color); 
    color: #fff !important; 
    border: none; 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.3s ease; 
}
.primary-btn { padding: 12px 24px; width: 100%; font-size: 1rem; text-align: center; display: inline-block; text-decoration: none; }
.secondary-btn { padding: 12px 24px; }
.icon-btn { padding: 8px 16px; font-size: 0.9rem; }

.primary-btn:hover, .secondary-btn:hover, .icon-btn:hover, .admin-tab-btn.active { 
    background: var(--accent-hover) !important; 
    transform: translateY(-2px); 
    box-shadow: 0 4px 10px rgba(9, 105, 218, 0.2);
}

.btn-group { display: flex; gap: 1rem; margin-top: 1.5rem; }

/* Form Styles */
.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--text-main); }
input, select, textarea { width: 100%; padding: 12px; background: rgba(255, 255, 255, 0.5); border: 1px solid var(--glass-border); border-radius: 8px; color: var(--text-main); font-size: 1rem; transition: border-color 0.3s ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-color); }
.form-container { max-width: 600px; margin: 2rem auto; }

/* Dashboard specifics */
.dashboard-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem;}
.user-info { display: flex; align-items: center; gap: 1rem; }
.header-actions { display: flex; gap: 1rem; }
.badge { display: inline-block; background: rgba(88, 166, 255, 0.15); color: var(--accent-color); padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: 600; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; margin-top: 2rem; }
.action-card { cursor: pointer; transition: all 0.3s ease; text-align: center; padding: 2rem; }
.action-card:hover { transform: translateY(-5px); border-color: var(--accent-color); box-shadow: 0 8px 32px 0 rgba(88, 166, 255, 0.15); }
.card-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.news-card {
    position: relative;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}
.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
}
.news-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.5s ease;
}
.news-card:hover .news-card-image {
    transform: scale(1.05);
}
.news-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    z-index: 2;
    background: inherit;
}
.news-card h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    font-size: 1.4rem;
    font-weight: 700;
}
.news-card p {
    color: #4a4a4a;
    flex: 1;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.news-card small {
    display: block;
    color: #888;
    font-size: 0.85rem;
    font-weight: 500;
}
/* Admin Details */
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; animation: fadeIn 0.3s ease forwards; }
.table-responsive { overflow-x: auto; width: 100%; margin-top: 1rem; }
.glass-table { width: 100%; border-collapse: collapse; min-width: 600px; text-align: left; }
.glass-table th { background: rgba(0, 0, 0, 0.05); padding: 12px 16px; font-weight: 600; color: var(--accent-color); border-bottom: 2px solid var(--glass-border); }
.glass-table td { padding: 12px 16px; border-bottom: 1px solid rgba(0, 0, 0, 0.05); color: var(--text-main); font-size: 0.95rem; }
.glass-table tr:hover { background: rgba(0, 0, 0, 0.02); }
.table-card { padding: 1.5rem; }

/* Visitor Code styling */
.code-display { background: rgba(255,255,255,0.5); border: 1px dashed var(--accent-color); padding: 1rem; border-radius: 8px; margin: 1.5rem 0; display: flex; justify-content: space-between; align-items: center; font-size: 1.5rem; letter-spacing: 5px; color: var(--accent-color); font-weight: bold; }

/* Messages */
.error-msg { color: var(--danger-color); margin-top: 1rem; font-size: 0.9rem; }
.success-msg { color: var(--success-color); margin-top: 1rem; font-size: 0.9rem; }

/* Masonry Gallery Styles */
.gallery-section { padding: 3rem 2.5rem; }
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-auto-rows: 220px;
    grid-auto-flow: dense;
    gap: 1.5rem;
}

/* Feature classes for specific grid sizing */
.feature-large {
    grid-column: span 2;
    grid-row: span 2;
    box-shadow: 0 0 25px rgba(9, 105, 218, 0.4);
    animation: gentle-pulse 4s infinite alternate;
}

@keyframes gentle-pulse {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(9, 105, 218, 0.3); }
    100% { transform: scale(1.02); box-shadow: 0 0 35px rgba(188, 140, 255, 0.6); }
}

.feature-wide { grid-column: span 2; }
.feature-tall { grid-row: span 2; }

.grid-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    cursor: pointer;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.grid-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
    z-index: 10;
}

.grid-item:hover img {
    transform: scale(1.15);
}

.grid-item::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(9, 105, 218, 0.4) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.grid-item:hover::after {
    opacity: 1;
}

/* Modifier Classes for Diverse Layout */
.grid-item--large { grid-column: span 2; grid-row: span 2; }
.grid-item--wide { grid-column: span 2; }
.grid-item--tall { grid-row: span 2; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .nav-links {
        display: none; position: absolute; top: 100%; left: 0; width: 100%;
        flex-direction: column; background: var(--bg-color); padding: 1rem;
        border-top: 1px solid var(--glass-border);
    }
    .nav-links.show { display: flex; }
    .mobile-toggle { display: block; }
    .dashboard-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
    h1 { font-size: 2rem; }
    .app-container { padding: 1rem; }
}

/* ------------------------------------------- */
/* PREMIUM HOME PAGE ARCHITECTURE CSS           */
/* ------------------------------------------- */

.themed-section {
    padding: 5rem 2.5rem;
    position: relative;
    overflow: hidden;
    margin: 2rem 0;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.text-gradient {
    background: linear-gradient(90deg, #58a6ff, #bc8cff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Family Vibe Section */
.section-family {
    background: url('ExPics/img51.avif');
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.8);
}
.bento-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 250px 250px;
    gap: 1.5rem;
}
.bento-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    transition: transform 0.4s ease;
}
.bento-img:hover {
    transform: scale(1.02);
}
.bento-large { grid-row: span 2; }

/* Beach Section */
.section-beach {
    color: white;
    background: transparent;
}
.beach-parallax {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('Pics/Pic2.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 0;
}
.beach-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.1) 100%);
    z-index: 1;
}
.beach-content {
    position: relative;
    z-index: 2;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.2);
    max-width: 600px;
}
.beach-grid {
    display: flex; gap: 1rem; margin-top: 2rem;
}
.beach-grid img { width: 150px; height: 150px; object-fit: cover; border-radius: 12px; border: 2px solid white; transition: transform 0.3s ease;}
.beach-grid img:hover { transform: translateY(-5px); }

/* Kids Section */
.section-kids {
    background: url('ExPics/img52.webp');
    background-size: cover;
    background-position: center;
    color: #1a1a1a;
}
.kids-grid {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
    overflow-x: auto;
    padding-bottom: 2rem;
    scroll-snap-type: x mandatory;
}
.kids-card {
    min-width: 300px;
    background: rgba(255,255,255,0.8);
    border-radius: 24px;
    overflow: hidden;
    scroll-snap-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.kids-card:hover { transform: translateY(-10px) rotate(2deg); }
.kids-card img { width: 100%; height: 220px; object-fit: cover; }

/* Nights Section */
.section-nights {
    background-image: linear-gradient(rgba(15, 18, 27, 0.65), rgba(15, 18, 27, 0.65)), url('Pics/img2.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    border: 1px solid #2a2e3d;
}
.glowing-text {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(188, 140, 255, 0.8), 0 0 20px rgba(188, 140, 255, 0.6);
}

/* ------------------------------------------- */
/* RTL AND ARABIC LANGUAGE OVERRIDES            */
/* ------------------------------------------- */
[dir="rtl"] * {
    font-family: 'Cairo', 'Outfit', sans-serif;
}

[dir="rtl"] .form-group {
    text-align: right;
}

[dir="rtl"] .glass-table {
    text-align: right;
}

[dir="rtl"] .nav-links {
    padding-right: 0;
}

[dir="rtl"] .header-actions {
    margin-right: auto;
    margin-left: 0;
}

[dir="rtl"] #forgot-password-link {
    float: right !important;
}

[dir="rtl"] #show-register {
    float: left !important;
}

[dir="rtl"] .badge {
    margin-right: 0.5rem;
    margin-left: 0;
}
