/* ========================================
   STATE SUBDOMAIN STYLES - ALL 50 STATES
   Shared CSS for all state pages
   ======================================== */

/* State Coverage Section */
.state-coverage {
    padding: 8rem 0;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.state-cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.state-city-card {
    background: var(--primary-white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition-medium);
}

.state-city-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.state-city-card i {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
}

.state-city-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-black);
}

.state-city-card ul {
    list-style: none;
    text-align: left;
}

.state-city-card ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.state-city-card ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-blue);
    font-weight: bold;
}

/* Hero Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    margin-bottom: 2rem;
    color: var(--primary-white);
    font-weight: 600;
}

.hero-badge i {
    color: var(--accent-light);
}

/* Software Section */
.software-section {
    padding: 6rem 0;
    background: var(--primary-black);
}

.software-section .section-tag {
    color: var(--accent-light);
}

.software-section .section-title {
    color: var(--primary-white);
}

.software-loop-section {
    overflow: hidden;
    padding: 2rem 0;
}

.software-track {
    display: flex;
    animation: softwareScroll 30s linear infinite;
    width: max-content;
}

.software-track:hover {
    animation-play-state: paused;
}

.software-item {
    flex-shrink: 0;
    padding: 0 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.software-item img {
    height: 60px;
    width: auto;
    filter: grayscale(100%) brightness(200%);
    transition: var(--transition-medium);
}

.software-item:hover img {
    filter: grayscale(0%) brightness(100%);
}

@keyframes softwareScroll {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* Samples Preview Section */
.samples-preview {
    padding: 8rem 0;
    background: var(--gray-light);
}

.samples-grid-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.sample-card {
    background: var(--primary-white);
    padding: 3rem 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-medium);
}

.sample-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.sample-card i {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
}

.sample-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-black);
}

.sample-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Hero Section with Image Stack */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #001a33 0%, #003366 50%, #004080 100%);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/Apex Accuracy Estimating - New Jersey Coverage.avif') center/cover no-repeat;
    opacity: 0.15;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 26, 51, 0.85), rgba(0, 51, 102, 0.9));
}

.hero-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

/* Hero Content Left */
.hero-content-left {
    text-align: left;
    max-width: 600px;
}

.hero-content-left .hero-badge {
    display: inline-flex;
    margin-bottom: 1.5rem;
}

.hero-content-left .hero-cta {
    justify-content: flex-start;
}

.hero-content-left .hero-stats {
    justify-content: flex-start;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 2rem;
    margin-top: 2rem;
}

/* Image Stack Animation */
.hero-stack {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 500px;
    perspective: 1500px;
    margin-left: auto;
}

.stack-card {
    position: absolute;
    width: 320px;
    height: 220px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation: stackMove 6s ease-in-out infinite;
    animation-delay: calc(var(--i) * 1s);
    border: 3px solid rgba(255,255,255,0.3);
}

.stack-card:nth-child(1) {
    top: 0;
    right: 80px;
    z-index: 5;
    transform: rotate(-3deg);
}

.stack-card:nth-child(2) {
    top: 50px;
    right: 40px;
    z-index: 4;
    transform: rotate(2deg) scale(0.95);
    animation-delay: 1s;
}

.stack-card:nth-child(3) {
    top: 100px;
    right: 0;
    z-index: 3;
    transform: rotate(-2deg) scale(0.9);
    animation-delay: 2s;
}

.stack-card:nth-child(4) {
    top: 150px;
    right: 60px;
    z-index: 2;
    transform: rotate(3deg) scale(0.85);
    animation-delay: 3s;
}

.stack-card:nth-child(5) {
    top: 200px;
    right: 20px;
    z-index: 1;
    transform: rotate(-1deg) scale(0.8);
    animation-delay: 4s;
}

.stack-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

/* Stack Hover Effects */
.hero-stack:hover .stack-card:nth-child(1) {
    transform: translateY(-30px) rotate(0deg) scale(1.05);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.hero-stack:hover .stack-card:nth-child(2) {
    transform: translateY(-10px) rotate(0deg) scale(0.98);
}

.hero-stack:hover .stack-card:nth-child(3) {
    transform: translateY(10px) rotate(0deg) scale(0.95);
}

.hero-stack:hover .stack-card:nth-child(4) {
    transform: translateY(30px) rotate(0deg) scale(0.92);
}

.hero-stack:hover .stack-card:nth-child(5) {
    transform: translateY(50px) rotate(0deg) scale(0.88);
}

.hero-stack:hover .stack-card img {
    transform: scale(1.15);
}

/* Continuous Moving Animation */
@keyframes stackMove {
    0%, 100% {
        transform: translateY(0) rotate(var(--rotate, -3deg)) scale(var(--scale, 1));
    }
    25% {
        transform: translateY(-15px) rotate(calc(var(--rotate, -3deg) + 1deg)) scale(calc(var(--scale, 1) + 0.02));
    }
    50% {
        transform: translateY(-25px) rotate(var(--rotate, -3deg)) scale(var(--scale, 1));
    }
    75% {
        transform: translateY(-10px) rotate(calc(var(--rotate, -3deg) - 1deg)) scale(calc(var(--scale, 1) - 0.01));
    }
}

.stack-card:nth-child(1) { --rotate: -3deg; --scale: 1; }
.stack-card:nth-child(2) { --rotate: 2deg; --scale: 0.95; }
.stack-card:nth-child(3) { --rotate: -2deg; --scale: 0.9; }
.stack-card:nth-child(4) { --rotate: 3deg; --scale: 0.85; }
.stack-card:nth-child(5) { --rotate: -1deg; --scale: 0.8; }

.hero-title {
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-title span {
    display: block;
}

.hero-title span:first-child {
    font-weight: 700;
}

.hero-title span:last-child {
    color: var(--accent-light);
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.35rem;
    font-weight: 400;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

/* Enhanced Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-light);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* NJ Coverage Section Polish */
.state-city-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.5);
}

.state-city-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

.state-city-card i {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

/* About Section Enhancement */
.about-content {
    max-width: 1000px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.about-card {
    background: var(--primary-white);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 86, 179, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 86, 179, 0.1);
}

.about-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 86, 179, 0.15);
}

.about-card i {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.about-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--primary-black);
}

/* Services Grid Polish */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.5);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
}

.service-image {
    height: 200px;
    overflow: hidden;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-card:hover .service-image img {
    transform: scale(1.1);
}

.service-card h3 {
    padding: 1.5rem 1.5rem 0;
    font-size: 1.25rem;
    color: var(--primary-black);
}

.service-card ul {
    padding: 0 1.5rem;
    list-style: none;
}

.service-card ul li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
    padding-left: 1.25rem;
}

.service-card ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-blue);
    font-weight: bold;
}

.service-link {
    display: block;
    padding: 1.5rem;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    border-top: 1px solid var(--gray-light);
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.service-link:hover {
    background: var(--gray-light);
    padding-left: 2rem;
}

/* Why Choose Us Section - Perfect Polish */
.why-us {
    position: relative;
    padding: 10rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    overflow: hidden;
}

.why-us::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 86, 179, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.why-us::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 86, 179, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.feature-card {
    background: var(--primary-white);
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 86, 179, 0.08);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-blue), var(--accent-dark));
    transform: scaleY(0);
    transition: transform 0.4s ease;
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 86, 179, 0.15);
}

.feature-card:hover::before {
    transform: scaleY(1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-dark));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(0, 86, 179, 0.25);
}

.feature-icon i {
    font-size: 1.5rem;
    color: var(--primary-white);
}

.feature-number {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary-blue);
    opacity: 0.08;
    line-height: 1;
    font-family: 'Inter', sans-serif;
}

.feature-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--primary-black);
}

.feature-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
}

/* Samples Section Polish */
.sample-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.5);
}

.sample-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.sample-card i {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

/* Internal Links Section */
.internal-links-section {
    padding: 8rem 0;
    background: var(--primary-white);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.link-card {
    background: var(--gray-light);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: var(--transition-medium);
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.link-card h4 {
    color: var(--primary-black);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.link-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.link-card a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.link-card a:hover {
    color: var(--accent-dark);
}

/* Related States Section */
.related-states {
    padding: 6rem 0;
    background: var(--gray-light);
}

.states-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.state-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-blue);
    color: var(--primary-white);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition-medium);
}

.state-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 86, 179, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .state-cities-grid {
        grid-template-columns: 1fr;
    }

    .software-item img {
        height: 40px;
    }

    .hero-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-stack {
        display: none;
    }

    .hero-content-left {
        text-align: center;
    }

    .hero-content-left .hero-cta {
        justify-content: center;
    }

    .hero-content-left .hero-stats {
        justify-content: center;
    }

    .about-features {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }

    .samples-grid-preview {
        grid-template-columns: 1fr;
    }
}

/* Section Background Images */
.state-coverage {
    position: relative;
    padding: 10rem 0;
    background: url('../images/Apex Accuracy Estimating - New Jersey Coverage.avif') center/cover no-repeat;
}

.state-coverage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.46), rgba(0, 50, 120, 0.44));
    z-index: 1;
}

.state-coverage .container {
    position: relative;
    z-index: 2;
}

.state-coverage .section-title,
.state-coverage .section-subtitle {
    color: var(--primary-white);
}

.state-coverage .section-tag {
    background: rgba(255,255,255,0.2);
    color: var(--primary-white);
}

/* About Section with Background */
.about {
    position: relative;
    padding: 10rem 0;
    background: url('../images/Apex Accuracy Estimating - About Us.avif') center/cover no-repeat;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.92));
    z-index: 1;
}

.about .container {
    position: relative;
    z-index: 2;
}

/* Services Section with Background */
.services {
    position: relative;
    padding: 10rem 0;
    background: url('../images/Apex Accuracy Estimating - Our Services.avif') center/cover no-repeat;
}

.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.46), rgba(0, 50, 120, 0.45));
    z-index: 1;
}

.services .container {
    position: relative;
    z-index: 2;
}

.services .section-title,
.services .section-subtitle {
    color: var(--primary-white);
}

.services .section-tag {
    background: rgba(255,255,255,0.2);
    color: var(--primary-white);
}

/* Samples Preview Section with Background */
.samples-preview {
    position: relative;
    padding: 10rem 0;
    background: url('../images/Apex Accuracy Estimating - Sample Estimates.avif') center/cover no-repeat;
}

.samples-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.94));
    z-index: 1;
}

.samples-preview .container {
    position: relative;
    z-index: 2;
}

/* Contact Section with Background */
.contact {
    position: relative;
    padding: 10rem 0;
    background: url('../images/Apex Accuracy Estimating - Contact us.avif') center/cover no-repeat;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.47), rgba(0, 50, 120, 0.45));
    z-index: 1;
}

.contact .container {
    position: relative;
    z-index: 2;
}

.contact .section-title,
.contact .section-subtitle {
    color: var(--primary-white);
}

.contact .section-tag {
    background: rgba(255,255,255,0.2);
    color: var(--primary-white);
}

/* Adjust cards for dark backgrounds */
.state-city-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

.service-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

.sample-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

.info-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

/* Loading Screen Logo Fix */
#loading-screen .loading-logo {
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
    max-height: 120px !important;
    object-fit: contain;
}

/* Fix white sections - make visible by default */
.section-fade {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Samples with Unsplash Images */
.sample-image {
    height: 200px;
    overflow: hidden;
}

.sample-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
