/* Custom CSS for Benchmark Roofing Contractors Website */
/* Built on top of Tailwind CSS with 8pt grid system */

/* ============================================
   DESIGN SYSTEM VARIABLES
   ============================================ */

:root {
    /* Brand Colors */
    --benchmark-blue: #4A90E2;
    --benchmark-navy: #2C3E50;
    --benchmark-white: #FFFFFF;
    
    /* Typography */
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Open Sans', sans-serif;
    
    /* 8pt Grid System */
    --grid-1: 8px;
    --grid-2: 16px;
    --grid-3: 24px;
    --grid-4: 32px;
    --grid-6: 48px;
    --grid-8: 64px;
    --grid-12: 96px;
    --grid-16: 128px;
    
    /* Shadows */
    --shadow-card: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

/* ============================================
   BASE STYLES & RESETS
   ============================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--grid-12);
}

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: #374151;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   COMPONENT CLASSES
   ============================================ */

/* Button Components */
.btn-primary {
    @apply bg-benchmark-blue hover:bg-benchmark-navy text-white px-8 py-4 rounded-lg font-montserrat font-bold text-lg transition-colors;
    transition: all var(--transition-normal);
}

.btn-secondary {
    @apply border-2 border-benchmark-blue text-benchmark-blue hover:bg-benchmark-blue hover:text-white px-8 py-4 rounded-lg font-montserrat font-bold text-lg transition-colors;
    transition: all var(--transition-normal);
}

.btn-outline {
    @apply border-2 border-white text-white hover:bg-white hover:text-benchmark-navy px-8 py-4 rounded-lg font-montserrat font-bold text-lg transition-colors;
    transition: all var(--transition-normal);
}

/* Card Components */
.card {
    @apply bg-white rounded-lg shadow-lg overflow-hidden;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-image {
    @apply w-full object-cover;
    aspect-ratio: 16/9;
}

.card-content {
    @apply p-6;
}

/* Gallery Components */
.gallery-grid {
    @apply grid gap-4;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.gallery-item {
    @apply aspect-square bg-cover bg-center rounded-lg shadow-lg cursor-pointer;
    transition: all var(--transition-normal);
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

/* Before/After Components */
.before-after-container {
    @apply bg-white rounded-lg shadow-lg overflow-hidden;
}

.before-after-images {
    @apply grid grid-cols-2;
}

.before-after-image {
    @apply relative;
}

.before-after-image img {
    @apply w-full h-48 object-cover;
}

.before-after-badge {
    @apply absolute top-4 left-4 px-3 py-1 rounded-lg font-bold text-sm text-white;
}

.badge-before {
    @apply bg-red-600;
}

.badge-after {
    @apply bg-green-600;
}

/* Hero Components */
.hero-overlay {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
}

.hero-content {
    @apply relative z-10 text-center max-w-4xl mx-auto px-4;
}

/* Navigation Components */
.nav-dropdown {
    @apply absolute top-full left-0 bg-white shadow-lg rounded-lg py-2 w-48 opacity-0 invisible;
    transition: all var(--transition-normal);
}

.nav-item:hover .nav-dropdown {
    @apply opacity-100 visible;
}

/* Form Components */
.form-group {
    @apply mb-6;
}

.form-label {
    @apply block text-benchmark-navy font-montserrat font-bold mb-2;
}

.form-input {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:border-benchmark-blue focus:ring-2 focus:ring-benchmark-blue focus:ring-opacity-20;
    transition: all var(--transition-normal);
}

.form-textarea {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:border-benchmark-blue focus:ring-2 focus:ring-benchmark-blue focus:ring-opacity-20 resize-vertical;
    min-height: 120px;
    transition: all var(--transition-normal);
}

/* Section Components */
.section-padding {
    @apply py-24;
}

.section-header {
    @apply text-center mb-16;
}

.section-title {
    @apply font-montserrat font-bold text-4xl text-benchmark-navy mb-4;
}

.section-subtitle {
    @apply text-xl text-gray-600 max-w-3xl mx-auto;
}

/* Trust Signal Components */
.trust-signals {
    @apply grid grid-cols-2 md:grid-cols-4 gap-8 items-center justify-items-center;
}

.trust-item {
    @apply text-center;
}

.trust-logo {
    @apply h-16 w-auto mx-auto mb-2 opacity-80;
    transition: opacity var(--transition-normal);
}

.trust-item:hover .trust-logo {
    @apply opacity-100;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

/* Mobile-first responsive utilities */
@media (max-width: 768px) {
    .section-title {
        @apply text-3xl;
    }
    
    .hero-content h1 {
        @apply text-4xl;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-outline {
        @apply text-base px-6 py-3;
    }
    
    .gallery-grid {
        @apply grid-cols-2;
    }
}

@media (max-width: 576px) {
    .section-padding {
        @apply py-16;
    }
    
    .hero-content h1 {
        @apply text-3xl;
    }
    
    .section-title {
        @apply text-2xl;
    }
    
    .gallery-grid {
        @apply grid-cols-1 gap-2;
    }
    
    .before-after-images {
        @apply grid-cols-1;
    }
    
    .before-after-image img {
        @apply h-32;
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Focus states for keyboard navigation */
.focus\:ring-benchmark:focus {
    @apply ring-2 ring-benchmark-blue ring-opacity-50;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        @apply border border-gray-300;
    }
    
    .btn-primary {
        @apply border-2 border-benchmark-navy;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU acceleration for smooth animations */
.gallery-item,
.card,
.btn-primary,
.btn-secondary {
    transform: translateZ(0);
    will-change: transform;
}

/* Optimize font loading */
@font-display: swap;

/* ============================================
   CUSTOM SCROLLBAR (Webkit browsers)
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    @apply bg-gray-100;
}

::-webkit-scrollbar-thumb {
    @apply bg-benchmark-blue rounded-full;
}

::-webkit-scrollbar-thumb:hover {
    @apply bg-benchmark-navy;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        color: black !important;
        background: white !important;
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid black !important;
        color: black !important;
        background: white !important;
    }
}