/* ===================================================
   licensor.directory — styles.css
   Consultancy professional grid aesthetic
   =================================================== */

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

html {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #4B5563;
    background-color: #FFFFFF;
}

body {
    min-height: 100vh;
    background-image: radial-gradient(circle, #E5E7EB 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 1;
}

/* Dot grid at 50% opacity — applied via pseudo-element so it doesn't affect children */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, #E5E7EB 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

/* --- Sticky Header --- */
#site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 24px;
    background: #FFFFFF;
    border-bottom: 2px solid #111827;
}

.header-left {
    flex-shrink: 0;
}

.header-logo {
    font-weight: 700;
    font-size: 20px;
    color: #111827;
    letter-spacing: -0.02em;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 24px;
}

.search-wrapper {
    position: relative;
    width: 400px;
    max-width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

#search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 36px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    color: #111827;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    outline: none;
    transition: border-color 150ms;
}

#search-input::placeholder {
    color: #9CA3AF;
}

#search-input:focus {
    border-color: #111827;
}

.header-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.result-count {
    font-weight: 500;
    font-size: 12px;
    color: #9CA3AF;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: opacity 200ms;
}

.result-count.animating {
    opacity: 0.4;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    transition: background 150ms;
}

.filter-toggle:hover {
    background: #F9FAFB;
}

/* --- App Layout --- */
#app-layout {
    position: relative;
    display: flex;
    min-height: calc(100vh - 56px);
    z-index: 1;
}

/* --- Filter Sidebar --- */
#filter-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #F9FAFB;
    border-right: 1px solid #E5E7EB;
    padding: 20px;
    overflow-y: auto;
    height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sidebar-title {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: #111827;
    text-transform: uppercase;
}

.clear-all {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    color: #9CA3AF;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    transition: color 150ms;
}

.clear-all:hover {
    color: #4B5563;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group-label {
    display: block;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #111827;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.filter-checkbox,
.filter-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4B5563;
    cursor: pointer;
    padding: 4px 0;
}

.filter-checkbox input,
.filter-radio input {
    accent-color: #111827;
    cursor: pointer;
}

.filter-select {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    color: #4B5563;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

.filter-select:focus {
    border-color: #111827;
}

.sidebar-close {
    display: none;
    width: 100%;
    height: 40px;
    margin-top: 16px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
    background: #111827;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 49;
}

/* --- Main Content --- */
#main-content {
    flex: 1;
    padding: 24px;
    min-width: 0;
}

/* --- Directory Grid --- */
.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* --- Directory Card --- */
.directory-card {
    position: relative;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 16px 16px 16px 20px;
    overflow: hidden;
    transition: box-shadow 150ms, transform 200ms, opacity 200ms;
}

.directory-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 8px 0 0 8px;
    transition: width 150ms;
}

.directory-card:hover::before {
    width: 6px;
}

.directory-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Industry accent colors */
.directory-card[data-industry="technology"]::before { background: #2563EB; }
.directory-card[data-industry="entertainment"]::before { background: #7C3AED; }
.directory-card[data-industry="pharmaceutical"]::before { background: #059669; }
.directory-card[data-industry="manufacturing"]::before { background: #D97706; }

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.card-name {
    font-weight: 700;
    font-size: 18px;
    color: #111827;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.card-pill {
    flex-shrink: 0;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Pill colors by industry */
.card-pill[data-industry="technology"] {
    background: rgba(37, 99, 235, 0.1);
    color: #2563EB;
}
.card-pill[data-industry="entertainment"] {
    background: rgba(124, 58, 237, 0.1);
    color: #7C3AED;
}
.card-pill[data-industry="pharmaceutical"] {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}
.card-pill[data-industry="manufacturing"] {
    background: rgba(217, 119, 6, 0.1);
    color: #D97706;
}

.card-description {
    font-size: 14px;
    color: #4B5563;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.card-metrics {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-label {
    font-size: 10px;
    font-weight: 500;
    color: #9CA3AF;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.metric-value {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-bar {
    display: inline-block;
    width: 40px;
    height: 4px;
    background: #E5E7EB;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.metric-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 2px;
}

.metric-bar-fill[data-industry="technology"] { background: #2563EB; }
.metric-bar-fill[data-industry="entertainment"] { background: #7C3AED; }
.metric-bar-fill[data-industry="pharmaceutical"] { background: #059669; }
.metric-bar-fill[data-industry="manufacturing"] { background: #D97706; }

.territory-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    font-size: 10px;
    font-weight: 700;
    color: #4B5563;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
}

.view-profile {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #4B5563;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: color 200ms;
    background: none;
    border: none;
    padding: 0;
}

.view-profile::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: #111827;
    transition: width 200ms;
}

.directory-card:hover .view-profile {
    color: #111827;
}

.directory-card:hover .view-profile::after {
    width: 100%;
}

/* Card filter states */
.directory-card.card-hidden {
    transform: scale(0.95);
    opacity: 0;
    position: absolute;
    pointer-events: none;
    width: 0;
    height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border: none;
}

/* Search highlight */
.search-highlight {
    background: #FEF3C7;
    border-radius: 2px;
    padding: 0 1px;
}

/* --- Empty State --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
}

.empty-icon {
    margin-bottom: 16px;
}

.empty-text {
    font-style: italic;
    font-size: 14px;
    color: #9CA3AF;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 32px 0 16px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #4B5563;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 150ms, color 150ms;
    background: none;
    border: none;
}

.page-link:hover {
    background: #F9FAFB;
    color: #111827;
}

.page-link.active {
    background: #111827;
    color: #FFFFFF;
}

.page-link.ellipsis {
    cursor: default;
    color: #9CA3AF;
}

.page-link.ellipsis:hover {
    background: none;
}

/* --- Responsive: Tablet (<1024px) --- */
@media (max-width: 1024px) {
    .filter-toggle-label {
        display: inline;
    }

    #filter-sidebar {
        position: fixed;
        top: 56px;
        left: -300px;
        width: 280px;
        height: calc(100vh - 56px);
        z-index: 50;
        transition: left 250ms ease;
        border-right: 1px solid #E5E7EB;
    }

    #filter-sidebar.open {
        left: 0;
    }

    .sidebar-close {
        display: block;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .directory-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* --- Responsive: Mobile (<640px) --- */
@media (max-width: 640px) {
    #site-header {
        padding: 0 12px;
    }

    .header-center {
        padding: 0 8px;
    }

    .search-wrapper {
        width: 100%;
    }

    .result-count {
        display: none;
    }

    .filter-toggle-label {
        display: none;
    }

    #main-content {
        padding: 16px;
    }

    .directory-grid {
        grid-template-columns: 1fr;
    }

    .card-metrics {
        gap: 12px;
        flex-wrap: wrap;
    }
}
