/* =====================================================
   WEBHOOK TESTER - Modern Design System
   ===================================================== */

/* Design Tokens */
:root {
    /* Colors - Dark Theme */
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-tertiary: #1a1a3e;
    --bg-card: rgba(26, 26, 62, 0.6);
    --bg-card-solid: #1a1a3e;
    --bg-input: #0d0d1f;
    
    /* Accent Colors */
    --accent: #ff6b6b;
    --accent-hover: #ff5252;
    --accent-glow: rgba(255, 107, 107, 0.3);
    --accent-gradient: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    
    /* Semantic Colors */
    --success: #4ade80;
    --success-bg: rgba(74, 222, 128, 0.1);
    --info: #60a5fa;
    --info-bg: rgba(96, 165, 250, 0.1);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.1);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.1);
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-link: #60a5fa;
    
    /* Border & Shadow */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
    
    /* Spacing (8px grid) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* =====================================================
   BASE STYLES
   ===================================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(255, 107, 107, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(96, 165, 250, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.125rem; }

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

code, pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm), 0 0 20px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 30px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-solid);
    border-color: var(--accent);
}

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

.btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #ef4444;
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8rem;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
}

.btn-icon {
    padding: var(--space-2);
    border-radius: var(--radius-md);
}

/* =====================================================
   FORMS
   ===================================================== */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:hover {
    border-color: var(--border-light);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input.mono {
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    padding-right: var(--space-10);
}

.form-hint {
    margin-top: var(--space-2);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-error {
    margin-top: var(--space-2);
    font-size: 0.8rem;
    color: var(--danger);
}

/* Input with Icon */
.input-wrapper {
    position: relative;
}

.input-wrapper .icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper .form-input {
    padding-left: var(--space-10);
}

/* =====================================================
   CARDS
   ===================================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.card-solid {
    background: var(--bg-card-solid);
    backdrop-filter: none;
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

/* Glass Card */
.card-glass {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
}

/* =====================================================
   BADGES
   ===================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
}

.badge-get { background: var(--success); color: #000; }
.badge-post { background: var(--info); color: #000; }
.badge-put { background: var(--warning); color: #000; }
.badge-delete { background: var(--danger); color: #fff; }
.badge-patch { background: #a855f7; color: #fff; }
.badge-head { background: #6b7280; color: #fff; }
.badge-options { background: #78716c; color: #fff; }

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }

/* =====================================================
   NAVBAR
   ===================================================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: var(--space-3) var(--space-6);
    background: rgba(10, 10, 26, 0.9);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
}

.navbar-center {
    display: flex;
    justify-content: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.navbar-brand h1 {
    font-size: 1.25rem;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand .logo {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-glow);
}

.navbar-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-1);
    position: relative;
}

.navbar-links a {
    padding: var(--space-2) var(--space-3);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.navbar-links a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.navbar-links a.active {
    color: var(--accent);
}

/* Connection Indicator */
.connection-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    margin-right: var(--space-2);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.connection-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.connection-status.connected {
    color: var(--success);
    border-color: rgba(74, 222, 128, 0.2);
    background: rgba(74, 222, 128, 0.05);
}

.connection-status.connected .dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* =====================================================
   STATS
   ===================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    max-width: 900px;
    margin: 0 auto;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.stat-card:hover {
    border-color: var(--border-light);
}

.stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 107, 107, 0.1);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-card.highlight {
    border-color: rgba(255, 107, 107, 0.3);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255, 107, 107, 0.08) 100%);
}

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

.stat-card.highlight .stat-icon {
    background: var(--accent-glow);
}

/* =====================================================
   WEBHOOK URL BOX
   ===================================================== */

.webhook-hero {
    display: flex;
    justify-content: center;
    padding: var(--space-6);
}

.webhook-hero-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    width: 100%;
    max-width: 1100px;
}

.webhook-url-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
}

.webhook-url-container label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.webhook-search-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
}

.webhook-search-container label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.search-form-inline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.search-form-inline input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    font-size: 0.85rem;
}

.search-form-inline select {
    width: auto;
    padding: var(--space-3) var(--space-4);
    font-size: 0.85rem;
}

.webhook-url-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.webhook-url-row input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition-fast);
}

.webhook-url-row input:focus {
    border-color: var(--accent);
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--accent-gradient);
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    white-space: nowrap;
}

.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
}

.copy-btn.copied {
    background: var(--success);
    box-shadow: 0 2px 8px rgba(74, 222, 128, 0.3);
}

/* =====================================================
   WEBHOOK CARDS
   ===================================================== */

.webhook-list {
    padding: var(--space-4);
}

.webhook-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    overflow: hidden;
    transition: all var(--transition-base);
}

.webhook-card:hover {
    border-color: var(--border-light);
}

.webhook-card.new {
    animation: cardSlideIn 0.4s ease;
    border-color: var(--accent);
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.webhook-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.webhook-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.header-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-shrink: 0;
}

.webhook-path {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.event-type {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: auto;
}

.delete-webhook {
    padding: var(--space-2);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
}

.delete-webhook:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

.chevron {
    color: var(--text-muted);
    transition: transform var(--transition-base);
}

.webhook-card.expanded .chevron {
    transform: rotate(180deg);
}

/* Webhook Content - see WEBHOOK CARD SMOOTH EXPAND section for grid-based expand */

.content-section {
    margin-top: var(--space-5);
}

.content-section h3 {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.content-section h3 small {
    font-weight: 400;
    text-transform: none;
    color: var(--text-muted);
}

.content-section pre {
    padding: var(--space-4);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow-x: auto;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre;
    max-height: 1000px;
}

.webhook-list.wrap-content .content-section pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: visible;
}

.content-section code {
    font-family: var(--font-mono);
}

/* =====================================================
   MODALS
   ===================================================== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.2rem;
}

.modal-close {
    padding: var(--space-2);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

/* =====================================================
   EMPTY STATE
   ===================================================== */

.empty-state {
    padding: var(--space-12) var(--space-6);
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state h2 {
    margin-bottom: var(--space-3);
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: var(--space-6);
    color: var(--text-muted);
}

.empty-state code {
    display: block;
    padding: var(--space-4);
    margin-top: var(--space-4);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    text-align: left;
    color: var(--text-secondary);
}

/* =====================================================
   LOADING STATES
   ===================================================== */

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-more {
    display: flex;
    justify-content: center;
    padding: var(--space-8);
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */

.toast {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    animation: toastSlideIn 0.3s ease;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-error {
    border-color: var(--danger);
    background: linear-gradient(135deg, var(--bg-card-solid) 0%, var(--danger-bg) 100%);
}

.toast-success {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--bg-card-solid) 0%, var(--success-bg) 100%);
}

/* =====================================================
   NAV BUTTONS
   ===================================================== */

.nav-btn,
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-btn:hover,
.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.nav-btn.active,
.nav-link.active {
    color: var(--accent);
    background: rgba(255, 107, 107, 0.1);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown .chevron-down {
    font-size: 0.6rem;
    margin-left: 2px;
}

.dropdown-menu {
    position: absolute !important;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.dropdown-menu a span:first-child {
    font-size: 1rem;
}

.nav-btn-danger {
    color: var(--danger);
}

.nav-btn-danger:hover {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

/* Tooltips */
.nav-btn::after,
.nav-link::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    padding: var(--space-1) var(--space-2);
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--transition-fast);
    z-index: 1000;
}

.nav-btn:hover::after,
.nav-link:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* =====================================================
   TABS
   ===================================================== */

.tabs {
    display: flex;
    gap: var(--space-1);
    padding: var(--space-2);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.tab {
    padding: var(--space-2) var(--space-4);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

.tab.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab-content {
    display: none;
    padding: var(--space-4) 0;
}

.tab-content.active {
    display: block;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */

.login-page {
    min-height: 100vh;
    display: flex;
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--accent-glow);
    border-radius: 50%;
    filter: blur(100px);
    animation: pulse 4s ease-in-out infinite;
}

.login-brand {
    position: relative;
    z-index: 1;
    text-align: center;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    background: var(--accent-gradient);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: var(--shadow-glow);
    animation: float 3s ease-in-out infinite;
}

.login-brand h1 {
    font-size: 2rem;
    margin-bottom: var(--space-3);
}

.login-brand p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    background: var(--bg-primary);
}

.login-form-container {
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-form-container h2 {
    margin-bottom: var(--space-2);
}

.login-form-container .subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
}

.login-form .form-input {
    padding: var(--space-4);
}

.login-form .btn {
    width: 100%;
    padding: var(--space-4);
    margin-top: var(--space-4);
}

.error-message {
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 0.9rem;
}

.success-message {
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    background: var(--success-bg);
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
    color: var(--success);
    font-size: 0.9rem;
}

/* =====================================================
   PASSWORD PAGE
   ===================================================== */

.password-requirements {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.password-requirements h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}

.requirement {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.requirement.met {
    color: var(--success);
}

.requirement .icon {
    font-size: 1rem;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    padding: var(--space-2);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* =====================================================
   WEBHOOK DETAIL PAGE
   ===================================================== */

.detail-page {
    min-height: 100vh;
}

.detail-header {
    padding: var(--space-6) var(--space-8);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.detail-title {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.detail-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-8);
}

.detail-card {
    margin-bottom: var(--space-6);
}

.detail-row {
    display: flex;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 140px;
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.detail-value {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Code Block with Copy */
.code-block {
    position: relative;
}

.code-block .copy-btn {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    padding: var(--space-2) var(--space-3);
    font-size: 0.8rem;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1024px) {
    .login-left {
        display: none;
    }
    
    .login-right {
        flex: 1;
    }
}

@media (max-width: 768px) {
    :root {
        font-size: 14px;
    }
    
    .navbar {
        padding: var(--space-3) var(--space-4);
        grid-template-columns: 1fr auto;
    }
    
    .navbar-center {
        display: none;
    }

    .navbar-brand h1 {
        font-size: 1rem;
    }
    
    .navbar-links {
        gap: 0;
    }
    
    .connection-status span:not(.dot) {
        display: none;
    }
    
    .dropdown-menu {
        right: -8px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        padding: var(--space-4);
    }
    
    .stats-grid .stat-card:last-child {
        grid-column: span 2;
    }
    
    .webhook-hero {
        padding: var(--space-4);
    }
    
    .webhook-hero-content {
        flex-direction: column;
    }

    .webhook-url-row {
        flex-direction: column;
    }

    .webhook-url-row input {
        width: 100%;
    }

    .webhook-url-row .copy-btn {
        width: 100%;
        justify-content: center;
    }
    
    .search-form-inline {
        flex-direction: column;
    }
    
    .search-form-inline input,
    .search-form-inline select {
        width: 100%;
    }
    
    .webhook-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .webhook-content {
        padding: 0 var(--space-4) var(--space-4);
    }
    
    .login-form-container {
        padding: 0 var(--space-4);
    }
    
    .detail-header,
    .detail-content {
        padding: var(--space-4);
    }
    
    .detail-row {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .detail-label {
        width: 100%;
    }
}

/* =====================================================
   PRISM.JS OVERRIDES
   ===================================================== */

pre[class*="language-"],
code[class*="language-"] {
    background: transparent !important;
    color: var(--text-primary) !important;
    text-shadow: none !important;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: var(--text-muted) !important;
}

.token.punctuation {
    color: var(--text-secondary) !important;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol {
    color: #f78c6c !important;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin {
    color: #c3e88d !important;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #89ddff !important;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #c792ea !important;
}

.token.function {
    color: #82aaff !important;
}

.token.regex,
.token.important,
.token.variable {
    color: #ffcb6b !important;
}

/* =====================================================
   LUCIDE ICON DEFAULTS
   ===================================================== */

.lucide {
    width: 1em;
    height: 1em;
    stroke-width: 2;
    vertical-align: -0.125em;
    flex-shrink: 0;
}

.icon-sm .lucide { width: 14px; height: 14px; }
.icon-md .lucide { width: 18px; height: 18px; }
.icon-lg .lucide { width: 24px; height: 24px; }
.icon-xl .lucide { width: 32px; height: 32px; }

/* Icons inside nav buttons */
.nav-btn .lucide,
.nav-link .lucide {
    width: 18px;
    height: 18px;
}

.nav-btn .chevron-down .lucide {
    width: 12px;
    height: 12px;
}

/* Icons inside buttons */
.btn .lucide {
    width: 16px;
    height: 16px;
}

.btn-lg .lucide {
    width: 18px;
    height: 18px;
}

.btn-sm .lucide {
    width: 14px;
    height: 14px;
}

/* Icons in stats */
.stat-icon .lucide {
    width: 22px;
    height: 22px;
}

/* Icons in badges */
.badge .lucide {
    width: 12px;
    height: 12px;
}

/* Logo icon override */
.navbar-brand .logo .lucide,
.auth-logo .lucide,
.password-header .logo .lucide {
    width: 24px;
    height: 24px;
    color: white;
    stroke-width: 2.5;
}

/* =====================================================
   AUTH PAGE SHARED LAYOUT
   ===================================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
}

.auth-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--accent-glow);
    border-radius: 50%;
    filter: blur(100px);
    animation: pulse 4s ease-in-out infinite;
}

.auth-left::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(96, 165, 250, 0.1);
    border-radius: 50%;
    filter: blur(80px);
    bottom: 10%;
    right: 10%;
    animation: pulse 5s ease-in-out infinite reverse;
}

.auth-brand {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 400px;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    background: var(--accent-gradient);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--shadow-glow);
    animation: float 3s ease-in-out infinite;
}

.auth-brand h1 {
    font-size: 2.5rem;
    margin-bottom: var(--space-4);
}

.auth-brand p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

.auth-features {
    margin-top: var(--space-8);
    text-align: left;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    color: var(--text-secondary);
}

.auth-feature .icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

.auth-feature .icon .lucide {
    width: 16px;
    height: 16px;
}

.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    background: var(--bg-primary);
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease;
}

.auth-form-container h2 {
    font-size: 1.75rem;
    margin-bottom: var(--space-2);
}

.auth-form-container .subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
}

.auth-form .form-group {
    margin-bottom: var(--space-5);
}

.auth-form .form-input {
    padding: var(--space-4);
}

.auth-form .input-wrapper .form-input {
    padding-left: var(--space-10);
}

.auth-form .btn {
    width: 100%;
    padding: var(--space-4);
    margin-top: var(--space-4);
}

.auth-back-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-6);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-back-link:hover {
    color: var(--text-secondary);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: var(--space-6) 0;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 var(--space-4);
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .auth-left {
        display: none;
    }

    .auth-right {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .auth-right {
        padding: var(--space-4);
    }

    .auth-form-container {
        padding: var(--space-6);
        background: var(--bg-secondary);
        border-radius: var(--radius-xl);
    }
}

/* =====================================================
   TOAST NOTIFICATIONS (enhanced)
   ===================================================== */

.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    pointer-events: none;
}

.toast {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.3s ease;
    pointer-events: auto;
    max-width: 360px;
    font-size: 0.9rem;
}

.toast .lucide {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast-leaving {
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

/* =====================================================
   CUSTOM CONFIRM MODAL
   ===================================================== */

.confirm-modal .modal-content {
    max-width: 400px;
}

.confirm-modal .modal-body p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.confirm-modal .modal-footer {
    gap: var(--space-3);
}

/* =====================================================
   WORD WRAP TOGGLE STATE
   ===================================================== */

.nav-btn.wrap-active {
    color: var(--accent);
    background: rgba(255, 107, 107, 0.1);
}

/* =====================================================
   WEBHOOK CARD SMOOTH EXPAND
   ===================================================== */

.webhook-content {
    display: grid;
    grid-template-rows: 0fr;
    padding: 0;
    border-top: none;
    transition: grid-template-rows var(--transition-base);
}

.webhook-card.expanded .webhook-content {
    grid-template-rows: 1fr;
    padding: 0;
    border-top: 1px solid var(--border-color);
}

.webhook-content-inner {
    overflow: hidden;
}

.webhook-card.expanded .webhook-content-inner {
    padding: var(--space-5);
    animation: expandContent 0.3s ease;
}

@keyframes expandContent {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   USERS TABLE MOBILE CARDS
   ===================================================== */

@media (max-width: 768px) {
    .table-mobile-cards thead {
        display: none;
    }

    .table-mobile-cards tbody tr {
        display: block;
        padding: var(--space-4);
        margin-bottom: var(--space-3);
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
    }

    .table-mobile-cards tbody tr.inactive {
        opacity: 0.6;
    }

    .table-mobile-cards tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: var(--space-2) 0;
        border-bottom: 1px solid var(--border-color);
        font-size: 0.9rem;
    }

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

    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-muted);
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }
}

/* =====================================================
   FORM LOADING STATE
   ===================================================== */

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* =====================================================
   ERROR PAGE
   ===================================================== */

.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
}

.error-content {
    text-align: center;
    max-width: 400px;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--space-4);
}

.error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--danger-bg);
    border-radius: var(--radius-xl);
}

.error-icon .lucide {
    width: 36px;
    height: 36px;
    color: var(--danger);
}

.error-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: var(--space-8);
}
