/* MPMS Contracting - Main Stylesheet */
/* Bilingual (Arabic & English) Responsive Design */

/* ===== CSS Variables ===== */
:root {
    /* Color Palette */
    --primary-color: #004D40;
    --secondary-color: #FFD700;
    --heading-color: #212121;
    --body-text-color: #424242;
    --light-text: #FFFFFF;
    --bg-main: #F8F9FA;
    --bg-section: #FFFFFF;
    --bg-section-alt: #E0E0E0;
    --bg-dark: #303030;
    
    /* Typography */
    --font-heading: 'Inter', 'Montserrat', 'Tajawal', sans-serif;
    --font-body: 'Open Sans', 'Roboto', 'Cairo', sans-serif;
    
    /* Spacing */
    --section-padding: 80px 0;
    --section-padding-mobile: 40px 0;
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--body-text-color);
    background-color: var(--bg-main);
    overflow-x: hidden;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    text-align: justify;
}

/* Center align for specific contexts */
.section-title p,
.text-center p,
.hero-content p {
    text-align: center;
}

/* Justify for content paragraphs */
.card p:not(.text-center p),
.service-subsection p,
.contact-info p:not(.text-center p),
.footer p:not(.text-center p) {
    text-align: justify;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== RTL Support for Arabic ===== */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* ===== Header & Navigation ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-section);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 1rem 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 60px;
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu li a {
    color: var(--heading-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-menu li a:hover::after {
    width: 100%;
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-btn {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
    transition: var(--transition);
}

.lang-btn:hover,
.lang-btn.active {
    background-color: var(--primary-color);
    color: var(--light-text);
}

.cta-button {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.cta-button:hover {
    background-color: #003d32;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 77, 64, 0.3);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    background: none;
    border: none;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--light-text);
    margin-top: 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 77, 64, 0.7), rgba(0, 0, 0, 0.5));
    z-index: -1;
}

.hero-content {
    max-width: 900px;
    padding: 2rem;
    z-index: 1;
}

.hero h1 {
    color: var(--light-text);
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--light-text);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--heading-color);
    padding: 1rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: #ffed4e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--light-text);
    padding: 1rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    border: 2px solid var(--light-text);
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background-color: var(--light-text);
    color: var(--primary-color);
}

/* ===== Sections ===== */
.section {
    padding: var(--section-padding);
}

.section-alt {
    background-color: var(--bg-section-alt);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 1rem;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
}

[dir="rtl"] .section-title h2::after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* ===== Cards & Grids ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background-color: var(--bg-section);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.card-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ===== Services Page ===== */
.service-category {
    margin-bottom: 4rem;
}

.service-category h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.service-subsection {
    background-color: var(--bg-section);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

[dir="rtl"] .service-subsection {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

.service-subsection:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.service-subsection h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* ===== Projects Gallery ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: var(--transition);
}

.project-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.project-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.project-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 1.5rem;
    color: var(--light-text);
}

.project-card h3 {
    color: var(--light-text);
    margin-bottom: 0.5rem;
}

/* ===== Contact Form ===== */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.contact-form {
    background-color: var(--bg-section);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--heading-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 77, 64, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-info {
    background-color: var(--bg-section);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.contact-info-item {
    margin-bottom: 2rem;
}

.contact-info-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.contact-info-item p {
    margin-bottom: 0.25rem;
}

.map-container {
    margin-top: 2rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.map-container iframe {
    width: 100%;
    height: 400px;
    border: none;
}

/* ===== Footer ===== */
.footer {
    background-color: var(--bg-dark);
    color: var(--light-text);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--light-text);
    opacity: 0.8;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    opacity: 1;
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--light-text);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--secondary-color);
    color: var(--heading-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--light-text);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    z-index: 999;
}

[dir="rtl"] .back-to-top {
    right: auto;
    left: 2rem;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    color: var(--heading-color);
    transform: translateY(-5px);
}

.back-to-top.show {
    display: flex;
}

/* ===== Values Section ===== */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.value-card {
    text-align: center;
    padding: 2rem;
    background-color: var(--bg-section);
    border-radius: 8px;
    transition: var(--transition);
}

.value-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.value-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--bg-section);
        flex-direction: column;
        padding: 2rem;
        transition: var(--transition);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    [dir="rtl"] .nav-menu {
        left: auto;
        right: -100%;
    }
    
    [dir="rtl"] .nav-menu.active {
        right: 0;
    }
    
    .nav-wrapper {
        gap: 1rem;
    }
    
    .language-switcher {
        order: -1;
    }
    
    .cta-button {
        display: none;
    }
    
    .hero {
        height: 70vh;
        min-height: 400px;
        margin-top: 70px;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero h1 {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }
    
    .hero p {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
    }
    
    .section {
        padding: var(--section-padding-mobile);
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .header-container {
        padding: 0 1rem;
        flex-wrap: wrap;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .service-subsection {
        padding: 1.25rem;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .map-container iframe {
        height: 300px;
    }
    
    /* Hide sticky services nav on mobile */
    section[style*="position: sticky"] {
        position: relative !important;
        top: auto !important;
    }
    
    /* Services navigation menu on mobile */
    section[style*="position: sticky"] .container > div {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 0.5rem;
    }
    
    section[style*="position: sticky"] .container > div::-webkit-scrollbar {
        height: 4px;
    }
    
    section[style*="position: sticky"] .cta-button {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Adjust text alignment on mobile */
    p {
        text-align: left;
    }
    
    [dir="rtl"] p {
        text-align: right;
    }
    
    .hero-content p,
    .section-title p,
    .text-center p {
        text-align: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .section-title h2 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    .service-subsection {
        padding: 1rem;
    }
    
    .contact-form,
    .contact-info {
        padding: 1.5rem;
    }
    
    .map-container iframe {
        height: 250px;
    }
}

@media (max-width: 360px) {
    .hero {
        height: 60vh;
        min-height: 350px;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 0.85rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.hidden {
    display: none;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

