/* Clean & Premium Light Theme (with Emerald Green accents) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --primary: #10b981;          /* Emerald green accent */
    --primary-hover: #059669;
    --wa-green: #10b981;
    --border-color: #e2e8f0;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 3rem;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header & Navigation */
header {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: white;
}

.logo-text h2 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.logo-text p {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.history-btn {
    width: 38px;
    height: 38px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

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

/* Scraper Box Card */
.card-scraper {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.scraper-title-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.scraper-icon {
    width: 44px;
    height: 44px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary);
    flex-shrink: 0;
}

.scraper-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.scraper-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Forms */
.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-container {
    position: relative;
    margin-bottom: 0.5rem;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.input-field {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Location input highlighted like in screenshot (light blueish gray background) */
.input-location {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

/* Pills */
.pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.pill {
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.pill:hover {
    background-color: #e2e8f0;
    color: var(--text-primary);
}

.pill.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Checkbox */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
    cursor: pointer;
}

.checkbox-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.checkbox-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Submit Button */
.btn-submit {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.9rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

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

/* Scrape Log Alert Box */
.scrape-log-box {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #065f46;
}

/* Results section */
.results-section {
    margin-top: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.result-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.result-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.4rem;
}

.result-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.result-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.result-detail svg {
    margin-top: 2px;
    color: #94a3b8;
    flex-shrink: 0;
}

.badge {
    display: inline-flex;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.result-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    gap: 0.4rem;
    transition: all 0.2s;
}

.btn-secondary {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    color: var(--text-primary);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
}

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

.btn-wa {
    background-color: var(--wa-green) !important;
    color: white;
    border: none;
}

.btn-wa:hover {
    background-color: var(--primary-hover) !important;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    border: none;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Spinner Loader */
.spinner {
    border: 3px solid rgba(16, 185, 129, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin: 0 auto 0.5rem;
}

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

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 540px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.table-responsive {
    overflow-x: auto;
}

table.leads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

table.leads-table th {
    background: #f8fafc;
    color: var(--text-secondary);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

table.leads-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

footer {
    text-align: center;
    padding: 2rem 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
