/* Index Status Checker — Violet/Purple Dark Theme */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

:root {
    --primary: #8B5CF6;
    --primary-rgb: 139, 92, 246;
    --secondary: #A78BFA;
    --accent: #C4B5FD;
    --bg: #0F172A;
    --bg-card: #1E293B;
    --bg-elevated: #273548;
    --bg-surface: #334155;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --border: rgba(139, 92, 246, 0.15);
    --border-hover: rgba(139, 92, 246, 0.35);
    --green: #22C55E;
    --red: #EF4444;
    --yellow: #F59E0B;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --glass: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(139, 92, 246, 0.1);
    --transition: 0.25s ease;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 0%, rgba(var(--primary-rgb), 0.08) 0%, transparent 60%), radial-gradient(ellipse at 70% 100%, rgba(139, 92, 246, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border)
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    color: white
}

.logo h1 {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: none
}

@media(min-width:640px) {
    .tagline {
        display: block
    }
}

.main {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px
}

.tab {
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition)
}

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

.tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.3)
}

.tab-content {
    display: none
}

.tab-content.active {
    display: block
}

/* Inputs */
.input-row {
    display: flex;
    gap: 10px
}

.url-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition)
}

.url-input::placeholder {
    color: var(--text-dim)
}

.url-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15)
}

.bulk-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    resize: vertical;
    transition: var(--transition)
}

.bulk-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15)
}

.input-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    justify-content: flex-end;
    align-items: center
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.4);
    transform: translateY(-1px)
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition)
}

.btn-secondary:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--bg-elevated)
}

.btn-ghost {
    padding: 8px 14px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition)
}

.btn-ghost:hover {
    color: var(--text)
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition)
}

.file-upload-label:hover {
    border-color: var(--border-hover);
    color: var(--text)
}

/* Progress */
.progress-section {
    margin: 20px 0
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-card);
    border-radius: 3px;
    overflow: hidden
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.3s ease
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    display: block
}

/* Summary */
.summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 24px 0
}

.summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition)
}

.summary-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px)
}

.summary-icon {
    font-size: 1.2rem;
    margin-bottom: 4px
}

.summary-card.indexed .summary-icon {
    color: var(--green)
}

.summary-card.not-indexed .summary-icon {
    color: var(--red)
}

.summary-card.pending .summary-icon {
    color: var(--yellow)
}

.summary-card.total .summary-icon {
    color: var(--accent)
}

.summary-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text)
}

.summary-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em
}

/* Results */
.results-section,
.history-section {
    margin: 24px 0
}

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

.results-header h2 {
    font-size: 1rem;
    font-weight: 600
}

.results-actions {
    display: flex;
    gap: 8px
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius)
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem
}

.results-table th {
    padding: 10px 14px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap
}

.results-table td {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    vertical-align: middle
}

.results-table tr:hover td {
    background: rgba(139, 92, 246, 0.03)
}

.url-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--accent)
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600
}

.status-badge.indexed {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green)
}

.status-badge.not-indexed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red)
}

.status-badge.unknown {
    background: rgba(245, 158, 11, 0.15);
    color: var(--yellow)
}

.status-badge.checking {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent)
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition)
}

.history-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-elevated)
}

.history-url {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.history-status {
    font-size: 0.7rem
}

.history-date {
    font-size: 0.65rem;
    color: var(--text-dim)
}

.empty-text {
    text-align: center;
    padding: 32px;
    color: var(--text-dim);
    font-size: 0.85rem
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: 0.35s ease;
    z-index: 200
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0)
}

/* Responsive */
@media(max-width:640px) {
    .header-inner {
        padding: 12px 16px
    }

    .main {
        padding: 16px
    }

    .summary {
        grid-template-columns: repeat(2, 1fr)
    }

    .input-row {
        flex-direction: column
    }

    .results-actions {
        flex-wrap: wrap
    }
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
    outline: none
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--bg-surface);
    border-radius: 3px
}