/**
 * Interactive Elements CSS
 * Styles for JavaScript-enhanced features
 */

/* ==========================================================================
   Mobile Navigation
   ========================================================================== */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--forest-green);
    margin: 5px 0;
    transition: 0.3s;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile menu overlay */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background-color: rgba(34, 61, 47, 0.98);
    z-index: 1000;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav-content {
    padding: 5rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mobile-nav a {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.3s ease;
}

.mobile-nav a:hover {
    color: var(--mustard-gold);
}

.mobile-menu-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .desktop-nav {
        display: none;
    }
}

/* ==========================================================================
   Form Validation States
   ========================================================================== */

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-control {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--mustard-gold);
    box-shadow: 0 0 0 3px rgba(180, 121, 12, 0.1);
}

.form-control.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-control.success {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.field-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.field-error::before {
    content: "⚠";
}

/* ==========================================================================
   Service Request Form Steps
   ========================================================================== */

.form-step {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-step.active {
    display: block;
    opacity: 1;
}

.progress-container {
    margin-bottom: 2rem;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--mustard-gold), var(--forest-green));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 20%;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.progress-step {
    flex: 1;
    text-align: center;
    color: #6c757d;
    font-size: 0.875rem;
    position: relative;
}

.progress-step.completed {
    color: var(--forest-green);
    font-weight: 600;
}

.progress-step::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    line-height: 24px;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.progress-step.completed::before {
    background-color: var(--forest-green);
    color: white;
    content: "✓";
}

.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.btn-prev {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-prev:hover {
    background-color: #5a6268;
}

.btn-next {
    background-color: var(--mustard-gold);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-next:hover {
    background-color: #9a6209;
}

/* ZIP code service area feedback */
.zip-message {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.zip-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.zip-message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* ==========================================================================
   Financing Calculator
   ========================================================================== */

.calculator-inputs {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.calculator-results {
    background-color: var(--beige);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(34, 61, 47, 0.1);
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: var(--forest-green);
}

.result-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--forest-green);
}

/* ==========================================================================
   Tips Filtering
   ========================================================================== */

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.filter-btn {
    background-color: transparent;
    border: 2px solid var(--forest-green);
    color: var(--forest-green);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover {
    background-color: var(--forest-green);
    color: white;
}

.filter-btn.active {
    background-color: var(--mustard-gold);
    border-color: var(--mustard-gold);
    color: white;
}

.tip-card {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tip-card:not(.visible) {
    opacity: 0;
    transform: translateY(20px);
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    margin: 1rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: #f8f9fa;
}

.modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Scroll to Top Button
   ========================================================================== */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--mustard-gold);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background-color: var(--forest-green);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    max-width: 400px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 1100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification.visible {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background-color: #28a745;
}

.notification-error {
    background-color: #dc3545;
}

.notification-warning {
    background-color: #ffc107;
    color: #212529;
}

.notification-info {
    background-color: #17a2b8;
}

/* ==========================================================================
   Animations
   ========================================================================== */

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fadeIn {
    animation: fadeIn 0.8s ease forwards;
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slideInLeft {
    animation: slideInLeft 0.8s ease forwards;
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slideInRight {
    animation: slideInRight 0.8s ease forwards;
}

/* Scale in */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scaleIn {
    animation: scaleIn 0.6s ease forwards;
}

/* Bounce in */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.bounceIn {
    animation: bounceIn 0.8s ease forwards;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--mustard-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Button loading states */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   Newsletter Signup
   ========================================================================== */

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.newsletter-form button {
    padding: 0.75rem 1.5rem;
    background-color: var(--mustard-gold);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.newsletter-form button:hover {
    background-color: var(--forest-green);
}

.newsletter-form button:disabled {
    background-color: #28a745;
    cursor: not-allowed;
}

/* ==========================================================================
   Enhanced Footer Styles
   ========================================================================== */

.footer {
    background: linear-gradient(135deg, var(--charcoal-green), var(--forest-green));
    color: white;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1.3fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
    min-height: auto;
    align-items: start;
}

.footer-section h4 {
    color: var(--mustard-gold);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.footer-section h5 {
    color: var(--beige);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Footer Brand Section */
.footer-brand {
    max-width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: -24px;
}

.footer-logo {
    max-width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 1rem;
    align-self: flex-start;
    margin-top: 0;
    display: block;
}

.footer-description {
    color: #e0e0e0;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.social-title {
    color: var(--mustard-gold);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.social-icons {
    display: flex;
    gap: 0.75rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(180, 121, 12, 0.2);
    border-radius: 50%;
    color: var(--mustard-gold);
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: var(--mustard-gold);
    color: var(--forest-green);
    transform: translateY(-2px);
}

/* Service Links */
.service-category {
    margin-bottom: 1.5rem;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #d0d0d0;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--mustard-gold);
}

/* Contact Section */
.contact-info {
    margin-bottom: 2rem;
    min-width: 0; /* Prevent flex item from overflowing */
}

.footer-contact {
    min-width: 0; /* Prevent grid item from overflowing */
    overflow: visible;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.contact-item:hover {
    background-color: rgba(180, 121, 12, 0.1);
}

.contact-item svg {
    color: var(--mustard-gold);
    flex-shrink: 0;
}

.contact-item div {
    display: flex;
    flex-direction: column;
}

.contact-item strong {
    color: white;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.contact-item span {
    color: #b0b0b0;
    font-size: 0.875rem;
}

/* Quick Contact Buttons */
.quick-contact,
.contact-ctas {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn-footer-primary,
.btn-footer-emergency {
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-footer-primary {
    background-color: var(--mustard-gold);
    color: var(--forest-green);
}

.btn-footer-primary:hover {
    background-color: transparent;
    border-color: var(--mustard-gold);
    color: var(--mustard-gold);
}

.btn-footer-emergency {
    background-color: transparent;
    color: var(--mustard-gold);
    border-color: var(--mustard-gold);
}

.btn-footer-emergency:hover {
    background-color: var(--mustard-gold);
    color: var(--forest-green);
}

/* Service Areas */
.footer-service-areas {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.footer-service-areas h4 {
    margin-bottom: 1rem;
    text-align: center;
}

.service-areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    text-align: center;
}

.service-areas-grid span {
    padding: 0.5rem;
    background-color: rgba(180, 121, 12, 0.1);
    border-radius: 4px;
    font-size: 0.875rem;
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.service-areas-grid span:hover {
    background-color: rgba(180, 121, 12, 0.2);
    color: var(--mustard-gold);
}

/* Certifications */
.footer-certifications {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.cert-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(180, 121, 12, 0.1);
    border-radius: 6px;
    transition: transform 0.3s ease;
}

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

.cert-item svg {
    color: var(--mustard-gold);
    flex-shrink: 0;
}

.cert-item div {
    display: flex;
    flex-direction: column;
}

.cert-item strong {
    color: white;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.cert-item span {
    color: #b0b0b0;
    font-size: 0.8rem;
}

/* Footer Bottom */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 2px solid rgba(180, 121, 12, 0.3);
    margin-top: 2rem;
}

.footer-legal {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-legal p {
    margin: 0;
    font-size: 0.875rem;
    color: #b0b0b0;
}

.legal-links {
    display: flex;
    gap: 1rem;
}

.legal-links a {
    color: #d0d0d0;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.legal-links a:hover {
    color: var(--mustard-gold);
}

.footer-tagline p {
    margin: 0;
    font-size: 1rem;
    color: var(--mustard-gold);
    font-style: italic;
}

/* Mega Menu Styles */
.has-mega-menu {
    position: relative;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: 600px;
}

.has-mega-menu:hover .mega-menu,
.mega-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu .container {
    padding: 1.5rem;
}

.mega-menu h4 {
    color: var(--forest-green);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--mustard-gold);
    padding-bottom: 0.5rem;
}

.mega-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu li {
    margin-bottom: 0.5rem;
}

.mega-menu a {
    color: var(--charcoal-green);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.mega-menu a:hover {
    color: var(--mustard-gold);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet and Medium Screen Adjustments */
@media (max-width: 1024px) {
    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .footer-content {
        padding: 0 1.5rem;
    }
}

@media (max-width: 900px) {
    .footer-top {
        grid-template-columns: 1fr 1.2fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
    
    .calculator-inputs {
        grid-template-columns: 1fr;
    }
    
    .category-filter {
        gap: 0.25rem;
    }
    
    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form button {
        margin-top: 0.5rem;
    }
    
    /* Enhanced Footer Mobile Styles */
    .footer-top {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-brand {
        max-width: none;
        text-align: center;
    }
    
    .footer-content {
        padding: 0 1rem;
    }
    
    .contact-ctas {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-footer-primary,
    .btn-footer-emergency {
        text-align: center;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .footer-links .service-category {
        margin-bottom: 1rem;
    }
    
    .quick-contact {
        justify-content: center;
    }
    
    .service-areas-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.25rem;
    }
    
    .footer-certifications {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .legal-links {
        justify-content: center;
    }
    
    /* Mega Menu Mobile */
    .mega-menu {
        position: static;
        min-width: auto;
        width: 100%;
        margin-top: 0.5rem;
        border-radius: 4px;
    }
}

@media (max-width: 480px) {
    .form-navigation {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-prev,
    .btn-next {
        width: 100%;
        text-align: center;
    }
    
    .progress-steps {
        font-size: 0.75rem;
    }
}