/* ──────────────────────────────────────────────────────────
   Gateway Management UI — Design System
   ────────────────────────────────────────────────────────── */

:root {
    --accent: #667eea;
    --accent-2: #764ba2;
    --surface-bg: #0d1117;
    --surface-card: #161b22;
    --surface-elevated: #1c2333;
    --border: rgba(255, 255, 255, 0.06);
    --text-1: #e6edf3;
    --text-2: rgba(255, 255, 255, 0.45);
    --text-3: rgba(255, 255, 255, 0.25);
    color-scheme: dark;
}

html,
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--surface-bg);
    color: var(--text-1);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* ── Panels ──────────────────────────────────────────── */

.panel {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.panel-header {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.015);
}

.panel-body {
    padding: 1.25rem;
}

/* ── Stat Cards ──────────────────────────────────────── */

.stat-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.bg-routes {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
}

.bg-clusters {
    background: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
}

.bg-destinations {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-2);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* ── Tables ──────────────────────────────────────────── */

.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.025);
    font-size: 0.85rem;
}

.table thead th {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 1.25rem;
    white-space: nowrap;
}

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

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

/* ── Badges ──────────────────────────────────────────── */

.badge.bg-purple {
    background: rgba(118, 75, 162, 0.25) !important;
    color: #c084fc !important;
    font-weight: 500;
}

.badge.bg-outline-method {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.65) !important;
    font-weight: 500;
    font-size: 0.7rem;
}

/* ── Method Badges ───────────────────────────────────── */

.method-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.25rem;
}

.method-get {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.method-post {
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
}

.method-put {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.method-patch {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
}

.method-delete {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.method-other {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

/* ── Route Row ───────────────────────────────────────── */

.route-row {
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.route-row.deselected {
    opacity: 0.35;
}

.route-row:hover {
    background: rgba(255, 255, 255, 0.025);
}

/* ── Info Labels ─────────────────────────────────────── */

.info-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-2);
    margin-bottom: 0.35rem;
}

.info-value {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ── Hint Cards ──────────────────────────────────────── */

.hint-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.hint-icon {
    font-size: 1.5rem;
    color: var(--accent);
    opacity: 0.6;
    flex-shrink: 0;
}

.hint-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-1);
}

.hint-desc {
    font-size: 0.75rem;
    color: var(--text-2);
}

/* ── Empty State ─────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-2);
}

.empty-state i {
    opacity: 0.25;
}

/* ── Forms ───────────────────────────────────────────── */

.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-1);
    border-radius: 8px;
    font-size: 0.875rem;
    padding: 0.55rem 0.75rem;
    transition: all 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
    color: var(--text-1);
}

select option {
    background-color: var(--surface-card);
    color: var(--text-1);
}

.form-control::placeholder {
    color: var(--text-3);
}

.form-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.35rem;
}

.input-group-text {
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-2);
    font-size: 0.9rem;
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* ── Buttons ─────────────────────────────────────────── */

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.25rem;
    transition: all 0.15s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.btn-primary:disabled {
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

.btn-outline-light {
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.55);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-outline-danger {
    border-radius: 8px;
    font-size: 0.8rem;
}

/* ── Alerts ──────────────────────────────────────────── */

.alert {
    border-radius: 10px;
    border: none;
    font-size: 0.875rem;
}

.alert-success {
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.15);
}

.alert-danger {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.15);
}

/* ── Animations ──────────────────────────────────────── */

.animate-in {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

/* ── Destination Items ───────────────────────────────── */

.dest-item {
    padding: 0.15rem 0;
    font-size: 0.85rem;
}

/* ── Scrollbar ───────────────────────────────────────── */

::-webkit-scrollbar {
    width: 5px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}