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

:root {
    --primary: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    /* Indigo 600 */
    --bg-page: #f8fafc;
    /* Slate 50 */
    --bg-card: #ffffff;
    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --border: #e2e8f0;
    /* Slate 200 */
    --success: #10b981;
    /* Emerald 500 */
    --warning: #f59e0b;
    /* Amber 500 */
    --danger: #ef4444;
    /* Red 500 */
    --radius: 12px;
}

body {
    background: var(--bg-page);
}

#sip-root {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    max-width: 1200px;
    margin: 40px auto;
    color: var(--text-main);
    line-height: 1.5;
}

/* --- COMPONENTS --- */
.sip-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 24px;
    margin-bottom: 24px;
}

.sip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
}

.sip-btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 2px rgba(99, 102, 241, 0.2);
}

.sip-btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.sip-btn.secondary {
    background: white;
    border-color: var(--border);
    color: var(--text-main);
}

.sip-btn.secondary:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.sip-btn.ghost {
    background: transparent;
    color: var(--text-muted);
}

.sip-btn.ghost:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.sip-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.sip-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    transition: 0.2s;
    outline: none;
}

.sip-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* --- HEADER --- */
.sip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

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

.sip-title h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.sip-badge-status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.sip-badge-status.premium {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
}

.sip-badge-status.free {
    background: #e2e8f0;
    color: #64748b;
}

.sip-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- WELCOME --- */
.sip-welcome-container {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sip-welcome-card {
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.sip-welcome-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

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

.sip-stat-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sip-stat-val {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.sip-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.sip-filters-bar {
    background: white;
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: none;
    flex-wrap: wrap;
}

.sip-search-box {
    position: relative;
    width: 240px;
}

.sip-search-box input {
    padding-left: 34px;
}

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

/* --- TABLE --- */
.sip-table-container {
    background: white;
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

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

.sip-table th {
    text-align: left;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.sip-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-main);
    vertical-align: middle;
}

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

.sip-table tr:hover td {
    background: #f8fafc;
}

/* Checkbox Cell */
.sip-cell-check {
    width: 40px;
    text-align: center;
}

.sip-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    accent-color: var(--primary);
}

.sip-url-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sip-url-title {
    font-weight: 600;
    color: var(--text-main);
}

.sip-url-link {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.sip-url-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.indexed {
    background: #dcfce7;
    color: #166534;
}

.status-badge.not-indexed {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.pending {
    background: #f1f5f9;
    color: #475569;
}

.status-badge.scanning {
    background: #e0e7ff;
    color: #3730a3;
}

.status-badge.waiting {
    background: #ffedd5;
    color: #9a3412;
}

/* Action Buttons Small */
.action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f9faff;
}

/* --- FOOTER PAGINATION --- */
.sip-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: white;
}

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

.sip-pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sip-pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sip-pagination-page {
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.sip-pagination-page:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f0ff;
}

.sip-pagination-page.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.25);
    pointer-events: none;
}

.sip-pagination-ellipsis {
    min-width: 28px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    user-select: none;
}

/* --- BULK SELECTION BANNER --- */
.sip-selection-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
    /* JS Toggle */
}

.sip-selection-action {
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 8px;
}

/* --- VIDEO EMBED --- */
.sip-video-container {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px;
    min-height: 300px;
}

.sip-video-container iframe {
    border: none;
    max-width: 100%;
}

/* --- LOGS --- */
.sip-logs {
    background: #1e293b;
    color: #f1f5f9;
    padding: 16px;
    border-radius: var(--radius);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 24px;
}

.log-item {
    border-bottom: 1px solid #334155;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
}

.log-item:last-child {
    border-bottom: none;
}

.log-success {
    color: #4ade80;
}

.log-error {
    color: #f87171;
}

/* --- UTILS --- */
.flex-spacer {
    flex: 1;
}

.mt-4 {
    margin-top: 16px;
}

.text-sm {
    font-size: 13px;
}

.text-center {
    text-align: center;
}

/* LOCKED / PREMIUM STYLES */
.btn-locked {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    border-color: #cbd5e1 !important;
    cursor: pointer !important;
    position: relative;
    opacity: 0.8;
}

.btn-locked::after {
    content: "🔒";
    font-size: 10px;
    margin-left: 4px;
}

.sip-banner-upsell {
    background: linear-gradient(135deg, #4f46e5, #9333ea);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.sip-banner-upsell h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
}

.sip-banner-upsell p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.sip-banner-btn {
    background: white;
    color: #4f46e5;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.sip-banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}