/* ScrubMe.app — Custom styles (Tailwind handles most things via CDN) */

/* Auth pages — centered card layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
}

/* App layout — sidebar + main content */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 16rem;
    background-color: #1f2937;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
}

.app-main {
    margin-left: 16rem;
    flex: 1;
    background-color: #f9fafb;
    min-height: 100vh;
}

/* Mobile sidebar */
@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
}

/* Stat cards */
.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}
.stat-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 2px solid #e5e7eb;
}
.data-table th.sortable:hover {
    color: #4f46e5;
}
.data-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}
.data-table tbody tr {
    transition: background-color 0.15s;
}
.data-table tbody tr:hover {
    background-color: #f9fafb;
}
.data-table tbody tr.clickable {
    cursor: pointer;
}
.data-table tbody tr.clickable:hover {
    background-color: #eef2ff;
}

/* Audit timeline */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 1.5rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 0.45rem;
    top: 0.5rem;
    bottom: -0.5rem;
    width: 2px;
    background-color: #e5e7eb;
}
.timeline-item:last-child::before {
    display: none;
}
.timeline-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0.4rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: #6366f1;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #e5e7eb;
}

/* Landing page hero gradient */
.hero-gradient {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
}

/* Form inputs */
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Button variants */
.btn-primary {
    background-color: #4f46e5;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s;
    border: none;
    cursor: pointer;
}
.btn-primary:hover { background-color: #4338ca; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    background-color: white;
    color: #374151;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s;
    border: 1px solid #d1d5db;
    cursor: pointer;
}
.btn-secondary:hover { background-color: #f9fafb; }

.btn-danger {
    background-color: #dc2626;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s;
    border: none;
    cursor: pointer;
}
.btn-danger:hover { background-color: #b91c1c; }

/* Progress bar */
.progress-bar {
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background-color: #4f46e5;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

/* Profile tabs */
.profile-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
}
.profile-tab:hover {
    border-color: #6366f1;
    color: #4f46e5;
}
.profile-tab.active {
    background-color: #4f46e5;
    color: white;
    border-color: #4f46e5;
}
.profile-tab.add-tab {
    border-style: dashed;
    color: #6b7280;
}
.profile-tab.add-tab:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}
.profile-tab .primary-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: #10b981;
}
.profile-tab.active .primary-dot {
    background-color: #a7f3d0;
}

/* Dynamic list (for last names, emails, phones) */
.dynamic-list-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dynamic-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    background: white;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.dynamic-remove-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}
.dynamic-add-btn {
    font-size: 0.8125rem;
    color: #4f46e5;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
}
.dynamic-add-btn:hover {
    color: #4338ca;
    text-decoration: underline;
}

/* Scan list cards */
.scan-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    transition: box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
}
.scan-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #c7d2fe;
}

/* Result cards */
.result-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.result-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    border-color: #c7d2fe;
}
.result-card .result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.result-card .result-domain {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9375rem;
}
.result-card .result-title {
    font-size: 0.8125rem;
    color: #4b5563;
    margin-bottom: 0.375rem;
}
.result-card .result-snippet {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
    background: #f9fafb;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    border-left: 3px solid #c7d2fe;
}
.result-card .result-snippet mark {
    background: #fef3c7;
    color: #92400e;
    padding: 0 2px;
    border-radius: 2px;
}
.result-card .result-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.result-card .result-badges {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

/* Action buttons (small) */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.btn-sm:hover {
    border-color: #6366f1;
    color: #4f46e5;
}
.btn-sm.btn-sm-primary {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}
.btn-sm.btn-sm-primary:hover {
    background: #4338ca;
}
.btn-sm.btn-sm-danger {
    color: #dc2626;
    border-color: #fca5a5;
}
.btn-sm.btn-sm-danger:hover {
    background: #fef2f2;
    border-color: #dc2626;
}
.btn-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    max-width: 40rem;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px rgba(0,0,0,0.15);
    transform: translateY(10px);
    transition: transform 0.2s;
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}
.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
}
.modal-close:hover {
    color: #374151;
    background: #f3f4f6;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

/* Email preview box */
.email-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #374151;
    max-height: 15rem;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: inherit;
}

/* Filter bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.filter-chip {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid #d1d5db;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}
.filter-chip:hover {
    border-color: #6366f1;
    color: #4f46e5;
}
.filter-chip.active {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4f46e5;
}

/* Mobile hamburger button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 50;
    background: #1f2937;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
}
@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
}

/* AI Enrichment — identity match card styles */
.result-card.wrong-person {
    opacity: 0.5;
}
.result-card.confirmed {
    border-left: 4px solid #10b981;
}
.result-card.likely {
    border-left: 4px solid #3b82f6;
}
.result-card.possible {
    border-left: 4px solid #eab308;
}
.result-card.unlikely {
    border-left: 4px solid #9ca3af;
}

/* AI summary tooltip */
.ai-summary-tooltip {
    position: relative;
    cursor: help;
}
.ai-summary-tooltip .ai-summary-text {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 20rem;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    margin-bottom: 0.25rem;
}
.ai-summary-tooltip:hover .ai-summary-text {
    display: block;
}

/* Top match ranking item */
.top-match-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    transition: background 0.15s;
}
.top-match-item:hover {
    background: #f9fafb;
}
.top-match-rank {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eef2ff;
    color: #4f46e5;
}

/* Print styles */
@media print {
    .app-sidebar, .mobile-menu-btn, .print-hide { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .stat-card, .bg-white { box-shadow: none !important; border: 1px solid #e5e7eb; }
    body { background: white !important; }
    .app-main { background: white !important; }
}
