/* ==========================================================================
   Texas Contractors Directory - Main Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables / Design Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Colors */
    --primary: #B22234;
    --primary-dark: #8B1A28;
    --primary-light: #D64353;
    --secondary: #002868;
    --accent: #F4A460;
    
    /* Text Colors */
    --text-dark: #1a1a2e;
    --text-medium: #4a4a5a;
    --text-light: #6b7280;
    
    /* Background Colors */
    --bg-cream: #FDFBF7;
    --bg-white: #FFFFFF;
    --border-light: #E8E4DC;
    
    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-medium: 0 8px 30px rgba(0,0,0,0.1);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, .section-title {
    font-family: 'Playfair Display', serif;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
header {
    background: var(--bg-white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 26px;
    height: 26px;
    fill: white;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-dark);
}

.logo-text span {
    color: var(--primary);
}

nav {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-medium);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--primary);
}

.nav-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-contractor {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-dark);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-contractor:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 580px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.hero-image {
    position: absolute;
    right: 0;
    top: 0;
    width: 55%;
    height: 100%;
    background: linear-gradient(to right, #1a1a2e 0%, transparent 20%);
    background-size: cover;
    background-position: center;
}

.hero-content {
    position: relative;
    max-width: 1320px;
    margin: 0 auto;
    padding: 4rem 2rem;
    width: 100%;
}

.hero-text {
    max-width: 580px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.hero-badge svg {
    width: 18px;
    height: 18px;
    fill: var(--accent);
}

.hero-badge span {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 600;
    color: white;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.hero h1 span {
    color: var(--accent);
}

.hero p {
    color: rgba(255,255,255,0.75);
    font-size: 1.15rem;
    margin-bottom: 2rem;
}

/* --------------------------------------------------------------------------
   Search Form
   -------------------------------------------------------------------------- */
.search-form {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    display: flex;
    box-shadow: var(--shadow-medium);
    max-width: 850px;
    width: 100%;
}

.search-field {
    flex: 1.2;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-light);
}

.search-field:last-of-type {
    border-right: none;
    flex: 0.8;
}

.search-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.search-field input,
.search-field select {
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--text-dark);
    background: transparent;
    font-family: inherit;
    width: 100%;
}

.search-field input::placeholder {
    color: var(--text-light);
}

.search-field input.error {
    border-bottom: 2px solid #dc2626;
}

.error-message {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}

.btn-search {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 3.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin: 0.25rem;
    white-space: nowrap;
}

.btn-search:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Stats Bar
   -------------------------------------------------------------------------- */
.stats-bar {
    margin-top: 2.5rem;
    display: flex;
    gap: 2.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--accent);
}

.stat-info strong {
    display: block;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

.stat-info span {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
    max-width: 1320px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.section-subtitle {
    color: var(--text-light);
    margin-top: 0.5rem;
}

.see-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.2s;
}

.see-all:hover {
    gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   Featured Services Grid
   -------------------------------------------------------------------------- */
.services-featured {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.service-card-featured {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform 0.3s;
}

.service-card-featured:hover {
    transform: translateY(-4px);
}

.service-card-featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.service-card-featured:hover img {
    transform: scale(1.05);
}

.service-card-featured::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.service-card-featured h3 {
    position: absolute;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 1;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Services Icon Grid
   -------------------------------------------------------------------------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.service-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
}

.service-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-soft);
}

.service-card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.service-icon {
    width: 48px;
    height: 48px;
    background: rgba(178, 34, 52, 0.08);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--primary);
    stroke-width: 1.5;
    fill: none;
}

.service-card h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
}

.service-card .arrow {
    color: var(--text-light);
    transition: transform 0.2s, color 0.2s;
}

.service-card:hover .arrow {
    transform: translateX(4px);
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   Costs Section
   -------------------------------------------------------------------------- */
.costs-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 3rem;
    margin-top: 2rem;
}

.costs-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.cost-tab {
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    border: none;
    background: transparent;
    color: var(--text-medium);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.cost-tab.active {
    background: var(--text-dark);
    color: white;
}

.cost-tab:hover:not(.active) {
    background: var(--border-light);
}

.costs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* --------------------------------------------------------------------------
   Texas Cities Section
   -------------------------------------------------------------------------- */
.cities-section {
    background: linear-gradient(135deg, var(--secondary) 0%, #003580 100%);
    padding: 5rem 0;
    margin-top: 3rem;
}

.cities-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 2rem;
}

.cities-header {
    text-align: center;
    margin-bottom: 3rem;
}

.cities-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.25rem;
    color: white;
    margin-bottom: 0.75rem;
}

.cities-header p {
    color: rgba(255,255,255,0.7);
}

.cities-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.city-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}

.city-card:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-3px);
}

.city-card h4 {
    color: white;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.city-card span {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Articles / Inspiration
   -------------------------------------------------------------------------- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.article-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.article-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255,255,255,0.95);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.article-content {
    padding: 1.5rem;
}

.article-category {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.article-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   How It Works
   -------------------------------------------------------------------------- */
.how-section {
    background: var(--bg-white);
    padding: 5rem 0;
}

.how-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 2rem;
}

.how-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-top: 3rem;
}

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

.how-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
}

.how-icon::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px dashed var(--border-light);
    border-radius: 50%;
}

.how-icon svg {
    width: 36px;
    height: 36px;
    fill: white;
}

.how-number {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.how-step h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.how-step p {
    color: var(--text-light);
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Testimonials
   -------------------------------------------------------------------------- */
.testimonials {
    background: linear-gradient(180deg, var(--bg-cream) 0%, rgba(178, 34, 52, 0.03) 100%);
    padding: 5rem 0;
}

.testimonials-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 2rem;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.testimonial-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

.testimonial-stars {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.testimonial-stars svg {
    width: 18px;
    height: 18px;
    fill: #F59E0B;
}

.testimonial-card p {
    color: var(--text-medium);
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.author-info strong {
    display: block;
    color: var(--text-dark);
    font-weight: 600;
}

.author-info span {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   CTA Section
   -------------------------------------------------------------------------- */
.cta-section {
    background: var(--text-dark);
    padding: 4rem 0;
}

.cta-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cta-text h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: white;
    margin-bottom: 0.5rem;
}

.cta-text p {
    color: rgba(255,255,255,0.7);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: transparent;
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    border: 2px solid rgba(255,255,255,0.3);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: white;
    background: rgba(255,255,255,0.1);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
    background: #0f0f1a;
    padding: 4rem 0 2rem;
}

.footer-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-brand .logo-text {
    color: white;
}

.footer-brand p {
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.social-links a:hover {
    background: var(--primary);
}

.social-links svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.footer-column h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 0.75rem;
}

.footer-column a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom p {
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}

.footer-legal {
    display: flex;
    gap: 2rem;
}

.footer-legal a {
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-legal a:hover {
    color: white;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* --------------------------------------------------------------------------
   Responsive Styles
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .services-featured,
    .services-grid,
    .costs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cities-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .articles-grid,
    .how-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-image {
        opacity: 0.3;
        width: 100%;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-field {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    
    nav {
        display: none;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .cta-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .cities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .services-featured,
    .services-grid,
    .cities-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
}
