@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

/* =========================================
   1. Root Variables
   ========================================= */
:root {
    /* Colors */
    --bg-dark: #0f1110;
    --bg-surface: #111313;
    --bg-glass: rgba(17, 19, 19, 0.65);
    
    --text-primary: #f9fafb;
    --text-secondary: #d6d6d6;
    
    --accent-soft-green: #7a8b7a;
    --accent-gold: #fbbf24;
    --accent-gold-glow: rgba(251, 191, 36, 0.3);
    
    --border-color: rgba(255, 255, 255, 0.08);

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;

    /* Fonts */
    --font-primary: 'Tajawal', sans-serif;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    /* Shadows & Effects */
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px var(--accent-gold-glow);
    --blur-md: blur(12px);

    /* Transitions */
    --trans-fast: 0.3s ease;
    --trans-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================
   2. Reset & Base Styles
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    direction: rtl;
    text-align: right;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--trans-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   3. Layout Utilities
   ========================================= */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: var(--space-xl) 0;
}

.grid {
    display: grid;
    gap: var(--space-md);
}

.flex {
    display: flex;
    align-items: center;
}

.flex-between {
    justify-content: space-between;
}

.flex-center {
    justify-content: center;
    align-items: center;
}

.text-center {
    text-align: center;
}

.section-header {
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
}
.section-subtitle.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   4. Header & Navigation
   ========================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: var(--space-md) 0;
    transition: var(--trans-smooth);
}

.header.scrolled {
    padding: var(--space-sm) 0;
    background: var(--bg-glass);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.logo span {
    color: var(--accent-gold);
}

.nav-links {
    display: flex;
    gap: var(--space-md);
}

.nav-links a {
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-gold);
    transition: var(--trans-fast);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
}

/* =========================================
   5. Buttons
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--trans-fast);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--bg-dark);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--accent-gold-glow);
    background: #fcd34d;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: var(--blur-md);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* =========================================
   6. Hero Section
   ========================================= */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1); /* for parallax/zoom out effect */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 17, 16, 0.4) 0%, rgba(15, 17, 16, 0.9) 100%);
    z-index: -1;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    z-index: 1;
    padding: 0 var(--space-md);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: var(--space-sm);
    line-height: 1.2;
    opacity: 0;
    transform: translateY(30px);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    opacity: 0;
    transform: translateY(30px);
}

.hero-btns {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    opacity: 0;
    transform: translateY(30px);
}

/* =========================================
   7. Cards & Services
   ========================================= */
.services-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: var(--trans-smooth);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-soft);
    border-color: var(--accent-soft-green);
}

.card-img-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--trans-smooth);
}

.card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

/* Light Sweep Effect */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: skewX(-25deg);
    transition: var(--trans-smooth);
    z-index: 2;
    pointer-events: none;
}

.card:hover::before {
    left: 200%;
}

.card-body {
    padding: var(--space-md);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: rgba(122, 139, 122, 0.1);
    color: var(--accent-soft-green);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* =========================================
   8. Portfolio / Projects
   ========================================= */
.portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.portfolio-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 300px;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--trans-smooth);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 17, 16, 0.9) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-md);
    opacity: 0;
    transition: var(--trans-smooth);
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.portfolio-cat {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* =========================================
   9. Features / Why Us
   ========================================= */
.features-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg) var(--space-md);
}

.feature-item {
    text-align: center;
}

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto var(--space-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--accent-gold);
    transition: var(--trans-fast);
}

.feature-item:hover .feature-icon {
    background: var(--accent-gold);
    color: var(--bg-dark);
    box-shadow: var(--shadow-glow);
}

/* =========================================
   10. Forms & Inputs
   ========================================= */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(17, 19, 19, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: calc(var(--space-xl) * 0.8) var(--space-lg);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--trans-fast);
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--trans-fast);
}

.form-control:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d6d6d6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 1.2em;
    padding-left: 2.5rem;
    cursor: pointer;
}

select.form-control option {
    background-color: var(--bg-dark);
    color: var(--text-primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

.btn-block {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.1rem;
    margin-top: var(--space-xs);
}

/* =========================================
   11. Inner Pages Header
   ========================================= */
.page-header {
    padding: calc(var(--space-xl) + 60px) 0 var(--space-xl) 0;
    background: linear-gradient(to bottom, var(--bg-surface) 0%, var(--bg-dark) 100%);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.page-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* =========================================
   12. Footer
   ========================================= */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: var(--space-xl) 0 var(--space-sm);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.footer-col h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.footer-col p {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--accent-gold);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =========================================
   13. Service Details Page
   ========================================= */
.service-detail-hero {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}
.service-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
}
.rich-text h2, .rich-text h3 {
    margin: var(--space-md) 0 var(--space-sm);
    color: var(--accent-gold);
}
.rich-text p {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}
.rich-text ul {
    list-style: disc;
    margin-right: var(--space-md);
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}
.sidebar-box {
    background: rgba(17, 19, 19, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
    position: sticky;
    top: 100px;
}

/* =========================================
   14. Animations (GSAP hooks)
   ========================================= */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
}

/* Mobile Menu Full Screen Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-dark);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.mobile-nav-overlay .nav-links {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
}
.mobile-nav-overlay .nav-links a {
    font-size: 2rem;
}

/* =========================================
   15. Responsive Design
   ========================================= */
@media (max-width: 1024px) {
    .hero-title { font-size: 2.8rem; }
    .service-content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .menu-toggle { display: block; }
    .header-btn { display: none; }
    
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1rem; }
    
    .footer-grid { grid-template-columns: 1fr; gap: var(--space-md); text-align: center; }
    
    .section { padding: var(--space-lg) 0; }
    .page-title { font-size: 2.2rem; }
    
    .contact-container { padding: var(--space-lg) var(--space-md); }
    .sidebar-box { padding: var(--space-lg) var(--space-md); }
}

@media (max-width: 480px) {
    .hero-btns { flex-direction: column; width: 100%; }
    .btn { width: 100%; }
}

/* =========================================
   16. Cookie Banner
   ========================================= */
.cookie-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: var(--space-md) 0;
    z-index: 9999;
    transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.cookie-banner.show {
    bottom: 0;
}

.cookie-banner-content {
    gap: var(--space-md);
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    min-width: 300px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.cookie-banner-btns {
    display: flex;
    gap: var(--space-xs);
    white-space: nowrap;
}

.cookie-banner-btns .btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
    }
    .cookie-banner-btns {
        width: 100%;
        justify-content: center;
    }
    .cookie-banner-btns .btn {
        flex: 1;
    }
}