/* ==========================================================================
   SV Electricals & Smart Home Automation - Fixes & Dedicated Portfolio Styles
   ========================================================================== */

:root {
    --sv-primary: #F68A0A;
    --sv-primary-hover: #e07a04;
    --sv-dark: #121820;
    --sv-slate: #1e293b;
    --sv-text-dark: #1e293b;
    --sv-text-body: #334155;
}

/* -------------------------------------------------------------
   1. CRITICAL FIX: Navbar Single-Line Display & No Wrapping
   ------------------------------------------------------------- */
.navbar-brand h1 {
    font-size: 24px !important;
    white-space: nowrap !important;
}

@media (min-width: 992px) {
    .header-top .navbar-brand {
        padding: 35px 25px 35px 0 !important;
    }

    .navbar .navbar-nav .nav-item,
    #navbarCollapse .nav-item {
        margin-right: 0 !important;
        padding: 0 !important;
    }

    #navbarCollapse {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        height: 100% !important;
        gap: 2px !important;
    }

    #navbarCollapse a.nav-item.nav-link {
        color: #1e293b !important;
        font-weight: 700 !important;
        font-size: 14px !important;
        padding: 6px 9px !important;
        margin-right: 0 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        text-shadow: none !important;
        display: inline-flex !important;
        align-items: center !important;
        line-height: 1.2 !important;
        transition: color 0.2s ease !important;
    }

    #navbarCollapse a.nav-item.nav-link:hover,
    #navbarCollapse a.nav-item.nav-link.active {
        color: var(--sv-primary) !important;
    }
}

.nav-smart-badge {
    font-size: 0.6rem !important;
    padding: 2px 5px !important;
    background: #F68A0A !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    margin-left: 4px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    display: inline-block !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

/* -------------------------------------------------------------
   2. CRITICAL FIX: Clean Full-Slide Hero Slides
      (No Power Transmission Towers, No Diagonal Slanted Clip-Paths)
   ------------------------------------------------------------- */
.header-carousel .owl-item,
.header-carousel .header-carousel-item {
    background-color: #0c1118 !important;
    overflow: hidden;
}

.hero-slide-smart-home,
.hero-slide-curtains,
.hero-slide-electrical {
    background-color: #0c1118 !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: cover !important;
    width: 100%;
    height: 700px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-slide-smart-home {
    background-image: linear-gradient(90deg, rgba(10, 15, 22, 0.95) 0%, rgba(10, 15, 22, 0.88) 45%, rgba(10, 15, 22, 0.35) 75%, rgba(10, 15, 22, 0.15) 100%), url(../images/smart_villa.jpg) !important;
}

.hero-slide-curtains {
    background-image: linear-gradient(90deg, rgba(10, 15, 22, 0.95) 0%, rgba(10, 15, 22, 0.88) 45%, rgba(10, 15, 22, 0.35) 75%, rgba(10, 15, 22, 0.15) 100%), url(../images/smart_curtains.jpg) !important;
}

.hero-slide-electrical {
    background-image: linear-gradient(90deg, rgba(10, 15, 22, 0.95) 0%, rgba(10, 15, 22, 0.88) 45%, rgba(10, 15, 22, 0.35) 75%, rgba(10, 15, 22, 0.15) 100%), url(../images/svworking.jpg) !important;
}

.hero-slide-smart-home .carousel-caption,
.hero-slide-curtains .carousel-caption,
.hero-slide-electrical .carousel-caption {
    background: none !important;
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    z-index: 10;
}

.hero-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.topbar {
    white-space: nowrap !important;
}

.hero-feature-tag {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero-feature-tag i {
    color: var(--sv-primary);
}

/* -------------------------------------------------------------
   3. CRITICAL FIX: Readable Body Text (No Washed Out Gray)
   ------------------------------------------------------------- */
.about p,
.about .text-muted,
.about-desc,
.section-desc,
.text-body-dark {
    color: #334155 !important;
    font-size: 1.05rem;
    line-height: 1.7;
}

.badge-smart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--sv-primary);
    background: rgba(246, 138, 10, 0.12);
    border: 1px solid rgba(246, 138, 10, 0.3);
    border-radius: 50px;
    margin-bottom: 12px;
}

/* -------------------------------------------------------------
   4. Interactive Smart Living Room Simulator
   ------------------------------------------------------------- */
.simulator-section {
    background: linear-gradient(135deg, #0f141c 0%, #17212e 50%, #0d1219 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.simulator-room-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 460px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #090c10;
}

.simulator-room-bg {
    position: absolute;
    inset: 0;
    background-image: url(../images/smart_lighting.jpg);
    background-size: cover;
    background-position: center;
    transition: filter 0.6s ease;
}

.simulator-light-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: background 0.6s ease, opacity 0.6s ease;
    mix-blend-mode: screen;
}

.light-mode-warm {
    background: radial-gradient(circle at 50% 20%, rgba(255, 175, 75, 0.55) 0%, rgba(255, 120, 20, 0.25) 50%, transparent 80%);
    opacity: 0.95;
}

.light-mode-party {
    background: radial-gradient(circle at 30% 30%, rgba(157, 78, 221, 0.6) 0%, rgba(0, 210, 255, 0.5) 45%, rgba(246, 138, 10, 0.4) 80%);
    opacity: 0.95;
}

.light-mode-daylight {
    background: radial-gradient(circle at 50% 20%, rgba(220, 240, 255, 0.5) 0%, rgba(180, 215, 255, 0.2) 60%, transparent 85%);
    opacity: 0.9;
}

.light-mode-cinema {
    background: radial-gradient(circle at 50% 70%, rgba(10, 35, 90, 0.85) 0%, rgba(30, 10, 60, 0.8) 60%, rgba(5, 5, 10, 0.92) 100%);
    opacity: 0.95;
}

.light-mode-off {
    background: rgba(0, 0, 0, 0.82);
    opacity: 1;
}

/* Simulated Motorized Curtains */
.simulator-curtain-left,
.simulator-curtain-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6%;
    background: linear-gradient(to right, rgba(20, 20, 26, 0.96), rgba(35, 35, 45, 0.92));
    border-bottom: 3px solid rgba(246, 138, 10, 0.6);
    transition: width 1s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 5;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.simulator-curtain-left {
    left: 0;
    border-right: 2px solid rgba(255, 255, 255, 0.2);
}

.simulator-curtain-right {
    right: 0;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.curtains-open .simulator-curtain-left,
.curtains-open .simulator-curtain-right {
    width: 6%;
}

.curtains-half .simulator-curtain-left,
.curtains-half .simulator-curtain-right {
    width: 28%;
}

.curtains-closed .simulator-curtain-left,
.curtains-closed .simulator-curtain-right {
    width: 50.1%;
}

/* Fan Element in Simulator */
.simulator-fan-widget {
    position: absolute;
    top: 30px;
    right: 35px;
    z-index: 10;
    background: rgba(18, 24, 32, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 8px 16px 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fan-icon-spin {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(246, 138, 10, 0.2);
    color: var(--sv-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

@keyframes spinBlades {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fan-speed-off .fan-icon-spin i { animation: none; color: #8e9cae; }
.fan-speed-1 .fan-icon-spin i { animation: spinBlades 2s linear infinite; color: #00d2ff; }
.fan-speed-3 .fan-icon-spin i { animation: spinBlades 0.8s linear infinite; color: #F68A0A; }
.fan-speed-5 .fan-icon-spin i { animation: spinBlades 0.35s linear infinite; color: #ff3366; }

.simulator-hud {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.simulator-hud-badge {
    background: rgba(18, 24, 32, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 5px 12px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f1f5f9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.simulator-controls {
    background: #1a222d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 26px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
}

.control-group-title {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--sv-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.sim-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    border-radius: 10px;
    padding: 10px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.sim-btn i {
    font-size: 1.1rem;
    color: #94a3b8;
}

.sim-btn:hover {
    background: rgba(246, 138, 10, 0.15);
    border-color: var(--sv-primary);
    color: #fff;
}

.sim-btn.active {
    background: rgba(246, 138, 10, 0.25);
    border-color: var(--sv-primary);
    color: #fff;
    box-shadow: 0 0 14px rgba(246, 138, 10, 0.35);
}

.sim-btn.active i {
    color: var(--sv-primary);
}

.preset-scene-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.preset-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px;
    color: #f1f5f9;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preset-btn:hover,
.preset-btn.active {
    border-color: var(--sv-primary);
    background: rgba(246, 138, 10, 0.2);
}

.preset-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(246, 138, 10, 0.18);
    color: var(--sv-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* -------------------------------------------------------------
   5. Dedicated Home Automation Portfolio Cards
   ------------------------------------------------------------- */
.auto-card {
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.auto-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
    border-color: var(--sv-primary);
}

.auto-card-img-wrap {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #0f172a;
}

.auto-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.auto-card:hover .auto-card-img-wrap img {
    transform: scale(1.06);
}

.auto-card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(18, 24, 32, 0.88);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 6px;
}

.auto-card-badge i {
    color: var(--sv-primary);
}

.auto-card-body {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.auto-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.auto-card-desc {
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 16px;
    flex: 1;
}

.auto-card-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.auto-card-list li {
    font-size: 0.88rem;
    color: #334155;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-card-list li i {
    color: var(--sv-primary);
    font-size: 0.8rem;
}

/* -------------------------------------------------------------
   6. Estimator Section
   ------------------------------------------------------------- */
.estimator-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.estimator-property-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.prop-option {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.prop-option i {
    font-size: 1.4rem;
    color: #64748b;
    margin-bottom: 4px;
    display: block;
}

.prop-option span {
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    display: block;
}

.prop-option.active {
    border-color: var(--sv-primary);
    background: rgba(246, 138, 10, 0.08);
}

.prop-option.active i,
.prop-option.active span {
    color: var(--sv-primary);
}

.feature-toggle-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feature-toggle-item.checked {
    background: rgba(246, 138, 10, 0.06);
    border-color: rgba(246, 138, 10, 0.4);
}

.feature-toggle-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-toggle-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: var(--sv-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.custom-switch-check {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #fff;
    font-size: 0.75rem;
}

.feature-toggle-item.checked .custom-switch-check {
    background: var(--sv-primary);
    border-color: var(--sv-primary);
}

.estimator-summary-box {
    background: linear-gradient(135deg, #17212e 0%, #10161f 100%);
    color: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.estimate-price-badge {
    font-size: 2rem;
    font-weight: 800;
    color: var(--sv-primary);
    margin: 12px 0 6px 0;
}

@media (max-width: 991px) {
    .simulator-room-container {
        height: 340px;
        margin-bottom: 20px;
    }
    .preset-scene-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Navbar Drawer */
    #navbarCollapse {
        background: #ffffff !important;
        border-radius: 12px !important;
        padding: 15px 20px !important;
        margin-top: 15px !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15) !important;
        border: 1px solid #e2e8f0 !important;
    }

    #navbarCollapse a.nav-item.nav-link {
        color: #1e293b !important;
        font-weight: 700 !important;
        font-size: 16px !important;
        padding: 12px 10px !important;
        border-bottom: 1px solid #f1f5f9 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    #navbarCollapse a.nav-item.nav-link:last-of-type {
        border-bottom: none !important;
    }

    #navbarCollapse a.nav-item.nav-link:hover,
    #navbarCollapse a.nav-item.nav-link.active {
        color: var(--sv-primary) !important;
        background: rgba(246, 138, 10, 0.05) !important;
        border-radius: 8px !important;
    }

    #navbarCollapse .nav-btn {
        margin-top: 12px !important;
        padding-left: 0 !important;
    }

    #navbarCollapse .nav-btn .btn {
        width: 100% !important;
        padding: 12px !important;
    }
}

/* -------------------------------------------------------------
   Mobile & Tablet Responsive Refinements (360px - 768px)
   ------------------------------------------------------------- */
@media (max-width: 767px) {
    .display-3 {
        font-size: 2.1rem !important;
        line-height: 1.25 !important;
    }

    .display-4 {
        font-size: 1.85rem !important;
        line-height: 1.3 !important;
    }

    .hero-slide-smart-home,
    .hero-slide-curtains,
    .hero-slide-electrical {
        height: auto !important;
        min-height: 560px !important;
        padding: 70px 0 !important;
    }

    .hero-slide-smart-home .carousel-caption,
    .hero-slide-curtains .carousel-caption,
    .hero-slide-electrical .carousel-caption {
        position: relative !important;
        padding: 20px 0 !important;
    }

    .hero-feature-tags {
        gap: 6px !important;
    }

    .hero-feature-tag {
        font-size: 0.78rem !important;
        padding: 5px 10px !important;
    }

    .about .display-2 {
        font-size: 2.5rem !important;
    }

    .service .nav {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        padding-bottom: 10px !important;
    }

    .service .nav .nav-item {
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
    }

    .service .nav .nav-item a {
        padding: 10px 16px !important;
        white-space: nowrap !important;
    }
}

/* -------------------------------------------------------------
   Accessibility: Focus States, Motion & Skip Link
   ------------------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--sv-primary) !important;
    outline-offset: 3px !important;
}

.skip-to-main {
    position: absolute;
    top: -100px;
    left: 15px;
    background: var(--sv-primary);
    color: #ffffff !important;
    padding: 10px 18px;
    z-index: 99999;
    border-radius: 6px;
    font-weight: 700;
    transition: top 0.2s ease;
    text-decoration: none;
}

.skip-to-main:focus {
    top: 15px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
