/* P4C Main CSS - Component and Layout Styles */
/* Depends on design-tokens.css - ensure design-tokens.css is imported first */
/* Load this asynchronously after critical CSS */

/* ===========================
   ACCESSIBILITY STYLES
   =========================== */

/* High contrast mode */
.high-contrast {
  filter: contrast(1.5);
}

/* Reduced motion preferences */
.reduce-motion,
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* ===========================
   GLASSMORPHISM EFFECTS
   =========================== */

.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(11, 17, 32, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(11, 17, 32, 0.2);
}

/* ===========================
   HOVER EFFECTS
   =========================== */

.hover-lift {
    transition: all var(--duration-normal) ease-out;
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.hover-scale {
    transition: all var(--duration-normal) ease-out;
}
.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: all var(--duration-normal) ease-out;
}
.hover-glow:hover {
    box-shadow: 0 0 20px rgba(194, 142, 90, 0.5);
}

/* ===========================
   CARD STYLES
   =========================== */

.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all var(--duration-normal) ease-out;
}

.card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card.glass {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ===========================
   BUTTONS
   =========================== */

.btn {
    transition: all var(--duration-normal) ease-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #C28E5A 0%, #8B5E3C 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(194, 142, 90, 0.4);
}

.btn-secondary {
    background: rgba(5, 150, 105, 1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(5, 150, 105, 0.9);
    transform: translateY(-2px);
}

/* ===========================
   GRADIENT BACKGROUNDS
   =========================== */

.gradient-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e293b 100%);
}

.gradient-cta {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

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

/* Mobile-first responsive utilities */
@media (max-width: 475px) {
    .hidden-xs {
        display: none;
    }
}

@media (min-width: 476px) {
    .block-xs {
        display: block;
    }
}

/* Flexbox and grid utilities */
.flex {
    display: flex;
}

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

.justify-center {
    justify-content: center;
}

.grid {
    display: grid;
}

/* Spacing utilities */
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.p-4 { padding: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Text utilities */
.text-center { text-align: center; }
.font-bold { font-weight: 700; }

/* Background utilities */
.bg-white { background-color: white; }

/* Border utilities */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }

/* Shadow utilities */
.shadow-lg { box-shadow: var(--shadow-brand); }
.shadow-xl { box-shadow: var(--shadow-floating); }

/* Color utilities */
.text-white { color: white; }
.text-gray-600 { color: #4b5563; }
.text-gray-800 { color: #1f2937; }

/* ===========================
   DYNAMIC CONTENT CONTAINERS
   =========================== */

.dynamic-gallery {
    min-height: 200px;
    transition: opacity 0.3s ease;
}

.dynamic-gallery.loading {
    opacity: 0.7;
}

.image-container {
    position: relative;
    overflow: hidden;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.image-container:hover .image-overlay {
    transform: translateY(0);
}

/* ===========================
   MODULE STYLES
   =========================== */

.property-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.property-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.veteran-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #059669;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.section-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===========================
   Mobile Menu Logic
   =========================== */
/* Overrides Tailwind 'hidden' / 'opacity-0' when active class is present */
#mobile-menu.active {
    max-height: 100vh !important; /* Expand to full height */
    opacity: 1 !important;        /* Make visible */
    visibility: visible !important;
    transform: translateY(0) !important; /* Slide down into place */
    display: block !important;
}

/* Mobile menu spacing and typography improvements */
#mobile-menu {
    padding: 1rem; /* Add padding around the entire menu */
}

/* Reduce font size and adjust spacing for mobile */
@media (max-width: 768px) {
    #mobile-menu {
        font-size: 0.875rem; /* text-sm equivalent */
    }

    #mobile-menu a,
    #mobile-menu button {
        font-size: 0.875rem; /* text-sm */
        padding: 0.75rem 1rem; /* Reduce padding from px-4 py-3 */
    }

    /* Add spacing between sections */
    #mobile-menu .menu-section {
        margin-bottom: 1rem;
    }

    /* Add separators between sections */
    #mobile-menu .menu-section ~ .menu-section {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 1rem;
    }

    /* Improve button styling and spacing */
    #mobile-menu .menu-cta {
        margin-top: 1rem;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* ===========================
   Navigation Active States
   =========================== */

/* Desktop navigation active state */
nav a.active {
  background-color: rgba(194, 142, 90, 0.2);
  color: var(--color-accent-gold);
  border-bottom: 3px solid var(--color-accent-gold);
  font-weight: 600;
}

nav a.active:hover {
    background: rgba(194, 142, 90, 0.25);
}

/* Mobile menu navigation active state */
#mobile-menu a.active {
    background: rgba(194, 142, 90, 0.2) !important;
    border-left: 4px solid var(--color-accent-gold) !important;
    font-weight: 600;
    color: var(--color-accent-gold) !important;
    margin-left: -4px; /* Compensate for border */
}

#mobile-menu a.active:hover {
    background: rgba(194, 142, 90, 0.25) !important;
}
