/* التهوئة العامة للمتصفح وتطبيق الخط */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-image: url('image_gUqavr.png'); /* خلفية الفيلا الأصلية */
    background-size: cover;
    background-position: center center;
    background-attachment: fixed; /* يجعل الخلفية ثابتة أثناء التمرير لشكل أكثر احترافية */
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    justify-content: center; /* لتوسط المحتوى أفقياً */
    align-items: center;    /* لتوسط المحتوى عمودياً */
}

/* الحاوية الأساسية للتصميم - تهيئة العرض الافتراضي للشاشات العريضة والكمبيوتر */
.main-wrapper {
    position: relative;
    width: 100%;
    max-width: 1100px;
    /* تمت إزالة الخلفية من هنا لتظهر خلفية الـ body */
    background-color: rgba(255, 255, 255, 0.1); /* اختياريا: إضافة طبقة زجاجية خفيفة جداً ليتضح الكلام */
    backdrop-filter: blur(5px); /* اختيارياً: تأثير ضبابي زجاجي خلف المربع */
    display: grid;
    grid-template-columns: 2.3fr 2.5fr 2.5fr 2.5fr; 
    grid-template-rows: auto auto auto;
    gap: 12px;
    padding: 25px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    border-radius: 12px;
    overflow: hidden;
}

/* الهيدر: الشعار واسم التصميم */
.brand-header {
    grid-column: 1 / -1; 
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    margin-bottom: 12px;
}

.logo-image {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 50%;
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
}

/* الكروت والمربعات الرمادية الشفافة المطابقة للصورة تماماً */
.grid-card {
    background-color: rgba(220, 220, 220, 0.78); 
    color: #111111;
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 4px;
    min-height: 140px;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* كارت التصميم المعماري الرأسي المميز (الكتلة اليسرى) */
.card-vertical {
    grid-column: 1;
    grid-row: 2 / 4;
    justify-content: space-between;
    align-items: flex-start;
    padding: 25px 20px;
    background-color: rgba(200, 200, 200, 0.85);
}

.card-vertical h2 {
    font-size: 1.85rem;
    font-weight: 900;
    line-height: 1.3;
    text-align: right;
    margin: auto 0;
}

/* نصوص المربعات والخدمات الستة الباقية */
.grid-card h3 {
    font-size: 1.22rem;
    font-weight: 800;
    color: #111111;
    line-height: 1.4;
}

/* علامة الزائد (+) الدائرية المطفأة الصنع */
.icon-plus {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 24px;
    height: 24px;
    background-color: #4a4d52; 
    color: #ffffff; 
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: bold;
}

/* أيقونة السهم أسفل كارت التصميم المعماري */
.icon-arrow {
    width: 35px;
    height: 35px;
    border: 2px solid #111111;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
}

.grid-card:hover {
    background-color: rgba(255, 255, 255, 0.95);
}

/* تصميم النافذة المنبثقة التفاعلية (Modal) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 10px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: #161b26;
    color: #ffffff;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 12px;
    padding: 30px;
    overflow-y: auto;
    position: relative;
    border: 1px solid #2e374a;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.close-modal {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #ffffff;
}

.modal-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 25px;
    border-bottom: 2px solid #2e374a;
    padding-bottom: 10px;
}

/* تنسيق أنواع التصاميم وصورها */
.design-types-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.type-card {
    background-color: #222a3b;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #374151;
    text-align: center;
    padding-bottom: 12px;
}

.type-img {
    width: 100%;
    height: 110px;
    background-size: cover;
    background-position: center;
    background-color: #4a5568;
}

.type-card h4 {
    font-size: 1.1rem;
    margin: 10px 0 5px 0;
    color: #e2e8f0;
}

.type-card p {
    font-size: 0.8rem;
    color: #94a3b8;
    padding: 0 8px;
}

/* تنسيق الاستمارة الداخلية */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #cbd5e1;
}

.form-select, .file-input-wrapper {
    width: 100%;
    padding: 12px;
    background-color: #222a3b;
    border: 1px solid #374151;
    border-radius: 6px;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
}

.form-select option {
    background-color: #161b26;
}

/* زر رفع الملفات */
.file-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px dashed #4a5568;
    background-color: #1a2233;
    text-align: center;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background-color: #e5e7eb;
    color: #111111;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.submit-btn:hover {
    background-color: #ffffff;
}

/* ======================================================================= */
/* التحكم بالتحجيم التلقائي الكامل والتوزيع الطولي عند تصفح الموقع بالهاتف */
/* ======================================================================= */
@media (max-width: 850px) {
    body {
        padding: 12px;
        align-items: flex-start; 
        overflow-y: auto;
    }

    .main-wrapper {
        grid-template-columns: 1fr 1fr; 
        gap: 10px;
        padding: 16px;
        background-position: 45% center;
    }

    .brand-header {
        justify-content: center;
        margin-bottom: 5px;
    }

    .grid-card {
        grid-column: auto !important; 
        grid-row: auto !important;
        min-height: 120px; 
        padding: 18px 10px;
    }

    .card-vertical {
        grid-column: span 2 !important; 
        flex-direction: row-reverse;
        align-items: center;
        justify-content: space-between;
        min-height: 85px;
        padding: 15px 20px;
    }

    .card-vertical h2 { font-size: 1.45rem; margin: 0; }
    .grid-card h3 { font-size: 1.05rem; }
    .icon-plus { width: 20px; height: 20px; font-size: 0.8rem; top: 10px; left: 10px; }
    .icon-arrow { width: 32px; height: 32px; font-size: 0.95rem; }
    
    .modal-content {
        padding: 20px 15px;
        max-height: 95vh;
    }
}
.type-card {
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}
/* تمييز الكارت المختار بلون إطار مضيء واحترافي */
.type-card input[type="radio"]:checked + .type-img {
    border: 3px solid #4facfe;
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.5);
}
.type-card input[type="radio"]:checked ~ h4 {
    color: #4facfe;
    font-weight: bold;
}
