/* B2B PIC Finder Custom Styles (Premium Dark Glass Theme) */

:root {
    --bg-dark: #f7f4ee;
    --panel-bg: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --text-primary: #2b2d42;
    --text-muted: #6c757d;
    --primary-glow: rgba(162, 10, 10, 0.15);
    --accent-glow: rgba(243, 168, 59, 0.15);
    --danger-glow: rgba(239, 68, 68, 0.15);
}

body {
    background-color: var(--bg-dark);
    background-image: none;
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-theme {
    --bg-dark: #0c0707;
    --panel-bg: rgba(22, 14, 14, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --primary-glow: #a20a0a;
    --accent-glow: #f3a83b;
    --danger-glow: #ef4444;
}



/* Layout */
.finder-main {
    padding-top: 40px;
    padding-bottom: 80px;
}

.finder-hero {
    text-align: center;
    margin-bottom: 40px;
}

.finder-hero .hero-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 900;
    font-size: 3rem;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.finder-hero .hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
    margin-bottom: 40px;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.panel-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Forms */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group.half {
    flex: 1;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.required {
    color: var(--danger-glow);
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

input[type="text"], input[type="password"], select {
    background: #0d0d0d;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s;
}

input[type="text"]:focus, input[type="password"]:focus, select:focus {
    border-color: var(--accent-glow);
    outline: none;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

/* Tag Inputs */
.tag-input-container {
    background: #0d0d0d;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 48px;
    align-items: center;
}

.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.tag-close {
    cursor: pointer;
    font-weight: 700;
    color: #c7d2fe;
}

.tag-close:hover {
    color: var(--danger-glow);
}

#tag-input {
    border: none !important;
    background: transparent !important;
    padding: 4px 0 !important;
    flex: 1;
    min-width: 120px;
    color: var(--text-primary);
}

#tag-input:focus {
    box-shadow: none !important;
    outline: none;
}

/* Details Accordion */
.settings-details {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(15, 17, 26, 0.2);
}

.settings-summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    user-select: none;
    list-style: none;
}

.settings-summary::-webkit-details-marker {
    display: none;
}

.settings-content {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 17, 26, 0.4);
}

.summary-arrow {
    transition: transform 0.3s;
}

details[open] .summary-arrow {
    transform: rotate(90deg);
}

.input-info-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Loader in Button */
.btn-block {
    width: 100%;
}

.btn-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Console Log Component */
.live-console {
    display: flex;
    flex-direction: column;
    height: 480px;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.status-indicator {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-indicator.searching {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.status-indicator.enriching {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fde047;
}

.status-indicator.done {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

.console-body {
    flex: 1;
    background: #050505;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.log-line {
    word-break: break-all;
    line-height: 1.4;
}

.log-line.system { color: #818cf8; }
.log-line.search { color: #3b82f6; }
.log-line.enrich { color: #f59e0b; }
.log-line.success { color: #f3a83b; }
.log-line.error { color: #ef4444; }

/* Progress Bar */
.progress-bar-container {
    margin-top: 15px;
    background: rgba(15, 17, 26, 0.6);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 6px;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #a20a0a, #f3a83b);
    transition: width 0.3s ease;
}

/* Results Section */
.results-section {
    animation: fadeInUp 0.5s ease-out;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.results-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.search-results-filter input {
    min-width: 250px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

/* Results Table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    background-color: var(--panel-bg);
}

.results-table th {
    background-color: rgba(0, 0, 0, 0.02);
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--border-color);
    padding: 15px;
    font-size: 0.9rem;
    font-weight: 700;
}

.results-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-primary) !important;
    background-color: var(--panel-bg);
}

.results-table tbody tr {
    transition: background-color 0.2s;
    background-color: var(--panel-bg);
}

.results-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.015);
}

body.dark-theme .results-table {
    background-color: #000000 !important;
}

body.dark-theme .results-table th {
    background-color: #050505 !important;
}

body.dark-theme .results-table td,
body.dark-theme .results-table tbody tr {
    background-color: #000000 !important;
}

body.dark-theme .results-table tbody tr:hover {
    background-color: #111111 !important;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-badge.verified {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.guessed {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.scraped {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.undeliverable {
    background: rgba(239, 44, 44, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 44, 44, 0.2);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 10, 16, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.modal-card {
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.modal-subtitle {
    font-size: 1.1rem;
    color: #818cf8;
    margin-bottom: 5px;
}

.modal-company {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-section {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.modal-section h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 8px;
}

.contact-value {
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
}

.enrich-notes {
    background: #090a10;
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #e2e8f0;
}

.modal-actions {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
}

/* Helper Buttons & Colors */
.btn-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

.linkedin-badge-link {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.linkedin-badge-link:hover {
    text-decoration: underline;
}

.confidence-inline {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-muted);
    margin-left: 5px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive Overrides */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .action-buttons {
        width: 100%;
        justify-content: space-between;
    }
    .search-results-filter {
        width: 100%;
    }
    .search-results-filter input {
        width: 100%;
    }
}

/* Filter Pill Grid & Dynamic Pills */
.filter-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 17, 26, 0.6);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-pill:hover {
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--text-primary);
}

.filter-pill:has(input[type="checkbox"]:checked) {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-glow);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.filter-pill input[type="checkbox"]:checked + span {
    color: var(--text-primary);
    font-weight: 600;
}

.filter-pill input[type="checkbox"] {
    accent-color: var(--primary-glow);
    cursor: pointer;
}

/* Generated Tag Styling */
.tag.generated-tag {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.tag.generated-tag .tag-close {
    color: #a5b4fc;
}

.tag.generated-tag .tag-close:hover {
    color: var(--text-primary);
}

    /* Mobile viewport responsiveness overrides */
@media (max-width: 576px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    .form-group.half {
        width: 100%;
    }
    .action-buttons {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    .action-buttons button {
        width: 100%;
    }
    .finder-hero .hero-title {
        font-size: 2.2rem;
    }
    .glass-panel {
        padding: 15px;
    }
    body, html {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* Table responsive container overrides for dark theme */
.table-responsive {
    background: rgba(18, 18, 24, 0.9) !important;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    border-radius: 12px;
}
