/**
 * The Virtual Estimation - Global Stylesheet
 * Construction Estimating Services
 * 
 * This file contains all shared styles for the website.
 * Include this in every page: <link rel="stylesheet" href="/assets/css/main.css">
 */

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

/* Prevent FOUC (Flash of Unstyled Content) */
html {
    visibility: visible;
    opacity: 1;
}

/* Base layout styles */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Container */
.container {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

header {
    background: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none !important;
    position: absolute;
    background-color: white;
    min-width: 280px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-radius: 8px;
    padding: 8px 0;
    top: 100%;
    left: 0;
    margin-top: 0px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dropdown-content.two-column {
    min-width: 560px;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.dropdown:hover .dropdown-content,
.dropdown-content:hover {
    display: grid !important;
    opacity: 1;
}

.dropdown-content:not(.two-column) {
    display: none !important;
}

.dropdown:hover .dropdown-content:not(.two-column),
.dropdown-content:not(.two-column):hover {
    display: block !important;
    opacity: 1;
}

.dropdown-content a {
    color: #374151;
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    transition: all 0.2s;
    border-radius: 4px;
    margin: 0 8px;
}

.dropdown-content a:hover {
    background-color: #FFF5F0;
    color: #FF6B35;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-arrow {
    transition: transform 0.3s;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mega Menu Styles */
.dropdown-content.mega-menu {
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    max-width: 90vw;
    display: none;
    grid-template-columns: repeat(4, 1fr);
    padding: 16px;
    font-size: 0.9em;
}

.dropdown:hover .dropdown-content.mega-menu {
    display: grid;
}

/* Mobile Dropdown */
.mobile-dropdown-content {
    display: none;
    padding-left: 20px;
    margin-top: 8px;
}

.mobile-dropdown-content.active {
    display: block;
}

.mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.mobile-dropdown-arrow {
    transition: transform 0.3s;
}

.mobile-dropdown-arrow.active {
    transform: rotate(180deg);
}

/* ==========================================================================
   BUTTONS & INTERACTIVE ELEMENTS
   ========================================================================== */

.apple-button {
    background: linear-gradient(135deg, #FF6B35, #FF8A65);
    border: none;
    border-radius: 50px;
    padding: 1rem 2rem;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    will-change: transform;
}

.apple-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.apple-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.apple-button-secondary {
    background: transparent;
    border: 2px solid #4682B4;
    border-radius: 50px;
    padding: 1rem 2rem;
    color: #4682B4;
    font-weight: 600;
    transition: all 0.3s ease;
    will-change: transform;
}

.apple-button-secondary:hover {
    background: #4682B4;
    color: white;
    transform: translateY(-2px);
}

/* ==========================================================================
   CARDS & COMPONENTS
   ========================================================================== */

.service-card {
    transition: all 0.3s ease;
    will-change: transform;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(255, 107, 53, 0.15);
}

.blog-card {
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Service Tab Styles */
.service-tab-item {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-tab-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #FF6B35, #4682B4);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.service-tab-item.active::before {
    transform: scaleY(1);
}

.service-tab-item.active {
    background-color: #FFF5F0;
}

.service-details-panel {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.service-details-panel.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.service-details-panel.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   BADGES & TAGS
   ========================================================================== */

.category-badge {
    background: linear-gradient(135deg, #FF6B35, #4682B4);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Trust Badge Icons */
.trust-badge-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.trust-badge-icon:hover {
    transform: scale(1.1);
}

.badge-money-back {
    background: linear-gradient(135deg, #FCD34D, #F59E0B);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.badge-support {
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.badge-accurate {
    background: linear-gradient(135deg, #34D399, #10B981);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   BACKGROUNDS & GRADIENTS
   ========================================================================== */

.hero-gradient {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(70, 130, 180, 0.1) 100%);
}

.text-gradient {
    background: linear-gradient(135deg, #FF6B35, #4682B4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   FORMS & MESSAGES
   ========================================================================== */

.form-message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    font-weight: 500;
}

.form-message.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.form-message.error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Animation Classes */
.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fadeIn {
    animation: fadeIn 1s ease-out forwards;
}

.animate-slideInLeft {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slideInRight {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.6s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-on-scroll {
    opacity: 0;
}

/* Animation Delays */
.animation-delay-100 { animation-delay: 0.1s; }
.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-400 { animation-delay: 0.4s; }
.animation-delay-500 { animation-delay: 0.5s; }
.animation-delay-600 { animation-delay: 0.6s; }

/* ==========================================================================
   SPECIAL COMPONENTS
   ========================================================================== */

/* Hero Video Frame */
.video-frame {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Hero Image Animation */
.hero-image-animated {
    animation: float 3s ease-in-out infinite;
}

.hero-image-container img {
    width: 100%;
    height: auto;
    max-height: 700px;
    object-fit: contain;
}

/* Logo Slider */
.logo-slider-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.logo-slider {
    display: flex;
    animation: scroll 20s linear infinite;
    width: max-content;
}

.logo-slider-wrapper:hover .logo-slider {
    animation-play-state: paused;
}

.logo-item {
    flex-shrink: 0;
    width: 200px;
    height: 100px;
    margin: 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.logo-item:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

.logo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .hero-image-container img {
        max-height: 350px;
    }
    
    .logo-item {
        width: 150px;
        height: 80px;
        margin: 0 20px;
    }
}

@media (max-width: 480px) {
    .hero-image-container img {
        max-height: 250px;
    }
    
    .logo-item {
        width: 120px;
        height: 60px;
        margin: 0 15px;
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.cursor-pointer {
    cursor: pointer;
}

.no-underline {
    text-decoration: none;
}

/* ==========================================================================
END OF STYLESHEET
========================================================================== */
