/* Custom CSS for LAB Windows & Doors */

:root {
    --lab-blue: #24235d;
    --lab-blue-dark: #1a1945;
    --lab-yellow: #eda922;
    --lab-yellow-dark: #d4951e;
    --success-color: #28a745;
    --light-gray: #f8f9fa;
    --white: #ffffff;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Performance Optimizations for Core Web Vitals */
img {
    transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"]:not(.img-default) {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Ensure default images are always visible */
.img-default {
    opacity: 1 !important;
}

/* Critical resource hints */
.hero-section {
    will-change: transform;
    contain: layout style paint;
}

/* Core Web Vitals optimization */
.window-card, .door-card {
    contain: layout style paint;
    will-change: transform;
}

/* Reduce layout shift */
.card-img-top {
    aspect-ratio: 16/9;
    object-fit: cover;
    object-position: center;
}

.bg-navy {
    background-color: var(--lab-blue) !important;
}

.text-navy {
    color: var(--lab-blue) !important;
}

.bg-lab-blue {
    background-color: var(--lab-blue) !important;
}

.text-lab-blue {
    color: var(--lab-blue) !important;
}

.text-lab-yellow {
    color: var(--lab-yellow) !important;
}

.btn-navy {
    background-color: var(--lab-blue);
    border-color: var(--lab-blue);
    color: white;
}

.btn-navy:hover {
    background-color: var(--lab-blue-dark);
    border-color: var(--lab-blue-dark);
    color: white;
}

.btn-yellow {
    background-color: var(--lab-yellow);
    border-color: var(--lab-yellow);
    color: var(--lab-blue);
    font-weight: 600;
}

.btn-yellow:hover {
    background-color: var(--lab-yellow-dark);
    border-color: var(--lab-yellow-dark);
    color: var(--lab-blue);
}

.btn-yellow:focus {
    background-color: var(--lab-yellow);
    border-color: var(--lab-yellow);
    color: var(--lab-blue);
    box-shadow: 0 0 0 0.2rem rgba(237, 169, 34, 0.25);
}

.btn-lab-yellow {
    background-color: var(--lab-yellow);
    border-color: var(--lab-yellow);
    color: var(--lab-blue);
    font-weight: 600;
}

.btn-lab-yellow:hover {
    background-color: var(--lab-yellow-dark);
    border-color: var(--lab-yellow-dark);
    color: var(--lab-blue);
}

.btn-lab-yellow:focus {
    background-color: var(--lab-yellow);
    border-color: var(--lab-yellow);
    color: var(--lab-blue);
    box-shadow: 0 0 0 0.2rem rgba(237, 169, 34, 0.25);
}

.btn-lab-blue {
    background-color: var(--lab-blue);
    border-color: var(--lab-blue);
    color: white;
    font-weight: 600;
}

.btn-lab-blue:hover {
    background-color: var(--lab-blue-dark);
    border-color: var(--lab-blue-dark);
    color: white;
}

/* Logo Styles */
.navbar-logo {
    height: 55px;
    width: auto;
    max-width: 180px;
}

.footer-logo {
    height: 35px;
    width: auto;
    max-width: 140px;
}

/* Header Styles */
.navbar {
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand img {
    transition: all 0.3s ease;
}

.logo-enhanced {
    filter: brightness(1.1);
    margin-top: -5px;
    margin-bottom: -5px;
}

.navbar-brand:hover .logo-enhanced {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--lab-yellow) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(36, 35, 93, 0.6), rgba(26, 25, 69, 0.7)), 
                url('../images/hero-background.jpg') center/cover no-repeat;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* Mobile optimization for hero background */
@media (max-width: 768px) {
    .hero-section {
        background: linear-gradient(rgba(36, 35, 93, 0.75), rgba(26, 25, 69, 0.8)), 
                    url('../images/hero-background-mobile.jpg') center/cover no-repeat;
        background-size: cover;
        background-position: center center;
        background-attachment: scroll;
        min-height: 100vh;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    .hero-content p.lead {
        background: rgba(36, 35, 93, 0.85);
        padding: 15px;
        font-size: 0.95rem;
        border-radius: 8px;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
        text-shadow: 2px 2px 6px rgba(0,0,0,0.9);
    }
    
    .hero-content {
        padding: 20px 0;
    }
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.05)" points="0,0 1000,300 1000,1000 0,700"/></svg>');
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    display: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

.hero-content p.lead {
    text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
    background: rgba(36, 35, 93, 0.7);
    padding: 20px;
    border-radius: 10px;
}

/* Quote Form Card */
.quote-form-card {
    position: relative;
    z-index: 2;
}

.quote-form-card .card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.quote-form-card .card-header {
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
    border-bottom: none;
    padding: 20px;
}

/* Rebate Card */
.rebate-card {
    background: linear-gradient(135deg, var(--lab-blue) 0%, var(--lab-blue-dark) 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(36, 35, 93, 0.3);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.rebate-card:hover {
    transform: translateY(-5px);
}

.rebate-badge {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Button Styles for Neighborhood Pages */
.btn-gold {
    background-color: var(--lab-yellow);
    border-color: var(--lab-yellow);
    color: var(--lab-blue);
    font-weight: 600;
}

.btn-gold:hover {
    background-color: var(--lab-yellow-dark);
    border-color: var(--lab-yellow-dark);
    color: var(--lab-blue);
}

.text-gold {
    color: var(--lab-yellow) !important;
}

/* Window Cards */
.window-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 10px;
    overflow: hidden;
}

.window-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.window-img {
    transition: background-color 0.3s ease;
}

.window-card:hover .window-img {
    background-color: var(--lab-blue) !important;
}

.window-card:hover .window-img i {
    color: white !important;
}

/* Door Section */
.door-section {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    height: 100%;
}

.door-section:hover {
    transform: translateY(-5px);
}

.door-icon i {
    transition: color 0.3s ease;
}

.door-section:hover .door-icon i {
    color: var(--lab-yellow) !important;
}

/* Award Badges */
.award-badge {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.award-badge:hover {
    transform: scale(1.05);
}

.flag-icon {
    display: inline-block;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

/* Benefit Cards */
.benefit-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

/* Section Spacing */
section {
    padding: 80px 0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .quote-form-card {
        margin-top: 40px;
    }
    
    section {
        padding: 60px 0;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .rebate-card h2 {
        font-size: 2rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Form Styling */
.form-control:focus {
    border-color: var(--lab-blue);
    box-shadow: 0 0 0 0.2rem rgba(36, 35, 93, 0.25);
}

/* Button Hover Effects */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

/* Footer Styling */
footer {
    background: linear-gradient(135deg, var(--lab-blue) 0%, var(--lab-blue-dark) 100%);
}

footer a:hover {
    color: var(--lab-yellow) !important;
}

/* Loading Animation */
.loading {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--lab-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--lab-blue-dark);
}

/* Review Widget Styling */
.review-widget-container {
    max-width: 100%;
    margin: 0 auto;
}

.lc_reviews_widget {
    border: none;
    min-height: 400px;
    background: transparent;
}

/* Window Hover Animation */
.hover-img-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
}

.hover-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease;
    background: white;
    border-radius: 8px;
}

.img-default {
    opacity: 1;
}

.img-hover {
    opacity: 0;
}

.hover-img-container:hover .img-default {
    opacity: 0;
}

.hover-img-container:hover .img-hover {
    opacity: 1;
}

/* Specialty Shapes Section */
.specialty-shapes-img img {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.specialty-shapes-content {
    padding: 2rem 0;
}

.shapes-grid {
    margin-top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.shapes-diagram {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    background: transparent;
}

@media (max-width: 991px) {
    .specialty-shapes-content {
        padding: 2rem 0 0 0;
        text-align: center;
    }
}

/* New Door Section Styles */
.door-section {
    background-color: #ffffff;
    padding: 50px 20px;
    text-align: center;
    color: #251f66;
}

.door-section h2 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 50px;
    color: #251f66;
}

.door-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.door-box {
    background-color: #f9f9ff;
    border-radius: 16px;
    padding: 30px;
    flex: 1 1 calc(50% - 15px);
    max-width: calc(50% - 15px);
    min-width: 300px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.door-box img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
    margin-bottom: 20px;
}

.door-box h3 {
    font-size: 20px;
    font-weight: 700;
    color: #251f66;
    margin-bottom: 15px;
}

.door-box ul {
    padding-left: 0;
    margin-bottom: 20px;
}

.door-box ul li {
    list-style: none;
    margin-bottom: 10px;
    padding-left: 26px;
    position: relative;
    font-size: 15px;
    color: #333;
    line-height: 1.6;
}

.door-box ul li::before {
    content: "✔";
    position: absolute;
    left: 0;
    color: #251f66;
    font-weight: bold;
}

.cta-button {
    margin-top: auto;
    display: inline-block;
    background-color: #f4a720;
    color: white !important;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 15px;
    border-radius: 999px;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #d4901a;
}

@media (max-width: 768px) {
    .door-box {
        flex: 1 1 100%;
        max-width: 100%;
        min-width: auto;
    }

    .door-section h2 {
        font-size: 26px;
    }

    .door-box img {
        height: 180px;
    }
}

/* ENGAGEMENT IMPROVEMENTS TO INCREASE TIME ON PAGE */

/* Progressive disclosure animations for better engagement */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced interactive card effects to encourage exploration */
.window-type-card, .installation-step, .season-card, .service-feature {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.window-type-card::before, .service-feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.6s ease;
}

.window-type-card:hover::before, .service-feature:hover::before {
    left: 100%;
}

.window-type-card:hover, .installation-step:hover, .season-card:hover, .service-feature:hover {
    background: linear-gradient(135deg, #ffffff, #fff8e1);
}

/* Staggered animation delays for visual interest */
.service-feature:nth-child(1) {
    animation: fadeInUp 0.8s ease-out 0.1s backwards;
}

.service-feature:nth-child(2) {
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
}

.service-feature:nth-child(3) {
    animation: fadeInUp 0.8s ease-out 0.5s backwards;
}

/* Progress indicator styling */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffd700, #ffed4a);
    z-index: 9999;
    transition: width 0.25s ease;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

/* Engagement elements */
.sticky-engagement {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    animation: gentlePulse 3s infinite;
}

@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Better loading states */
.hero-section {
    animation: fadeInUp 1.2s ease-out !important;
}

/* Hero section height matching improvements */
.hero-section .row {
    align-items: stretch;
}

.quote-form-card.h-100 .card {
    min-height: 100%;
}

/* Fix click-to-call functionality */
.hero-cta {
    position: relative;
    z-index: 10001 !important;
}

/* Allow clicks to pass through hero overlays */
.hero-section::before,
.hero-section .overlay {
    pointer-events: none;
}

.quote-form-card iframe {
    flex-grow: 1;
    min-height: 925px;
}

/* Ensure proper column height matching */
.hero-section .col-lg-6 {
    display: flex;
    flex-direction: column;
}

.hero-section .hero-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
