/* CatastrophicInjury.org Main Styles */
/* Professional, clean design for law firm directory */

/* Custom CSS Variables */
:root {
    --primary-red: #dc2626;
    --primary-red-dark: #b91c1c;
    --primary-red-light: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--gray-700);
}

/* Utility Classes */
.line-clamp-5 {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* Navigation */
nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
}

nav a {
    transition: all 0.2s ease;
}

nav a:hover {
    color: var(--primary-red);
    transform: translateY(-1px);
}
/* ===== Hover-Reveal Buttons ===== */
.hover-button {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.hover-container:hover .hover-button {
    opacity: 1;
    pointer-events: auto;
}

/* ===== CSV Upload Hover Area ===== */
.csv-upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    position: relative;
}

.csv-upload-area:hover {
    border-color: #888;
    background-color: #f9f9f9;
}

.csv-controls {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.csv-upload-area:hover .csv-controls {
    opacity: 1;
    pointer-events: auto;
}


/* Hero Section with Image */
#hero-section {
    position: relative;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)), 
                url("../assets/hero-law-background.png") no-repeat center center/cover;
}

#hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* dark overlay to keep white text readable */
    background: rgba(0, 0, 0, 0.55);
    z-index: 1;
}

#hero-section .relative {
    position: relative;
    z-index: 50;
    color: white;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    width: 100%;
    padding: 0 2rem;
}

#hero-section h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

#hero-section p {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    line-height: 1.4;
    margin-bottom: 2rem;
}


/* Buttons */
.btn-primary {
    background-color: var(--primary-red);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-700);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: var(--gray-300);
    transform: translateY(-1px);
}

/* Cards */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    border-color: var(--primary-red-light);
}

/* Form Elements */
input, select, textarea {
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.2s ease;
    background-color: white;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Search Section */
#search-section .bg-gray-100 {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
}

/* Statistics Section */
.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-red);
    line-height: 1;
}

.stat-label {
    color: var(--gray-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

/* Practice Area Tags */
.practice-tag {
    display: inline-block;
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--primary-red);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.125rem;
    transition: all 0.2s ease;
}

.practice-tag:hover {
    background-color: var(--primary-red);
    color: white;
    transform: scale(1.05);
}

/* Loading States */
.loading-spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-red);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
footer {
    background: var(--gray-900);
    color: var(--gray-300);
    border-top: 1px solid var(--gray-800);
}

footer a {
    color: var(--gray-300);
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--primary-red-light);
}

/* Admin Dashboard Styles */
.admin-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.admin-card:hover {
    box-shadow: var(--shadow-lg);
}

.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.upload-zone:hover {
    border-color: var(--primary-red);
    background-color: rgba(220, 38, 38, 0.02);
}

.upload-zone.dragover {
    border-color: var(--primary-red);
    background-color: rgba(220, 38, 38, 0.05);
}

/* Modal Styles */
.modal {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    overflow-y: auto;
}

/* Table Styles */
.admin-table {
    border-collapse: separate;
    border-spacing: 0;
}

.admin-table th {
    background-color: var(--gray-50);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    color: var(--gray-600);
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.admin-table tr:hover {
    background-color: var(--gray-50);
}

/* Status Indicators */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-green { background-color: #10b981; }
.status-yellow { background-color: #f59e0b; }
.status-red { background-color: #ef4444; }

/* ==========================================================================
   State Directory Matrix Layout (Added 2026 for Geo/SEO Backing)
   ========================================================================== */
.state-directory-section {
    padding: 2.25rem 1.25rem;
    background-color: var(--gray-100);
    border-top: 1px solid var(--gray-200);
}

.state-directory-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 0.75rem;
}

.state-directory-title {
    font-size: 1.2rem;
    color: var(--gray-900);
    margin: 0;
    font-weight: 700;
    line-height: 1.3;
}

.state-hub-link {
    font-size: 0.875rem;
    color: #2b6cb0; /* Styled explicitly or replace with a custom variable if available */
    text-decoration: none;
    font-weight: 600;
    transition: text-decoration 0.2s ease;
}

.state-hub-link:hover {
    text-decoration: underline;
}

.state-directory-description {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
    max-width: 900px;
    line-height: 1.5;
}

.state-directory-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.5rem 0.875rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.state-link {
    font-size: 0.875rem;
    color: var(--gray-600);
    text-decoration: none;
    display: block;
    line-height: 1.4;
    padding: 0.125rem 0;
    transition: color 0.2s ease;
}

.state-link:hover {
    color: var(--primary-red);
    text-decoration: underline;
}

.state-link:focus,
.state-hub-link:focus {
    outline: 2px solid var(--primary-red-light);
    outline-offset: 2px;
}

/* Explicit data mapping weight assignment for major legal hubs */
.state-link[data-priority="high"] {
    font-weight: 700;
    color: var(--gray-900);
}

/* Responsive Grid Breakpoints matching standard layout viewports */
@media (min-width: 480px) { .state-directory-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .state-directory-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .state-directory-grid { grid-template-columns: repeat(5, 1fr); } }


/* Responsive Design */
@media (max-width: 768px) {
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    #hero-section h1 {
        font-size: 2.5rem;
    }
    
    #hero-section p {
        font-size: 1.25rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    nav, footer, .btn-primary, .btn-secondary {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Utility Classes for Spacing */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }


/* Logo Container - INSIDE hero section */
#logo-container {
    position: absolute;
    top: -30px; /* Move UP significantly */
    left: 20px;
    z-index: 2;
    display: flex;
    align-items: center;
    text-decoration: none;
}

#logo-container img {
    height: 150px !important; /* Larger size */
    width: auto !important;
    display: block;
    object-fit: contain;
    transition: transform 0.2s ease;
    opacity: 1 !important;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.8)) 
            brightness(1.2) 
            contrast(1.3)
            saturate(1.4); /* More saturation for strength */
}

#logo-container:hover img {
    transform: scale(1.15);
    filter: drop-shadow(0 8px 16px rgba(0,0,0,1)) 
            brightness(1.3) 
            contrast(1.4)
            saturate(1.6);
}

/* Responsive logo size */
@media (max-width: 768px) {
    #logo-container {
        top: -15px; /* Less push up on mobile */
    }
    #logo-container img {
        height: 100px !important;
    }
}


/* Hero Background Animation */
.hero-bg {
    background: linear-gradient(-45deg, #1f2937, #374151, #1f2937, #4b5563);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Contact Button Hover Effect */
.contact-lawyer-btn:hover {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.3);
}

/* Filter Section */
.filter-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}

/* Results Counter */
.results-counter {
    background: linear-gradient(135deg, #fefefe 0%, #f8fafc 100%);
    border-left: 4px solid var(--primary-red);
}

/* Load More Button */
.load-more-btn {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px dashed #d1d5db;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    border-color: var(--primary-red);
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: var(--primary-red);
}

/* State and City Dropdown Styling */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Practice Area Dropdown Specific Styling */
#practice-filter {
    background-color: white;
    border-color: var(--gray-300);
}

#practice-filter:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Mobile Hero Adjustments */
@media (max-width: 768px) {
    #hero-section {
        min-height: 400px;
        padding: 3rem 0;
    }
    
    #hero-section h1 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    #hero-section p {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }
}

/* Search Section Improvements */
#search-section {
    padding: 4rem 0;
}

#search-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

#search-section p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

/* Filter Grid Layout */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Results Section */
.results-section {
    margin-top: 2rem;
}

/* Card Grid Improvements */
#lawyer-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Card Styling Improvements */
.lawyer-card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.lawyer-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    border-color: var(--primary-red-light);
}

/* Practice Area Tags in Cards */
.practice-area-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.practice-area-tag {
    background: rgba(220, 38, 38, 0.1);
    color: var(--primary-red);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.practice-area-tag:hover {
    background: var(--primary-red);
    color: white;
    transform: scale(1.05);
}

/* Contact Button Styling */
.contact-button {
    background: var(--primary-red);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.contact-button:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* View Profile Button */
.view-profile-button {
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.view-profile-button:hover {
    background: var(--gray-300);
    transform: translateY(-1px);
}

/* Statistics Section Improvements */
.stats-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-red);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

/* Footer Improvements */
footer {
    background: var(--gray-900);
    color: var(--gray-300);
    border-top: 1px solid var(--gray-800);
    padding: 3rem 0 2rem;
}

.footer-content {
    text-align: center;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-description {
    color: var(--gray-400);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.footer-links {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-red-light);
}

/* Responsive Design Improvements */
@media (max-width: 1024px) {
    #lawyer-cards {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    #lawyer-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-item {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        border-width: 0.5px;
    }
    
    .practice-area-tag {
        border-radius: 9999px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #162035;
        --gray-100: #1f2937;
        --gray-200: #374151;
        --gray-300: #4b5563;
        --gray-400: #6b7280;
        --gray-500: #9ca3af;
        --gray-600: #d1d5db;
        --gray-700: #e5e7eb;
        --gray-800: #f3f4f6;
        --gray-900: #f9fafb;
    }
    
    body {
        background-color: var(--gray-50);
        color: var(--gray-800);
    }
    
    .card {
        background-color: var(--gray-100);
        border-color: var(--gray-300);
    }
    
    nav {
        background-color: rgba(17, 24, 39, 0.95);
    }
    /* Legal Chatbot Styles */
#legal-chatbot { font-family: 'Inter', sans-serif; }
#chat-window { 
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); 
    border: 1px solid #e5e7eb;
}
.quick-question { 
    transition: all 0.2s ease; 
    cursor: pointer;
}

}

/* Contact Button Styling */
.contact-button {
    background: var(--primary-red);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
}

/* 50-State Directory Footer Styles */
.state-directory-section {
    padding: 36px 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #e2e8f0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.state-directory-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}

.state-directory-title {
    font-size: 1.2rem;
    color: #1a202c;
    margin: 0;
    font-weight: 700;
    line-height: 1.3;
}

.state-hub-link {
    font-size: 0.875rem;
    color: #2b6cb0;
    text-decoration: none;
    font-weight: 600;
}

.state-hub-link:hover {
    text-decoration: underline;
}

.state-directory-description {
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 16px;
    max-width: 900px;
    line-height: 1.5;
}

.state-directory-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 8px 14px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.state-link {
    font-size: 0.875rem;
    color: #4a5568;
    text-decoration: none;
    display: block;
    line-height: 1.4;
    padding: 2px 0;
}

.state-link:hover {
    color: #2b6cb0;
    text-decoration: underline;
}

.state-link:focus,
.state-hub-link:focus {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
}

.state-link[data-priority="high"] {
    font-weight: 700;
    color: #1a202c;
}

@media (min-width: 480px) { .state-directory-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .state-directory-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .state-directory-grid { grid-template-columns: repeat(5, 1fr); } }
/* Tablet styles */
@media (max-width: 1024px) {
    .lawyers-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
        padding: 0 1.5rem;
    }
    
    .search-section {
        margin: 1.5rem;
        padding: 1.5rem;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .lawyers-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .search-section {
        margin: 1rem;
        padding: 1rem;
    }
    
    .search-filters {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    header {
        padding: 1.5rem 1rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .lawyer-card {
        padding: 1.25rem;
    }
    
    .lawyer-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .lawyer-name {
        font-size: 1.2rem;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    .lawyers-grid {
        padding: 0 0.5rem;
    }
    
    .search-section {
        margin: 0.5rem;
        padding: 1rem 0.75rem;
    }
    
    header h1 {
        font-size: 1.6rem;
    }
    
    .lawyer-card {
        padding: 1rem;
    }
    
    .practice-tag {
        font-size: 0.8rem;
        padding: 0.25rem 0.6rem;
    }
    
    .contact-item {
        font-size: 0.85rem;
    }
}

/* Large desktop styles */
@media (min-width: 1440px) {
    .lawyers-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
        max-width: 1400px;
    }
    
    .search-section {
        max-width: 1400px;
    }
}
/* ============================================
   CatastrophicInjury.org — Safe Upgrade Layer
   Load AFTER main.css and responsive.css
   File: upgrades-2026.css (FIXED - No footer breakage)
   ============================================ */

/* 
   STRATEGY: Everything here is ADDITIVE or OVERRIDING.
   Remove this file to instantly revert all changes.
   Zero risk to existing functionality.
*/


/* ─────────────────────────────────────────────
   1. FIX: Complete the truncated .contact-button 
   from main.css (line ~480 was cut off)
   ───────────────────────────────────────────── */
.contact-button {
    background: var(--primary-red);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.contact-button:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.contact-button:active {
    transform: scale(0.98);
    transition-duration: 0.05s;
}


/* ─────────────────────────────────────────────
   2. FIX: Remove persistent :focus outlines
   Replace with :focus-visible (keyboard-only)
   ───────────────────────────────────────────── */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}


/* ─────────────────────────────────────────────
   3. PERFORMANCE: content-visibility for cards
   Massive rendering speedup on large directories
   ───────────────────────────────────────────── */
.lawyer-card,
.card {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
    contain: layout style paint;
}

/* Disable content-visibility for cards above the fold 
   (first 3 cards typically visible without scroll) */
#lawyer-cards > *:nth-child(-n+3) {
    content-visibility: visible;
}


/* ─────────────────────────────────────────────
   4. UX: Button press states (micro-interaction)
   ───────────────────────────────────────────── */
.btn-primary:active,
.view-profile-button:active {
    transform: scale(0.98);
    transition-duration: 0.05s;
}


/* ─────────────────────────────────────────────
   5. /* ─────────────────────────────────────────────
   5. UX: Search section styling (NO sticky - preserves footer)
   Ribbon, badges, and all card features remain intact
   ───────────────────────────────────────────── */
#search-section {
    position: relative;
    background: white;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--gray-200);

}

/* Add shadow when scrolled */
#search-section.is-scrolled {
    box-shadow: var(--shadow-lg);
}


/* ─────────────────────────────────────────────
   6. LOADING: Skeleton screens (better than spinner)
   Use: <div class="skeleton skeleton-card"></div>
   ───────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(
        90deg, 
        var(--gray-100) 25%, 
        var(--gray-200) 50%, 
        var(--gray-100) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 0.75rem;
}

@keyframes skeleton-loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 420px;
    width: 100%;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
}

.skeleton-text.short  { width: 40%; }
.skeleton-text.medium { width: 70%; }
.skeleton-text.long   { width: 90%; }

.skeleton-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
}


/* ─────────────────────────────────────────────
   7. ACCESSIBILITY: Skip link for keyboard users
   Add to HTML: <a href="#search-section" class="skip-link">Skip to search</a>
   ───────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-red);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 0.5rem 0.5rem;
    font-weight: 600;
    text-decoration: none;
    z-index: 9999;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: none;
}


/* ─────────────────────────────────────────────
   8. UX: Smooth card entrance animations
   ───────────────────────────────────────────── */
#lawyer-cards > * {
    animation: card-enter 0.4s ease-out backwards;
}

#lawyer-cards > *:nth-child(1)  { animation-delay: 0.05s; }
#lawyer-cards > *:nth-child(2)  { animation-delay: 0.10s; }
#lawyer-cards > *:nth-child(3)  { animation-delay: 0.15s; }
#lawyer-cards > *:nth-child(4)  { animation-delay: 0.20s; }
#lawyer-cards > *:nth-child(5)  { animation-delay: 0.25s; }
#lawyer-cards > *:nth-child(6)  { animation-delay: 0.30s; }
#lawyer-cards > *:nth-child(7)  { animation-delay: 0.35s; }
#lawyer-cards > *:nth-child(8)  { animation-delay: 0.40s; }
#lawyer-cards > *:nth-child(9)  { animation-delay: 0.45s; }
#lawyer-cards > *:nth-child(10) { animation-delay: 0.50s; }
/* Beyond 10, no delay — keeps it snappy for large lists */

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ─────────────────────────────────────────────
   9. UX: Active filter pills (visual feedback)
   Add class "active-filter" via JS when filter applied
   ───────────────────────────────────────────── */
.active-filter {
    background: var(--primary-red) !important;
    color: white !important;
    position: relative;
    padding-right: 2rem !important;
}

.active-filter::after {
    content: "×";
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    cursor: pointer;
}


/* ─────────────────────────────────────────────
   10. UX: "Back to top" floating button
   Add to HTML: <button class="back-to-top" aria-label="Back to top">↑</button>
   ───────────────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 100px;      /* ← CHANGED: sits above chatbot */
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #dc2626;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 998;       /* ← CHANGED: lower than chatbot (999) */
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover {
    background: #b91c1c;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

.back-to-top:active {
    transform: translateY(0) scale(0.95);
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    animation: back-to-top-pulse 0.5s ease-out;
}

@keyframes back-to-top-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile adjustment - sits above chatbot on phones too */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 90px;   /* ← CHANGED: above mobile chatbot */
        right: 1.5rem;
        width: 44px;
        height: 44px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .back-to-top,
    .back-to-top.is-visible,
    .back-to-top:hover {
        transition: none;
        animation: none;
        transform: none;
    }
}


/* ─────────────────────────────────────────────
   11. TRUST: Verified badge styling
   Add: <span class="verified-badge">Verified</span>
   ───────────────────────────────────────────── */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #10b981;
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    line-height: 1;
}

.verified-badge::before {
    content: "✓";
    font-size: 0.875rem;
}


/* ─────────────────────────────────────────────
   12. TRUST: "Free Consultation" ribbon
   FIXED: Removed rotation that was causing overflow
   Add: <span class="consultation-ribbon">Free Consultation</span>
   ───────────────────────────────────────────── */
.consultation-ribbon {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: #10b981;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    z-index: 10;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    /* REMOVED: transform: rotate(45deg) - was causing layout issues */
}


/* ─────────────────────────────────────────────
   13. MOBILE: Better touch targets (48px min)
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .practice-tag,
    .practice-area-tag,
    .contact-button,
    .view-profile-button,
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Larger tap areas for filter dropdowns */
    select,
    input[type="text"] {
        min-height: 48px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    /* Fixed ribbon position on mobile */
    .consultation-ribbon {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
    }
}


/* ─────────────────────────────────────────────
   14. DARK MODE: Complete the broken implementation
   (Your current dark mode is nested inside #legal-chatbot)
   ───────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #0f172a;
        --gray-100: #1e293b;
        --gray-200: #334155;
        --gray-300: #475569;
        --gray-400: #64748b;
        --gray-500: #94a3b8;
        --gray-600: #cbd5e1;
        --gray-700: #e2e8f0;
        --gray-800: #f1f5f9;
        --gray-900: #f8fafc;
    }

    body {
        background-color: var(--gray-50);
        color: var(--gray-800);
    }

    .card,
    .lawyer-card,
    .admin-card {
        background-color: var(--gray-100);
        border-color: var(--gray-300);
    }

    nav {
        background: rgba(15, 23, 42, 0.95);
        border-bottom-color: var(--gray-300);
    }

    #search-section {
        background: rgba(15, 23, 42, 0.95);
        border-bottom-color: var(--gray-300);
    }

    input, select, textarea {
        background-color: var(--gray-100);
        border-color: var(--gray-300);
        color: var(--gray-800);
    }

    .practice-tag,
    .practice-area-tag {
        background: rgba(220, 38, 38, 0.2);
    }

    .skeleton {
        background: linear-gradient(
            90deg, 
            var(--gray-200) 25%, 
            var(--gray-300) 50%, 
            var(--gray-200) 75%
        );
    }

    .stats-section {
        background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
    }

    .filter-section {
        background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
        border-color: var(--gray-300);
    }

    .results-counter {
        background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
    }

    .admin-table th {
        background-color: var(--gray-200);
    }

    .admin-table tr:hover {
        background-color: var(--gray-200);
    }

    .upload-zone {
        border-color: var(--gray-300);
    }

    .upload-zone:hover {
        background-color: rgba(220, 38, 38, 0.05);
    }

    .modal-content {
        background: var(--gray-100);
    }

    footer {
        background: var(--gray-900);
        border-top-color: var(--gray-800);
    }
}


/* ─────────────────────────────────────────────
   15. UTILITY: Visually hidden (screen readers)
   ───────────────────────────────────────────── */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ─────────────────────────────────────────────
   16. UTILITY: Reduced motion respect
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    #lawyer-cards > * {
        animation: none;
    }

    .skeleton {
        animation: none;
        background: var(--gray-200);
    }

    .back-to-top {
        transition: none;
    }
}


/* ─────────────────────────────────────────────
   17. FIX: Ensure footer is always visible
   ───────────────────────────────────────────── */
footer {
    position: relative;
    clear: both;
    z-index: 1;
    margin-top: 0;
}
/* ─────────────────────────────────────────────
   19. BACK TO TOP BUTTON - Stylish version
   ───────────────────────────────────────────── */
.back-to-top {
        position: fixed;
    bottom: 100px;     /* ← CHANGE THIS (was 2rem or 32px) */
    right: 20px;       /* ← CHANGE THIS to match chatbot */
    /* rest of your styles stay exactly the same */
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #dc2626;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.back-to-top::before {
    content: "↑";
    font-size: 1.75rem;
    font-weight: 300;
    line-height: 1;
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.back-to-top:hover {
    background: #b91c1c;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

.back-to-top:active {
    transform: translateY(0) scale(0.95);
}

/* Optional: Add a subtle pulse animation when first visible */
.back-to-top.is-visible {
    animation: back-to-top-pulse 0.5s ease-out;
}

@keyframes back-to-top-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile adjustment */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 90px;   /* ← CHANGE THIS */
        right: 20px;    /* ← CHANGE THIS to match chatbot */
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }
    
    .back-to-top::before {
        font-size: 1.5rem;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .back-to-top,
    .back-to-top.is-visible,
    .back-to-top:hover {
        transition: none;
        animation: none;
        transform: none;
    }
}
