/* Vanguard Protective Group - Main CSS */
/* Optimized for performance, accessibility, and conversion */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #f3f4f6;
    background-color: #000000;
    overflow-x: hidden;
}

/* Custom Properties for Consistent Theming */
:root {
    --primary-amber: #F59E0B;
    --primary-amber-hover: #D97706;
    --bg-black: #000000;
    --bg-gray-900: #111827;
    --bg-gray-800: #1F2937;
    --border-gray-700: #374151;
    --border-gray-800: #1F2937;
    --text-white: #FFFFFF;
    --text-gray-100: #F3F4F6;
    --text-gray-300: #D1D5DB;
    --text-gray-400: #9CA3AF;
    --text-gray-500: #6B7280;
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition-all: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    margin-bottom: 1rem;
}

/* Utility Classes */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Navigation Styles */
nav {
    transition: var(--transition-all);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-link {
    position: relative;
    transition: var(--transition-all);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background-color: var(--primary-amber);
    transition: var(--transition-all);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile Menu */
#mobile-menu {
    transition: var(--transition-all);
    transform: translateY(-100%);
    opacity: 0;
}

#mobile-menu.show {
    transform: translateY(0);
    opacity: 1;
}

/* Emergency Banner */
#emergency-banner {
    position: relative;
    z-index: 60;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #000000 0%, #111827 50%, #000000 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Trust Signals */
.trust-signals {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.trust-signal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid var(--border-gray-700);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition-all);
}

.trust-signal:hover {
    border-color: var(--primary-amber);
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: var(--transition-all);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    line-height: 1.5;
    min-height: 44px; /* Accessibility: minimum touch target */
}

.btn-primary {
    background-color: var(--primary-amber);
    color: var(--bg-black);
}

.btn-primary:hover {
    background-color: var(--primary-amber-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-amber);
    border: 2px solid var(--primary-amber);
}

.btn-secondary:hover {
    background-color: var(--primary-amber);
    color: var(--bg-black);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Service Cards */
.service-card {
    background: var(--bg-black);
    border: 1px solid var(--border-gray-700);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: var(--transition-all);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    border-color: var(--primary-amber);
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: var(--transition-all);
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-title {
    color: var(--text-white);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.service-description {
    color: var(--text-gray-400);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.service-features {
    list-style: none;
    margin-bottom: 1.5rem;
}

.service-features li {
    color: var(--text-gray-500);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.service-link {
    color: var(--primary-amber);
    font-weight: 600;
    text-decoration: none;
    margin-top: auto;
    transition: var(--transition-all);
}

.service-link:hover {
    color: var(--primary-amber-hover);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-gray-300);
    margin-bottom: 0.5rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-black);
    border: 1px solid var(--border-gray-700);
    border-radius: 0.5rem;
    color: var(--text-white);
    font-size: 1rem;
    transition: var(--transition-all);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary-amber);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.form-input::placeholder {
    color: var(--text-gray-500);
}

/* Quote Form Specific */
.quote-form {
    background: var(--bg-gray-900);
    border: 1px solid var(--border-gray-700);
    border-radius: 0.5rem;
    padding: 2rem;
}

/* Testimonial Cards */
.testimonial-card {
    background: var(--bg-black);
    border: 1px solid var(--border-gray-700);
    border-radius: 0.5rem;
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.testimonial-rating {
    color: var(--primary-amber);
    margin-bottom: 1rem;
}

.testimonial-text {
    color: var(--text-gray-300);
    font-style: italic;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.testimonial-author {
    color: var(--primary-amber);
    font-weight: 600;
}

.testimonial-company {
    color: var(--text-gray-500);
    font-size: 0.875rem;
}

/* Location Cards */
.location-card {
    background: var(--bg-black);
    border: 1px solid var(--border-gray-700);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: var(--transition-all);
}

.location-card:hover {
    border-color: var(--primary-amber);
}

.location-title {
    color: var(--primary-amber);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.location-list {
    list-style: none;
}

.location-list li {
    color: var(--text-gray-400);
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: var(--bg-black);
    border-top: 1px solid var(--border-gray-800);
}

.footer-section h3 {
    color: var(--text-white);
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-link {
    color: var(--text-gray-400);
    text-decoration: none;
    transition: var(--transition-all);
    display: block;
    margin-bottom: 0.5rem;
}

.footer-link:hover {
    color: var(--primary-amber);
}

/* Responsive Grid System */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Spacing Utilities */
.py-20 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.mb-16 {
    margin-bottom: 4rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

/* Performance Optimizations */
img {
    max-width: 100%;
    height: auto;
}

/* Critical path loading optimization */
.above-fold {
    will-change: transform;
}

/* Smooth scrolling for anchor links */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Focus indicators for accessibility */
*:focus {
    outline: 2px solid var(--primary-amber);
    outline-offset: 2px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-amber);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .service-card,
    .testimonial-card,
    .location-card {
        border-width: 2px;
    }
    
    .btn {
        border-width: 2px;
        border-style: solid;
    }
    
    .btn-primary {
        border-color: var(--primary-amber);
    }
}

/* Print styles */
@media print {
    .no-print,
    nav,
    footer,
    #emergency-banner {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .service-card,
    .testimonial-card {
        border: 1px solid #000 !important;
        break-inside: avoid;
    }
}

/* Animation utilities */
.animate-bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: none;
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive typography */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    
    .hero-section p {
        font-size: 1.125rem;
    }
    
    .trust-signals {
        flex-direction: column;
        align-items: stretch;
    }
    
    .trust-signal {
        justify-content: center;
        text-align: center;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-gray-900);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-amber-hover);
}

/* Selection styling */
::selection {
    background-color: var(--primary-amber);
    color: var(--bg-black);
}

::-moz-selection {
    background-color: var(--primary-amber);
    color: var(--bg-black);
}

/* Improved Box Alignment and Text Fitting */
.grid {
    align-items: stretch;
}

.grid > * {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Ensure consistent card heights */
.service-card, .contact-card, .feature-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 200px;
}

.service-card > *, .contact-card > *, .feature-card > * {
    flex-grow: 0;
}

.service-card p:last-of-type, 
.contact-card p:last-of-type, 
.feature-card p:last-of-type {
    flex-grow: 1;
    margin-bottom: auto;
}

/* Better text wrapping and overflow handling */
.text-wrap {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Responsive text sizing for better fitting */
@media (max-width: 768px) {
    .text-4xl {
        font-size: 2rem;
        line-height: 2.5rem;
    }
    
    .text-3xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
}

/* Ensure all grid items are same height */
.equal-height {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

/* Better button alignment */
.btn-container {
    margin-top: auto;
    padding-top: 1rem;
}
