@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fb;
    --bg-tertiary: #f1f3f7;
    --bg-card: #ffffff;
    --border: #e2e6ed;
    --border-light: #eef0f4;
    --text-primary: #1a1d26;
    --text-secondary: #5f6980;
    --text-tertiary: #8892a6;
    --accent: #4f6ef7;
    --accent-hover: #3b5ae0;
    --accent-light: #eef1fe;
    --accent-glow: rgba(79, 110, 247, 0.15);
    --valid: #22c55e;
    --valid-bg: #f0fdf4;
    --valid-border: #bbf7d0;
    --invalid: #ef4444;
    --invalid-bg: #fef2f2;
    --invalid-border: #fecaca;
    --risky: #f59e0b;
    --risky-bg: #fffbeb;
    --risky-border: #fde68a;
    --role-based: #8b5cf6;
    --role-based-bg: #f5f3ff;
    --role-based-border: #ddd6fe;
    --unknown: #6b7280;
    --unknown-bg: #f9fafb;
    --unknown-border: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ==================== MAIN CONTAINER ==================== */
.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==================== UPLOAD SECTION ==================== */
.upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 20px 0;
}

.upload-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px;
    max-width: 680px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

/* ==================== DISCLAIMER NOTE ==================== */
.disclaimer-note {
    margin-top: 32px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: left;
}

.disclaimer-note strong {
    color: var(--text-primary);
    font-weight: 700;
}

.disclaimer-icon {
    width: 24px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    color: var(--text-tertiary);
}


.upload-card h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upload-card .subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 32px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.drop-zone-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.8;
}

.drop-zone-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.drop-zone-hint {
    font-size: 13px;
    color: var(--text-tertiary);
}

.file-input {
    display: none;
}

.upload-info {
    display: flex;
    gap: 24px;
    margin-top: 24px;
    justify-content: center;
}

.upload-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.upload-info-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

/* Selected file state */
.file-selected {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-top: 24px;
    display: none;
    align-items: center;
    gap: 16px;
}

.file-selected.visible {
    display: flex;
}

.file-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    text-align: left;
}

.file-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
}

.file-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.file-remove {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    color: var(--text-tertiary);
    transition: var(--transition);
    font-size: 16px;
}

.file-remove:hover {
    background: var(--invalid-bg);
    border-color: var(--invalid-border);
    color: var(--invalid);
}

.start-btn {
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
    transition: var(--transition);
    display: none;
    width: 100%;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.start-btn.visible {
    display: block;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.start-btn:active {
    transform: translateY(0);
}

.start-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Input Method Tabs */
.input-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.input-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.input-tab:hover {
    color: var(--text-primary);
}

.input-tab.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.input-panel.hidden {
    display: none;
}

/* Paste Area */
.paste-area {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition);
}

.paste-area:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-primary);
}

.paste-area::placeholder {
    color: var(--text-tertiary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.paste-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 0 4px;
}

.paste-count {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.paste-clear {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.paste-clear:hover {
    background: var(--invalid-bg);
    border-color: var(--invalid-border);
    color: var(--invalid);
}

/* ==================== PROCESSING SECTION ==================== */
.processing-section {
    display: none;
    padding: 24px 0;
}

.processing-section.visible {
    display: block;
}

.progress-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

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

.progress-title {
    font-size: 18px;
    font-weight: 700;
}

.progress-percentage {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #7c5cf7, var(--accent));
    background-size: 200% 100%;
    border-radius: 6px;
    width: 0%;
    transition: width 0.4s ease;
    animation: shimmer 2s ease-in-out infinite;
}

/* Verifying Spinner */
.verifying-spinner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spinner-ring {
    width: 28px;
    height: 28px;
    border: 3px solid var(--accent-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.spinner-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {

    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.progress-detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Live stats cards */
.live-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card.valid {
    border-left: 3px solid var(--valid);
}

.stat-card.invalid {
    border-left: 3px solid var(--invalid);
}

.stat-card.risky {
    border-left: 3px solid var(--risky);
}

.stat-card.role-based {
    border-left: 3px solid var(--role-based);
}

.stat-card.unknown {
    border-left: 3px solid var(--unknown);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card.valid .stat-value {
    color: var(--valid);
}

.stat-card.invalid .stat-value {
    color: var(--invalid);
}

.stat-card.risky .stat-value {
    color: var(--risky);
}

.stat-card.role-based .stat-value {
    color: var(--role-based);
}

.stat-card.unknown .stat-value {
    color: var(--unknown);
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-pct {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-top: 2px;
    margin-bottom: 4px;
}

/* ==================== RESULTS SECTION ==================== */
.results-section {
    display: none;
}

.results-section.visible {
    display: block;
}

.results-toolbar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.filter-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.filter-btn .count {
    font-size: 11px;
    opacity: 0.7;
}

.toolbar-spacer {
    flex: 1;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 13px;
    width: 220px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-primary);
}

.search-box .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 14px;
}

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

.action-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
}

.action-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    color: var(--accent);
}

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

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

/* Results Table */
.results-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.results-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.results-table td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.results-table tbody tr {
    transition: var(--transition);
}

.results-table tbody tr:hover {
    background: var(--bg-secondary);
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.email-cell {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12.5px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Result Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge.valid {
    background: var(--valid-bg);
    color: var(--valid);
    border: 1px solid var(--valid-border);
}

.badge.invalid {
    background: var(--invalid-bg);
    color: var(--invalid);
    border: 1px solid var(--invalid-border);
}

.badge.risky {
    background: var(--risky-bg);
    color: var(--risky);
    border: 1px solid var(--risky-border);
}

.badge.role_based,
.badge.role-based {
    background: var(--role-based-bg);
    color: var(--role-based);
    border: 1px solid var(--role-based-border);
}

.badge.unknown {
    background: var(--unknown-bg);
    color: var(--unknown);
    border: 1px solid var(--unknown-border);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius) var(--radius);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    gap: 4px;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==================== COMPLETION BANNER ==================== */
.completion-banner {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid var(--valid-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: none;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.completion-banner.visible {
    display: flex;
}

.completion-icon {
    width: 44px;
    height: 44px;
    background: var(--valid);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.completion-text {
    flex: 1;
}

.completion-text h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.completion-text p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ==================== NEW VERIFICATION BUTTON ==================== */
.new-verify-btn {
    padding: 10px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
}

.new-verify-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.processing-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text-primary);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
}

.toast.visible {
    transform: translateY(0);
    opacity: 1;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .upload-card {
        padding: 24px;
    }

    .upload-card h1 {
        font-size: 22px;
    }

    .drop-zone {
        padding: 32px 20px;
    }

    .live-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box input {
        width: 100%;
    }

    .header {
        padding: 0 16px;
    }

    .header-stats {
        display: none;
    }

    .action-buttons {
        width: 100%;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .live-stats {
        grid-template-columns: 1fr;
    }

    .filter-buttons {
        width: 100%;
    }

    .filter-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ==================== DISCLAIMER NOTE ==================== */
.disclaimer-note {
    max-width: 1400px;
    margin: 12px auto 0;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #92610e;
    line-height: 1.5;
    margin-left: 32px;
    margin-right: 32px;
}

.disclaimer-note p {
    margin: 0;
}

.disclaimer-note strong {
    color: #78510b;
    font-weight: 700;
}

.disclaimer-icon {
    width: 28px;
    height: 28px;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* ==================== FOOTER ==================== */
.footer {
    text-align: center;
    padding: 20px 32px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-tertiary);
    background: var(--bg-primary);
    width: 100%;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}