/**
 * Frontend Layout System
 * Extracted from inline styles to reduce HTML file size
 */

/* Frontend Layout Variables */
:root {
    --frontend-max-width: 1200px;
    --frontend-padding-x: 0.2rem;
    --frontend-padding-y: 1rem;
    --frontend-section-gap: 1.5rem;
    --frontend-card-gap: 1rem;
    --frontend-border-radius: 8px;
    /* Use existing navbar colors for consistency */
    --frontend-primary: #ff6a00;
    --frontend-secondary: #0084ff;
    --frontend-text: #333;
    --frontend-light-gray: #f5f5f5;
    --frontend-border: #e0e0e0;
}

/* Smooth Scrolling for the entire website */
html {
    scroll-behavior: smooth;
    overflow-x: clip; /* Use clip instead of hidden to allow sticky positioning */
}

body {
    overflow-x: clip; /* Use clip instead of hidden to allow sticky positioning */
}

/* Enhanced smooth scrolling for all elements */
* {
    scroll-behavior: smooth;
}

/* Smooth scrolling for specific scroll containers */
.scroll-container,
.overflow-auto,
.overflow-x-auto,
.overflow-y-auto {
    scroll-behavior: smooth;
}

/* Responsive padding adjustments */
@media (min-width: 576px) {
    :root {
        --frontend-padding-x: 0.5rem;
        --frontend-padding-y: 1.5rem;
        --frontend-section-gap: 2rem;
    }
}

@media (min-width: 768px) {
    :root {
        --frontend-padding-x: 0.75rem;
        --frontend-padding-y: 2rem;
        --frontend-section-gap: 2rem;
    }
}

@media (min-width: 992px) {
    :root {
        --frontend-padding-x: 0.5rem;
        --frontend-section-gap: 2rem;
    }
}

/* Frontend Container Classes */
.frontend-container {
    max-width: var(--frontend-max-width);
    margin: 0 auto;
    padding: var(--frontend-padding-y) var(--frontend-padding-x);
}

.frontend-container-fluid {
    max-width: var(--frontend-max-width);
    margin: 0 auto;
    padding: 10px var(--frontend-padding-x) var(--frontend-padding-y) var(--frontend-padding-x);
}

/* Ensure containers align with header */
@media (max-width: 767px) {
    .frontend-container,
    .frontend-container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

.frontend-section {
    margin-bottom: var(--frontend-section-gap);
}

.frontend-card-grid {
    gap: var(--frontend-card-gap);
}

/* Page Header Styles */
.frontend-page-header {
    margin-bottom: var(--frontend-section-gap);
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.frontend-page-title {
    color: var(--frontend-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Consistent spacing utilities */
.section-spacing {
    margin-bottom: var(--frontend-section-gap);
}

.card-spacing {
    margin-bottom: var(--frontend-card-gap);
}

/* Back to Top Button Styles */
.back-to-top-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--frontend-primary), var(--frontend-secondary));
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 17px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 106, 0, 0.4);
    z-index: 9998;
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background: linear-gradient(135deg, var(--frontend-secondary), var(--frontend-primary));
    box-shadow: 0 5px 14px rgba(255, 106, 0, 0.6);
    transform: translateY(-2px);
}

.back-to-top-btn:active {
    transform: translateY(0px);
    box-shadow: 0 2px 6px rgba(255, 106, 0, 0.5);
}

/* Tablet and below */
@media (max-width: 768px) {
    .back-to-top-btn {
        bottom: 85px; /* Above mobile bottom nav */
        right: 18px;
        width: 38px;
        height: 38px;
        font-size: 15px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .back-to-top-btn {
        bottom: 80px; /* Above mobile bottom nav */
        right: 15px;
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    
    .back-to-top-btn:hover {
        transform: translateY(-1px);
    }
}

/* Very small mobile devices */
@media (max-width: 360px) {
    .back-to-top-btn {
        bottom: 75px; /* Above mobile bottom nav */
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

/* Website Preloader Styles */
.website-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.website-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-logo {
    max-width: 400px;
    width: 90%;
    height: auto;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .preloader-logo {
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .preloader-logo {
        max-width: 250px;
    }
}

/* WhatsApp Floating Button Styles */
.whatsapp-float-btn {
    position: fixed;
    bottom: 150px; /* Above back-to-top and mobile nav */
    right: 25px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 9997;
    transition: all 0.3s ease;
    animation: whatsappPulse 2s infinite;
}

.whatsapp-float-btn:hover {
    background: #128C7E;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
    text-decoration: none;
}

.whatsapp-float-btn:active {
    transform: scale(0.95);
}

@keyframes whatsappPulse {
    0% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.6), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .whatsapp-float-btn {
        bottom: 135px; /* Above mobile nav */
        right: 18px;
        width: 55px;
        height: 55px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .whatsapp-float-btn {
        bottom: 130px; /* Above mobile nav */
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
}

@media (max-width: 360px) {
    .whatsapp-float-btn {
        bottom: 125px; /* Above mobile nav */
        right: 12px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}
