/* General Reset & Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #f39c12;
    --dark-color: #1a1e21;
    --light-color: #f8f9fa;
    --text-color: #333;
    --gradient-bg: linear-gradient(135deg, rgba(13, 110, 253, 0.05), rgba(243, 156, 18, 0.05));
    --transition: all 0.4s ease-in-out;
}

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

body {
    font-family: 'Tajawal', sans-serif;
    color: var(--text-color);
    background-color: var(--light-color);
    /* For standard views */
    overflow-x: hidden; 
}

/* Typography and Spacing */
.section-title {
    font-weight: 900;
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
    color: var(--primary-color);
    font-size: 2.5rem;
}
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 5px;
    background-color: var(--secondary-color);
    border-radius: 5px;
}

p {
    font-size: 1.15rem;
    line-height: 1.9;
    color: #555;
}

/* Header & Navbar */
.main-header {
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}
.logo i {
    color: var(--secondary-color);
    margin-left: 8px;
}
.logo:hover {
    color: var(--secondary-color);
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
}
.nav-list a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 700;
    font-size: 1.15rem;
    transition: var(--transition);
    position: relative;
}
.nav-list a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    transition: var(--transition);
}
.nav-list a:hover {
    color: var(--primary-color);
}
.nav-list a:hover::before {
    width: 100%;
}

.toggle-btn {
    font-size: 2rem;
    cursor: pointer;
    color: var(--primary-color);
    transition: var(--transition);
}
.toggle-btn:hover {
    color: var(--secondary-color);
}

.close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2.5rem;
    cursor: pointer;
    color: #fff;
    transition: var(--transition);
}
.close-btn:hover {
    color: var(--secondary-color);
    transform: rotate(90deg);
}

/* Mobile Navigation (Side Drawer) */
@media (max-width: 991px) {
    body {
        overflow-x: hidden; /* Important requirement */
    }
    .nav-menu {
        position: fixed;
        top: 0;
        right: -350px;
        width: 300px;
        height: 100vh;
        background-color: var(--primary-color);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        z-index: 2000;
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }
    .nav-menu.active {
        right: 0;
    }
    .nav-list {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }
    .nav-list a {
        color: #fff;
        font-size: 1.8rem;
    }
    .nav-list a::before {
        background-color: var(--secondary-color);
    }
}

/* Hero Section */
.hero-section {
    background: var(--gradient-bg);
    padding: 120px 0;
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-img {
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 8px solid #fff;
}
.hero-img:hover {
    transform: scale(1.05) rotate(2deg);
}

/* Services */
.service-box {
    background: #fff;
    padding: 50px 30px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.06);
    transition: var(--transition);
    height: 100%;
    border-bottom: 5px solid transparent;
}
.service-box:hover {
    transform: translateY(-15px);
    box-shadow: 0 25px 50px rgba(13, 110, 253, 0.15);
    border-bottom: 5px solid var(--secondary-color);
}
.service-box i {
    transition: var(--transition);
}
.service-box:hover i {
    transform: scale(1.2);
    color: var(--secondary-color) !important;
}

/* Articles and Content Sections */
.article-box {
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    text-align: right;
    border-right: 5px solid var(--primary-color);
    transition: var(--transition);
}
.article-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}
.article-title {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 20px;
}

/* Stacked Images Layout (Sections 2 and 6) */
.stacked-images img {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border: 8px solid #fff;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: var(--transition);
    margin-bottom: 30px;
}
.stacked-images img:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* Step Box */
.step-box {
    background: var(--primary-color);
    color: #fff;
    padding: 30px 20px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 1.4rem;
    margin-bottom: 30px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.step-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--secondary-color);
    z-index: -1;
    transition: var(--transition);
}
.step-box:hover::after {
    width: 100%;
}
.step-box:hover {
    transform: translateY(-10px);
}

/* Form Styles */
.contact-form {
    background: #fff;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    text-align: right;
}
.contact-form .form-control, .contact-form .form-select {
    padding: 15px;
    font-size: 1.1rem;
    border-radius: 10px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    transition: var(--transition);
}
.contact-form .form-control:focus, .contact-form .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.2);
}
.contact-form label {
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
    color: var(--dark-color);
}
.whatsapp-btn-submit {
    background-color: #25D366;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 15px 30px;
    border-radius: 50px;
    border: none;
    width: 100%;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.whatsapp-btn-submit:hover {
    background-color: #1da851;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.4);
}

/* Neighborhood List */
.neighborhood-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}
.neighborhood-list li {
    background: #fff;
    padding: 10px 25px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    font-weight: bold;
    color: var(--primary-color);
    transition: var(--transition);
    border: 1px solid #eee;
}
.neighborhood-list li:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}

/* FAQ Accordion overrides */
.accordion-button {
    font-weight: bold;
    font-size: 1.1rem;
    padding: 20px;
}
.accordion-button:not(.collapsed) {
    color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}
.accordion-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    text-align: right;
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.9s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Specific Customizations */
#smart-home img {
    max-height: 500px;
    object-fit: cover;
    width: 100%;
    border: 10px solid #fff;
}

.btn-lg {
    padding: 18px 40px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.2rem;
    transition: var(--transition);
}
.btn-lg:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Features List */
.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
    text-align: right;
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: var(--transition);
}
.feature-item:hover {
    transform: translateX(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.feature-item i {
    font-size: 2.5rem;
    color: var(--secondary-color);
}
.feature-item h4 {
    color: var(--primary-color);
    font-weight: bold;
}

/* Maintenance Guide */
.maintenance-card {
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    border-top: 5px solid var(--secondary-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    height: 100%;
    transition: var(--transition);
}
.maintenance-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(243, 156, 18, 0.2);
}

/* Footer overrides */
footer {
    font-size: 1.1rem;
    padding: 60px 0 30px 0 !important;
}
.footer-links {
    list-style: none;
    padding: 0;
    text-align: right;
}
.footer-links li {
    margin-bottom: 15px;
}
.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
}
.footer-links a:hover {
    color: var(--secondary-color);
    padding-right: 10px;
}

/* Floating Action Buttons */
.floating-buttons {
    position: fixed;
    bottom: 30px;
    left: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
}

.float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 28px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.float-btn:hover {
    transform: scale(1.1);
    color: white;
}

.whatsapp-float {
    background-color: #25d366;
}

.whatsapp-float:hover {
    background-color: #1ebe57;
}

.phone-float {
    background-color: var(--primary-color);
}

.phone-float:hover {
    background-color: #0b5ed7;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.phone-float {
    animation: pulse-phone 2s infinite;
    animation-delay: 1s;
}

@keyframes pulse-phone {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(13, 110, 253, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}