/* --- Reset & Variables --- */
:root {
    --primary-color: #FFD700;
    --hover-color: #ffae00;
    --primary-dark: #B8860B;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --text-light: #f8fafc;
    --text-dim: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --font-family: 'Tajawal', sans-serif;

    /* Gradients */
    --bg-gradient-dark: linear-gradient(210deg, #020617 0%, #00195f 50%, #715206 100%);

    --bg-gradient-light: linear-gradient(135deg, #ffffff 0%, #fff7d1 100%);
}

body.light-mode {
    --bg-dark: #f8fafc;
    --bg-darker: #fffbeb;
    --text-light: #0f172a;
    --text-dim: #475569;
    --glass-bg: rgba(0, 0, 0, 0.05);
    /* Darker glass for light bg */
    --glass-border: 1px solid rgba(0, 0, 0, 0.1);

    /* Light Mode Overrides */
    --primary-color: #d4af37;
    /* Darker Gold for better contrast on light bg */
    background: var(--bg-gradient-light);
}

body.light-mode .text-gradient {
    background: linear-gradient(to right, #0f172a, var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-mode .section-title::after {
    background: var(--primary-color);
}

body.light-mode .main-header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-mode .contact-form {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

body.light-mode .contact-details {
    background: rgba(255, 215, 0, 0.15);
    /* Slightly stronger gold tint */
}

body.light-mode .input-group input,
body.light-mode .input-group textarea {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}

body.light-mode .input-group input:hover,
body.light-mode .input-group textarea:hover {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

body.light-mode .input-group input:focus,
body.light-mode .input-group textarea:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
}

body.light-mode .main-footer {
    background: #f8fafc;
    /* Light background for footer */
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-dim);
}

body.light-mode .socials a {
    color: var(--text-dim);
}

body.light-mode .socials a:hover {
    color: var(--primary-color);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    background: var(--bg-gradient-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background 0.5s ease, color 0.5s ease;
}

input,
button,
textarea {
    font-family: inherit;
}

/* --- Layout --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.bi-section {
    padding: 80px 0;
    position: relative;
}

.center-text {
    text-align: center;
}

.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* --- Typography --- */
h1,
h2,
h3 {
    margin-bottom: 1rem;
    line-height: 1.2;
}

.text-gradient {
    color: var(--primary-color);
    background: linear-gradient(to right, #fff, var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 50%;
    height: 3px;
    background: var(--primary-color);
    margin: 10px auto 0;
}

/* --- Header & Nav --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    padding: 1rem 0;
    border-bottom: var(--glass-border);
    transition: background 0.5s ease, border-color 0.5s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--hover-color);
}

.nav-link.active {
    color: var(--primary-color);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    margin-right: 15px;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.light-mode .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* --- Hero Section --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 100px;
    /* Offset for fixed header */
}

.hero-badge {
    background: rgba(255, 215, 0, 0.1);
    color: var(--primary-color);
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 20px;
    font-weight: bold;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Light Mode Secondary Button */
body.light-mode .btn-secondary {
    border-color: rgba(0, 0, 0, 0.2);
    color: var(--text-light);
}

body.light-mode .btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.05);
}

.hero-title {
    font-size: 4rem;
    /* Increased size */
    margin-bottom: 20px;
    letter-spacing: -1px;
}

/* Enhanced Light Mode Title Gradient */
body.light-mode .hero-title .text-gradient {
    background: linear-gradient(135deg, #1e293b 0%, #ca8a04 50%, #854d0e 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-description {
    max-width: 600px;
    margin-bottom: 40px;
    color: var(--text-dim);
    font-size: 1.2rem;
}

.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: #000;
}

.btn-primary:hover {
    background: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* --- Cards & Grid --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.glass-card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(5px);
    padding: 30px;
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease, background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
    position: relative;
    overflow: hidden;
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

/* Cracked Effect - Verified Visibility */
.cracked-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, 0.4) 50%, transparent 52%),
        linear-gradient(-45deg, transparent 45%, rgba(255, 255, 255, 0.2) 50%, transparent 55%);
    background-size: 200% 200%;
    opacity: 0.8;
    pointer-events: none;
    transition: opacity 0.5s;
    z-index: 1;
}

.cracked-effect:hover::before {
    opacity: 0;
    /* Heal on hover */
}

.cracked-effect:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

/* --- Gallery --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.gallery-item {
    height: 300px;
    background: #334155;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-radius: 40px 15px 40px 15px;
}

/* Light Mode Gallery Item */
body.light-mode .gallery-item {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

body.light-mode .gallery-item:hover {
    box-shadow: 0 10px 20px rgba(184, 134, 11, 0.15);
    /* Gold shadow on light */
    border-color: var(--primary-color);
    border-radius: 15px 40px 15px 40px;
}

.gallery-item .overlay {
    position: absolute;
    bottom: -100%;
    /* Hidden initially or partial */
    left: 0;
    width: 100%;
    padding: 20px;
    padding-top: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.6));
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
}

/* Show details on hover */
.gallery-item:hover .overlay {
    bottom: 0;
}

/* Always show a hint of the title or make it fully visible? 
   Let's keep it visible at bottom but expand on hover for better UX */
.gallery-item .overlay {
    bottom: 0;
    transform: translateY(50%);
    /* Show title only */
    transition: transform 0.4s ease;
}

.gallery-item:hover .overlay {
    transform: translateY(0);
    padding-top: 20px;
}

.gallery-item h3 {
    margin-bottom: 5px;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.gallery-item p {
    color: #cbd5e1;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease 0.1s;
}

.gallery-item:hover p {
    opacity: 1;
    transform: translateY(0);
}

/* --- Contact Form --- */
.contact-box {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    overflow: hidden;
}

.contact-details {
    padding: 40px;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 0 30px 30px 0;
}

.contact-row {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    gap: 15px;
    color: var(--text-dim);
}

.contact-row a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-row a:hover {
    color: var(--hover-color);
}

.contact-row i {
    color: var(--primary-color);
}

.contact-form {
    padding: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 30px 0 0 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    resize: none;
    transition: ease-in-out 0.3s;
}

.input-group input:hover,
.input-group textarea:hover {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.1);
}

.map-container {
    margin-top: 20px;
    width: 100%;
    height: 200px;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: ease-in-out 0.3s;
}

.map-container:hover {
    transform: scale(1.02);
    border-color: var(--hover-color);
    box-shadow: 0 0 10px rgba(255, 196, 0, 0.726);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.full-width {
    width: 100%;
}

/* --- Footer --- */
.main-footer {
    padding: 40px 0;
    background: #020617;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 50px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.socials {
    display: flex;
    gap: 20px;
    font-size: 1.2rem;
}

.socials a {
    color: var(--text-light);
}

.socials a:hover {
    color: var(--primary-color);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-list {
        position: fixed;
        top: 60px;
        right: 0;
        width: 100%;
        height: 0;
        overflow: hidden;
        background: rgba(15, 23, 42, 0.95);
        flex-direction: column;
        align-items: center;
        gap: 0;
        transition: height 0.3s ease, background 0.5s ease;
    }

    .nav-list.active {
        height: 300px;
        padding: 20px 0;
    }

    .nav-list li {
        width: 100%;
        text-align: center;
    }

    /* Light Mode Mobile Menu Fix - reduced protrusion/shadow */
    body.light-mode .nav-list {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
        /* Softer shadow */
    }


    .nav-link {
        display: block;
        padding: 15px;
    }

    .mobile-toggle {
        display: block;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .contact-box {
        grid-template-columns: 1fr;
    }

    .split-layout {
        display: flex;
        flex-direction: column;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
        display: block;
        /* Ensure block for text-align to work if needed */
        text-align: center;
        width: 100%;
    }

    .contact-details,
    .contact-form {
        padding: 30px 20px;
    }

    .contact-details {
        border-radius: 20px 20px 0 0;
    }

    .contact-form {
        border-radius: 0 0 20px 20px;
    }
}

@media (max-width: 500px) {
    .footer-inner {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    .socials {
        justify-content: center;
        width: 100%;
    }
}