:root {
    --primary: #171717;
    /* Industrial Black */
    --primary-light: #262626;
    /* Dark Grey */
    --accent: #fbbf24;
    /* Construction Yellow */
    --accent-hover: #f59e0b;
    /* Amber/Orange Yellow */
    --bg: #e5e5e5;
    /* Industrial Grey Background */
    --white: #ffffff;
    --text: #171717;
    --text-light: #525252;
    --border: #404040;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --glass: rgba(23, 23, 23, 0.9);
    --glass-border: rgba(251, 191, 36, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-top: 80px;
}

/* Header & Navigation */
header {
    background: var(--primary);
    border-bottom: 4px solid #ffffff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    width: 100%;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo img {
    height: 56px;
    width: auto;
    display: block;
}

.header-search {
    margin-left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-search .search-input {
    width: 520px;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(0,0,0,0.1);
    background: #ffffff;
    color: var(--primary);
    font-size: 0.95rem;
}

.header-search .search-input::placeholder {
    color: rgba(0,0,0,0.4);
}

.header-search .search-btn {
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    color: var(--primary);
    border: none;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #000000 0%, #262626 100%);
    color: var(--white);
    padding: 6rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--accent);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.hero p {
    color: #fbbf24;
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 3rem;
    font-weight: 600;
}

/* Search Interface */
.search-container {
    max-width: 650px;
    margin: 0 auto;
    display: flex;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    border-radius: 1rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    font-size: 1.1rem;
    background: var(--white);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.search-btn {
    background-color: var(--accent);
    color: #000000;
    border: none;
    padding: 0 2rem;
    border-radius: 0.5rem;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.search-btn:hover {
    background-color: var(--accent-hover);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 1);
}

/* Main Grid & Cards */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.section-header {
    margin-bottom: 2.5rem;
    padding-top: 2.5rem;
    border-top: 4px solid var(--accent);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.industry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.industry-card {
    background: var(--white);
    border-radius: 1.25rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    position: relative;
    height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Industry visual tiles (use gradients / patterns to avoid broken images) */
.industry-card {
    position: relative;
    color: var(--accent);
    min-height: 160px;
}

.industry-card h3 {
    position: absolute;
    left: 1.25rem;
    bottom: 1.25rem;
    margin: 0;
    color: #fbbf24;
    text-shadow: 0 3px 0 rgba(0,0,0,0.4);
    font-size: 1.35rem;
}

.industry-visual {
    width: 100%;
    height: 160px;
    display: block;
    border-radius: 1.25rem;
    background-size: cover;
    background-position: center;
    filter: saturate(1.05);
}

/* Specific visuals */
.visual-heavy {
    background: url('/static/images/industry_heavy.jpg') center/cover no-repeat;
}
.visual-extraction {
    background: url('/static/images/industry_extraction_mining.jpg') center/cover no-repeat;
}
.visual-landscape {
    background: url('/static/images/industry_landscape.jpg') center/cover no-repeat;
}
.visual-plumbing { background: url('/static/images/industry_plumbing.jpg') center/cover no-repeat; }
.visual-hvac { background: url('/static/images/industry_hvac.jpg') center/cover no-repeat; }
.visual-electrical { background: url('/static/images/industry_electrical.jpg') center/cover no-repeat; }
.visual-framing { background: url('/static/images/industry_framing.jpg') center/cover no-repeat; }
.visual-finishes { background: url('/static/images/industry_finishes.jpg') center/cover no-repeat; }
.visual-carpentry { background: url('/static/images/industry_carpentry.jpg') center/cover no-repeat; }
.visual-masonry { background: url('/static/images/industry_masonry.jpg') center/cover no-repeat; }
.visual-mechanical { background: url('/static/images/industry_mechanical.jpg') center/cover no-repeat; }
.visual-finishing { background: url('/static/images/industry_finishing.jpg') center/cover no-repeat; }
.visual-cleaning { background: url('/static/images/industry_cleaning.jpg') center/cover no-repeat; }
.visual-misc { background: url('/static/images/industry_misc.jpg') center/cover no-repeat; }

.industry-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.industry-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: brightness(0.7) contrast(1.1);
    transition: transform 0.6s ease;
}

.industry-card:hover img {
    transform: scale(1.1);
    filter: brightness(0.8);
}

/* Redirect modal */
#redirectModal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
}

#redirectModal[aria-hidden="true"] {
    display: none;
}

#redirectModal .modal-content {
    background: var(--white);
    padding: 1.25rem;
    border-radius: 0.5rem;
    max-width: 520px;
    width: 100%;
    box-shadow: var(--shadow);
    text-align: left;
}

#redirectModal h3 { margin-bottom: 0.5rem; }
#redirectModal p { margin: 0; }

.industry-card h3 {
    position: relative;
    z-index: 2;
    color: var(--accent);
    padding: 1.5rem;
    margin: 0;
    font-size: 1.4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 1);
}

.card-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(45deg,
            #171717,
            #171717 20px,
            #262626 20px,
            #262626 40px);
    z-index: 0;
}

.fallback-yellow {
    background: repeating-linear-gradient(45deg,
            var(--accent),
            var(--accent) 30px,
            #171717 30px,
            #171717 60px);
    opacity: 0.3;
}

.industry-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.8), transparent);
    z-index: 1;
}

/* Results Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.card-body {
    padding: 1.5rem;
}

.tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: var(--accent);
    color: #000000;
    font-size: 0.8rem;
    font-weight: 800;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid #000000;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--primary);
    line-height: 1.4;
}

.card-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* Details Table */
.table-container {
    background: var(--white);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f8fafc;
    padding: 1.25rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--primary);
}

tr:hover td {
    background-color: #f8fafc;
}

.price {
    font-family: 'Roboto Mono', monospace;
    font-weight: 800;
    font-size: 1.2rem;
    color: #b45309;
    /* Deep Orange/Brown for price */
}

.btn-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 800;
    border-radius: 0.4rem;
    background-color: var(--accent);
    color: #000000;
    text-decoration: none;
    transition: all 0.2s ease;
    text-transform: uppercase;
    border: 1px solid #000000;
}

.btn-sm:hover {
    background-color: var(--accent-hover);
    transform: translate(2px, 2px);
    box-shadow: none;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-style: italic;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .search-container {
        flex-direction: column;
        background: transparent;
        padding: 0;
        border: none;
    }

    .search-btn {
        padding: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.industry-card {
    animation: fadeIn 0.5s ease forwards;
}