/* ==========================================================================
   ELITE WEBHOOK RECEIVERS CSS
   Glassmorphism, Live Logs, Code Editors
   ========================================================================== */

/* Layout & Globals */
.whk-container { margin-left: 20px; padding: 32px; min-height: 100vh; color: #ffffff; font-family: 'Inter', sans-serif; position: relative; overflow-x: hidden; }
.whk-layout-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* Utilities */
.hidden { display: none !important; opacity: 0; pointer-events: none; }
.m-0 { margin: 0; } .mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.p-0 { padding: 0 !important; } .p-16 { padding: 16px; } .pt-8 { padding-top: 8px; } .pt-16 { padding-top: 16px; } .pt-24 { padding-top: 24px; } .pb-8 { padding-bottom: 8px; } .pb-16 { padding-bottom: 16px; } .border-top { border-top: 1px solid rgba(255,255,255,0.1); } .border-bottom { border-bottom: 1px solid rgba(255,255,255,0.1); }
.text-xs { font-size: 0.75rem; } .text-sm { font-size: 0.85rem; } .text-muted { color: rgba(255,255,255,0.6); } .w-full { width: 100%; } .w-auto { width: auto; } .text-center { text-align: center; } .text-right { text-align: right; }
.uppercase { text-transform: uppercase; } .letter-spacing { letter-spacing: 1px; } .font-bold { font-weight: 700; } .tabular-nums { font-variant-numeric: tabular-nums; }
.flex-between { display: flex; justify-content: space-between; align-items: center; } .flex-align-center { display: flex; align-items: center; } .gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .flex-grow { flex-grow: 1; min-height: 0; } .flex-shrink-0 { flex-shrink: 0; } .cursor-pointer { cursor: pointer; }

/* Palette */
.text-purple { color: #c084fc; } .text-cyan { color: #06b6d4; } .text-gold { color: #fbbf24; } .text-red { color: #ef5350; } .text-green { color: #22c55e; } .text-orange { color: #fb923c; } .text-white { color: #ffffff; }
.bg-purple { background: #c084fc; } .bg-cyan { background: #06b6d4; } .bg-gold { background: #fbbf24; } .bg-green { background: #22c55e; } .bg-red { background: #ef5350; } .bg-dark { background: rgba(0,0,0,0.5); }
.border-red { border: 1px solid rgba(239,83,80,0.4); } .border-cyan { border: 1px solid rgba(6,182,212,0.4); }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulseGlow { 0% { box-shadow: 0 0 0 0 rgba(6,182,212,0.4); } 70% { box-shadow: 0 0 0 15px rgba(6,182,212,0); } 100% { box-shadow: 0 0 0 0 rgba(6,182,212,0); } }
@keyframes pulseDot { 0% { transform: scale(0.8); opacity: 0.5; } 50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 8px currentColor; } 100% { transform: scale(0.8); opacity: 0.5; } }
@keyframes flashGreen { 0% { background: rgba(34,197,94,0.3); } 100% { background: rgba(255,255,255,0.02); } }

.fade-in { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.pulse-btn { animation: pulseGlow 2s infinite; border-radius: 12px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; animation: pulseDot 2s infinite ease-in-out; }
.flash-row { animation: flashGreen 1s ease-out; }

/* Cards & Buttons */
.whk-card { background: rgba(255,255,255,0.03); backdrop-filter: blur(24px) saturate(180%); border: 1px solid rgba(255,255,255,0.08); border-radius: 24px; padding: 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05); transition: all 0.4s; }

.whk-btn { padding: 10px 20px; border-radius: 12px; font-weight: 700; font-size: 0.85rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.3s; border: none; text-transform: uppercase; font-family: inherit; }
.whk-btn--primary { background: linear-gradient(135deg, #06b6d4, #a855f7); color: white; box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3); }
.whk-btn--primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5); }
.whk-btn--primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.whk-btn--secondary { background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); }
.whk-btn--secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); border-color: #06b6d4; color: #06b6d4; }
.whk-btn-icon { background: transparent; border: none; color: rgba(255,255,255,0.6); cursor: pointer; transition: 0.2s; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; }
.whk-btn-icon:hover { color: white; background: rgba(255,255,255,0.1); transform: scale(1.05); }
.whk-btn-icon-small { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.whk-btn-icon-small:hover { background: rgba(6,182,212,0.2); color: #06b6d4; border-color: #06b6d4; }
.whk-btn-text { background: transparent; border: none; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: 0.2s; padding: 0; }
.whk-btn-text:hover { filter: brightness(1.2); }

.whk-input, .whk-select { width: 100%; padding: 10px 14px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: white; border-radius: 8px; transition: 0.3s; font-family: inherit; font-size: 0.85rem; outline: none; }
.whk-input:focus, .whk-select:focus { border-color: #06b6d4; box-shadow: 0 0 0 2px rgba(6,182,212,0.2); }
.whk-form-group { margin-bottom: 16px; }
.whk-form-group label { display: block; margin-bottom: 8px; font-size: 0.85rem; color: rgba(255,255,255,0.8); font-weight: 600; }

.whk-code-input { width: 100%; padding: 16px; background: #000; border: 1px solid rgba(6,182,212,0.3); color: #fbbf24; border-radius: 8px; font-family: monospace; font-size: 0.85rem; resize: vertical; outline: none; }
.whk-code-input:focus { border-color: #06b6d4; box-shadow: 0 0 10px rgba(6,182,212,0.2); }

/* Switch Toggle */
.whk-switch { position: relative; display: inline-block; width: 42px; height: 22px; flex-shrink: 0; }
.whk-switch input { opacity: 0; width: 0; height: 0; }
.whk-slider-toggle { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 24px; }
.whk-slider-toggle:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
.whk-switch input:checked + .whk-slider-toggle { background-color: #06b6d4; }
.whk-switch input:checked + .whk-slider-toggle:before { transform: translateX(20px); }

/* Header & Status */
.whk-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 24px; flex-shrink: 0; }
.whk-header__title { font-size: 2.2rem; font-weight: 800; margin: 0 0 8px 0; letter-spacing: 1px; }
.whk-header__subtitle { color: #06b6d4; margin: 0; font-size: 1rem; }
.whk-header__actions { display: flex; gap: 16px; align-items: center; }

.whk-status-badge { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #4ade80; padding: 6px 12px; border-radius: 16px; font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 1px; }

/* Grid */
.whk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 24px; }
.whk-c-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; padding: 24px; transition: 0.3s; position: relative; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; }
.whk-c-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.04); border-color: rgba(6,182,212,0.4); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.whk-c-card.is-paused { opacity: 0.6; } .whk-c-card.is-paused:hover { opacity: 1; border-color: rgba(251,191,36,0.4); }

.c-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 16px; }
.c-logo { font-size: 1.8rem; width: 44px; height: 44px; background: rgba(0,0,0,0.3); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.c-name { font-size: 1.1rem; font-weight: 800; margin: 0 0 4px 0; color: #fff; }
.c-url { font-size: 0.75rem; color: rgba(255,255,255,0.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; display: inline-block; }
.whk-status-chip { display: flex; align-items: center; gap: 6px; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #fff; background: rgba(255,255,255,0.1); padding: 4px 8px; border-radius: 6px; }

.c-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.c-metric { display: flex; flex-direction: column; }
.c-metric .lbl { font-size: 0.7rem; color: rgba(255,255,255,0.5); text-transform: uppercase; margin-bottom: 2px; }
.c-metric .val { font-size: 1.1rem; font-weight: 700; tabular-nums: tabular-nums; }

.c-spark { width: 100%; height: 40px; margin-bottom: 16px; }
.c-actions { display: flex; gap: 8px; margin-top: auto; }

/* Drawer Detail */
.whk-slide-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 999; transition: opacity 0.4s; }
.whk-slide-panel { position: fixed; top: 0; right: 0; width: 100%; max-width: 650px; height: 100vh; background: #0d0b12; border-left: 1px solid rgba(255,255,255,0.1); z-index: 1000; box-shadow: -10px 0 30px rgba(0,0,0,0.5); transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; }
.whk-slide-panel.open { transform: translateX(0); }
.whk-detail-bg { position: absolute; top:0; left:0; width:100%; height:100%; background: linear-gradient(to bottom, rgba(6,182,212,0.2), #0d0b12 60%); transition: background 0.3s; }
.whk-slide-body { padding: 24px; overflow-y: auto; flex-grow: 1; }

.whk-hero-icon { width: 64px; height: 64px; border-radius: 16px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #fff; }
.whk-action-row { display: flex; gap: 8px; flex-wrap: wrap; }

.whk-tabs { display: flex; gap: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 12px; }
.whk-tab-mini { background: transparent; border: none; color: rgba(255,255,255,0.5); font-weight: 600; cursor: pointer; padding: 6px 12px; transition: 0.2s; text-transform: uppercase; font-size: 0.8rem; border-radius: 8px; }
.whk-tab-mini:hover { color: white; background: rgba(255,255,255,0.05); }
.whk-tab-mini.active { color: #06b6d4; background: rgba(6,182,212,0.1); }
.whk-det-section { animation: fadeInUp 0.3s forwards; }

.whk-copy-box { display: flex; gap: 8px; align-items: center; }
.url-input { font-family: monospace; color: #22c55e; font-weight: 700; font-size: 0.9rem; }
.sec-input { font-family: monospace; color: #fbbf24; font-weight: 700; font-size: 0.9rem; }

/* Events Tab */
.whk-filter-chips { display: flex; gap: 8px; }
.whk-filter-chips button { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.6); padding: 4px 12px; border-radius: 16px; font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: 0.2s; text-transform: uppercase; }
.whk-filter-chips button:hover { color: white; background: rgba(255,255,255,0.1); }
.whk-filter-chips button.active { background: rgba(6,182,212,0.2); color: #06b6d4; border-color: rgba(6,182,212,0.4); }

.whk-events-list { display: flex; flex-direction: column; gap: 8px; }
.evt-row { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); padding: 12px 16px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: 0.2s; border-left: 3px solid transparent; }
.evt-row:hover { background: rgba(255,255,255,0.05); }
.evt-row.st-ok { border-left-color: #22c55e; }
.evt-row.st-err { border-left-color: #ef5350; }

.evt-detail-box { background: rgba(0,0,0,0.3); padding: 16px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); margin-top: 8px; display: none; }
.evt-row.expanded + .evt-detail-box { display: block; animation: fadeInUp 0.2s; }

/* Mapping Tab */
.whk-mapping-grid { display: flex; flex-direction: column; gap: 8px; }
.whk-map-row { display: grid; grid-template-columns: 1fr 40px 1.5fr; gap: 16px; align-items: center; background: rgba(0,0,0,0.2); padding: 12px 16px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); }
.m-target { font-weight: 700; font-size: 0.85rem; color: #fff; }
.m-arrow { color: rgba(255,255,255,0.3); text-align: center; }

/* SVG */
.spark-svg { width: 100%; height: 100%; overflow: visible; }
.spark-line { fill: none; stroke: #06b6d4; stroke-width: 2; stroke-linecap: round; }
.spark-zero { stroke: rgba(255,255,255,0.1); stroke-width: 1; stroke-dasharray: 2; }

/* Modals & Wizard */
.whk-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.whk-modal__overlay { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); }
.whk-modal__content { position: relative; background: #0d0b12; border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; width: 90%; max-height: 90vh; overflow-y: auto; padding: 32px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); animation: popIn 0.3s cubic-bezier(0.16,1,0.3,1) forwards; }
.whk-modal__close { position: absolute; top: 24px; right: 24px; background: none; border: none; color: rgba(255,255,255,0.5); font-size: 1.5rem; cursor: pointer; transition: 0.3s; z-index: 10; }
.whk-modal__close:hover { color: white; }

.whk-wizard { max-width: 600px; padding: 32px; display: flex; flex-direction: column; }
.whk-wizard-body { min-height: 200px; padding: 24px 0 0 0; }

.whk-broker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.whk-broker-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; transition: 0.2s; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.whk-broker-card:hover, .whk-broker-card.selected { background: rgba(6,182,212,0.1); border-color: #06b6d4; transform: translateY(-2px); }
.bkr-ico { font-size: 2rem; }
.bkr-name { font-size: 0.85rem; font-weight: 700; color: #fff; }

.whk-sim-result { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); border-radius: 8px; padding: 16px; min-height: 200px; }