/*
Theme Name: Madinit Masr - Landing Page
Description: High-performance landing page for Madinit Masr real estate projects. Built with lead tracking, WhatsApp & call tracking, SMTP notifications.
Version: 1.0.0
Text Domain: madinit-masr
Author: Bold Pixel
*/

:root {
    --primary: #0089b4;
    --primary-dark: #006d8f;
    --primary-light: #33a1c7;
    --secondary: #1a1a2e;
    --accent: #25D366;
    --gold: #c9a84c;
    --text: #333;
    --text-light: #666;
    --bg: #ffffff;
    --bg-light: #f8f9fa;
    --bg-dark: #1a1a2e;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Cairo', 'Tajawal', 'Noto Kufi Arabic', -apple-system, sans-serif;
    color: var(--text);
    line-height: 1.7;
    direction: rtl;
    background: var(--bg);
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #16213e 50%, var(--primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0,137,180,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 25px;
    border: 3px solid rgba(255,255,255,0.2);
}

.hero-title {
    font-size: 2.2rem;
    color: #fff;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 15px;
}

.hero-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 30px;
}

.hero-image {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    aspect-ratio: 1024/697;
    object-fit: cover;
}

/* Form Styles */
.lead-form-wrapper {
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    padding: 30px;
}

.lead-form-wrapper h3 {
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.form-field {
    margin-bottom: 15px;
}

.form-field input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    direction: rtl;
}

.form-field input::placeholder {
    color: rgba(255,255,255,0.5);
}

.form-field input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.15);
}

.btn-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,137,180,0.4);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-submit .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.btn-submit.loading .btn-text { display: none; }
.btn-submit.loading .spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

.form-message {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: 600;
    display: none;
}

.form-message.success {
    background: rgba(37,211,102,0.15);
    color: #25D366;
    display: block;
}

.form-message.error {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    display: block;
}

/* ============================================
   SECTION TITLES
   ============================================ */
.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features {
    padding: 80px 0;
    background: var(--bg-light);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.feature-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    padding: 18px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}

.feature-text b, .feature-text strong {
    color: var(--primary-dark);
}

.features-image {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    object-fit: cover;
    position: sticky;
    top: 20px;
}

/* ============================================
   CTA BUTTONS
   ============================================ */
.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.btn-whatsapp, .btn-call {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 35px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-whatsapp {
    background: var(--accent);
    color: #fff;
}

.btn-whatsapp:hover {
    background: #128C7E;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37,211,102,0.3);
}

.btn-call {
    background: var(--primary);
    color: #fff;
}

.btn-call:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,137,180,0.3);
}

/* ============================================
   LOCATION SECTION
   ============================================ */
.location {
    padding: 80px 0;
    background: var(--bg);
}

.location-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.location-content p {
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: 20px;
}

.location-content ul {
    margin: 20px 0;
}

.location-content li {
    padding: 8px 0;
    padding-right: 25px;
    position: relative;
    font-size: 1.05rem;
}

.location-content li::before {
    content: '📍';
    position: absolute;
    right: 0;
    top: 8px;
}

.location-note {
    background: linear-gradient(135deg, rgba(0,137,180,0.08), rgba(0,137,180,0.03));
    padding: 20px;
    border-radius: var(--radius);
    border-right: 4px solid var(--primary);
    margin-top: 20px;
    font-weight: 600;
}

.location-image {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    object-fit: cover;
}

/* ============================================
   PROJECTS / PRICING SECTION
   ============================================ */
.pricing {
    padding: 80px 0;
    background: var(--bg-light);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.pricing-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.pricing-card img {
    width: 100%;
    aspect-ratio: 16/11;
    object-fit: cover;
}

.pricing-card-body {
    padding: 25px 20px;
}

.pricing-card h3 {
    font-size: 1.4rem;
    color: var(--secondary);
    margin-bottom: 15px;
    font-weight: 800;
}

.pricing-details {
    text-align: right;
    margin-bottom: 15px;
}

.pricing-details p {
    padding: 6px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid #f0f0f0;
}

.pricing-details .label {
    color: var(--primary);
    font-weight: 700;
}

.pricing-installment {
    background: linear-gradient(135deg, rgba(0,137,180,0.08), rgba(0,137,180,0.03));
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.btn-more {
    display: inline-block;
    padding: 10px 30px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 50px;
    font-weight: 700;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
}

.btn-more:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0,137,180,0.3);
}

/* ============================================
   GALLERY SECTION
   ============================================ */
.gallery {
    padding: 80px 0;
    background: var(--bg);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 1;
}

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

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item::after {
    content: '🔍';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0;
    transition: var(--transition);
}

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

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 10;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: var(--transition);
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-prev { right: 20px; }
.lightbox-next { left: 20px; }

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--secondary) 0%, #16213e 50%, var(--primary-dark) 100%);
    position: relative;
}

.contact .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.contact-text h2 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 15px;
}

.contact-text p {
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: #0d0d1a;
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 25px 0;
    font-size: 0.9rem;
}

/* ============================================
   FLOATING CTA
   ============================================ */
.floating-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26,26,46,0.98);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    z-index: 999;
    display: none;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.floating-cta.visible {
    display: block;
}

.floating-cta .container {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.floating-cta a {
    flex: 1;
    max-width: 200px;
    text-align: center;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

/* ============================================
   POPUP FORM
   ============================================ */
.popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.popup-overlay.active {
    display: flex;
}

.popup-content {
    background: #fff;
    border-radius: var(--radius);
    padding: 35px;
    max-width: 450px;
    width: 100%;
    position: relative;
    animation: popupIn 0.3s ease;
}

@keyframes popupIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.popup-close {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.popup-close:hover {
    background: #e5e7eb;
}

.popup-content h3 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.4rem;
    color: var(--secondary);
}

.popup-content .popup-desc {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.popup-content .form-field input {
    background: #f8f9fa;
    color: var(--text);
    border-color: #e5e7eb;
}

.popup-content .form-field input::placeholder {
    color: #9ca3af;
}

.popup-content .form-field input:focus {
    border-color: var(--primary);
    background: #fff;
}

.popup-content .btn-submit {
    margin-top: 5px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 1.8rem; }
}

@media (max-width: 768px) {
    .hero .container,
    .features-grid,
    .location-grid,
    .contact .container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero {
        padding: 30px 0;
        min-height: auto;
    }

    .hero-title { font-size: 1.5rem; }
    .section-title { font-size: 1.5rem; }
    .features, .location, .pricing, .gallery, .contact { padding: 50px 0; }
    .pricing-grid { grid-template-columns: 1fr 1fr; }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
    .cta-buttons { flex-direction: column; align-items: center; }
    .btn-whatsapp, .btn-call { width: 100%; max-width: 300px; justify-content: center; }
    .features-image { position: static; order: -1; }
}

@media (max-width: 480px) {
    .pricing-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-logo { width: 70px; height: 70px; }
}
