/* ============================================
   Standard Grid Solutions – Dark Mode SPA Theme
   Ultra-Premium SaaS Dashboard Styles
   ============================================ */

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #030303;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---- DECOY WALL ---- */
.decoy-wall {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 40px;
    padding: 20px;
    background: #030303;
    position: relative;
}

.decoy-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
}

.decoy-glow {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 70%);
    z-index: 0;
}

.decoy-topbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 900px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.decoy-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.95rem;
}

.decoy-nav {
    display: flex;
    gap: 24px;
}

.decoy-nav a {
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.decoy-nav a:hover {
    color: #00d4ff;
}

.decoy-main {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.decoy-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0,212,255,0.06);
    border: 1px solid rgba(0,212,255,0.12);
    border-radius: 20px;
    font-size: 0.8rem;
    color: #00d4ff;
}

.decoy-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00d4ff;
    animation: pulse 2s infinite;
}

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

.decoy-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    max-width: 600px;
}

.decoy-subtitle {
    color: #888;
    font-size: 1rem;
    max-width: 500px;
    line-height: 1.6;
}

.decoy-progress {
    width: 100%;
    max-width: 500px;
}

.decoy-progress-bar {
    width: 100%;
    height: 6px;
    background: #1a1a1a;
    border-radius: 3px;
    overflow: hidden;
}

.decoy-progress-fill {
    height: 100%;
    width: 62%;
    background: linear-gradient(90deg, #00d4ff, #00ffaa);
    border-radius: 3px;
    animation: progressAnim 3s ease-in-out infinite alternate;
}

@keyframes progressAnim {
    0% { width: 55%; }
    100% { width: 70%; }
}

.decoy-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #666;
}

.decoy-cards {
    display: flex;
    gap: 16px;
}

.decoy-card {
    background: #0d0d12;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 20px 32px;
    text-align: center;
    min-width: 140px;
}

.decoy-card-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.decoy-card-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00d4ff;
}

.decoy-footer {
    position: relative;
    z-index: 1;
    margin-top: 40px;
}

.decoy-copyright {
    font-size: 0.8rem;
    color: #444;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: color 0.3s;
}

.decoy-copyright:hover {
    color: #00d4ff;
}

.decoy-secret-trigger {
    display: inline-block;
    width: 0;
    height: 0;
    overflow: hidden;
}

.decoy-fineprint {
    font-size: 0.7rem;
    color: #333;
    margin-top: 8px;
}

/* ---- SECURE VERIFICATION ---- */
.secure-verification {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #030303;
}

.secure-verification-content {
    text-align: center;
}

.secure-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0,212,255,0.15);
    border-top-color: #00d4ff;
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

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

.secure-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 8px;
}

.secure-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.secure-log {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #00ff88;
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
    background: #0d0d12;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 16px;
    max-height: 160px;
    overflow-y: auto;
}

.secure-log .log-line {
    padding: 4px 0;
    opacity: 0;
    animation: fadeInLog 0.4s ease forwards;
}

@keyframes fadeInLog {
    to { opacity: 1; }
}

/* ---- OTP OVERLAY ---- */
.otp-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(3,3,3,0.85);
    backdrop-filter: blur(12px);
}

.otp-modal {
    background: rgba(13,13,18,0.9);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 48px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 60px rgba(0,212,255,0.08);
    animation: slideUp 0.5s ease;
}

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

.otp-modal h2 {
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 8px;
}

.otp-modal p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.otp-input {
    width: 100%;
    padding: 16px 20px;
    background: #0d0d14;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: #e0e0e0;
    font-size: 1.2rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 8px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
}

.otp-input:focus {
    border-color: #00d4ff;
}

.otp-error {
    color: #ff4466;
    font-size: 0.85rem;
    margin-top: 12px;
}

.otp-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.otp-submit {
    padding: 14px 36px;
    background: #00d4ff;
    color: #0a0a0a;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
}

.otp-submit:hover {
    background: #00b8e0;
    box-shadow: 0 0 20px rgba(0,212,255,0.3);
}

.otp-cancel {
    padding: 14px 36px;
    background: transparent;
    color: #888;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.otp-cancel:hover {
    border-color: rgba(255,255,255,0.15);
    color: #ccc;
}

.otp-hint {
    font-size: 0.8rem;
    color: #555;
    margin-top: 16px;
}

/* ---- COCKPIT ---- */
.cockpit {
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    height: 100vh;
    background: #030303;
}

/* ---- SIDEBAR LEFT ---- */
.sidebar-left {
    background: #06060a;
    border-right: 1px solid rgba(255,255,255,0.04);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 8px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #888;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.nav-tab svg {
    flex-shrink: 0;
    transition: stroke 0.3s ease, filter 0.3s ease;
}

.nav-tab:hover {
    background: rgba(255,255,255,0.04);
    color: #bbb;
}

.nav-tab:hover svg {
    stroke: #00d4ff;
    filter: drop-shadow(0 0 6px rgba(0,212,255,0.5));
}

.nav-tab.active {
    background: rgba(0,212,255,0.08);
    color: #00d4ff;
}

.nav-tab.active svg {
    stroke: #00d4ff;
    filter: drop-shadow(0 0 8px rgba(0,212,255,0.6));
}

.sidebar-status {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 0.8rem;
    color: #666;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4466;
    box-shadow: 0 0 8px rgba(255,68,102,0.6);
    animation: pulse 2s infinite;
}

/* ---- SIDEBAR RIGHT ---- */
.sidebar-right {
    background: #06060a;
    border-left: 1px solid rgba(255,255,255,0.04);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reference-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ref-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #0d0d12;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #888;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.03);
}

.ref-file:hover {
    background: rgba(0,212,255,0.04);
    border-color: rgba(0,212,255,0.1);
    color: #bbb;
}

.ref-file svg {
    color: #00d4ff;
    flex-shrink: 0;
    transition: filter 0.3s;
}

.ref-file:hover svg {
    filter: drop-shadow(0 0 4px rgba(0,212,255,0.4));
}

/* ---- MAIN CONTENT ---- */
.main-content {
    overflow-y: auto;
    padding: 32px;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: viewFadeIn 0.5s ease;
}

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

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.view-eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #666;
    margin-bottom: 4px;
}

.view-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.view-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meta-pill {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: #888;
}

.meta-pill-live {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #00ff88;
    border-color: rgba(0,255,136,0.15);
}

.meta-pill-live .meta-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 8px rgba(0,255,136,0.5);
    animation: pulse 2s infinite;
}

.meta-pill-ok {
    color: #00ff88;
    border-color: rgba(0,255,136,0.15);
}

.meta-pill-warn {
    color: #ffaa00;
    border-color: rgba(255,170,0,0.15);
}

/* ---- GLASS CARD ---- */
.glass-card {
    background: rgba(13,13,18,0.7);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 24px;
    backdrop-filter: blur(12px);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.glass-card:hover {
    border-color: rgba(0,212,255,0.1);
    box-shadow: 0 0 30px rgba(0,212,255,0.04);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.panel-head h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #ddd;
}

/* ---- API GRID ---- */
.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.api-detail {
    font-size: 0.85rem;
    color: #888;
    padding: 6px 0;
}

.api-detail span:first-child {
    color: #666;
    margin-right: 6px;
}

/* ---- VAULT ---- */
.vault-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.vault-field {
    margin-bottom: 16px;
}

.vault-field label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.vault-input {
    width: 100%;
    padding: 12px 16px;
    background: #0d0d14;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.3s;
}

.vault-input:focus {
    border-color: #00d4ff;
}

.vault-textarea {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    resize: vertical;
}

.action-btn {
    background: rgba(0,212,255,0.08);
    color: #00d4ff;
    border: 1px solid rgba(0,212,255,0.15);
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.action-btn:hover {
    background: rgba(0,212,255,0.15);
    border-color: rgba(0,212,255,0.3);
    box-shadow: 0 0 16px rgba(0,212,255,0.1);
}

/* ---- CHAT ---- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    background: rgba(13,13,18,0.5);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 16px;
    overflow: hidden;
}

.chat-stream {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-bubble {
    display: flex;
    gap: 12px;
    max-width: 70%;
    animation: bubbleSlide 0.4s ease;
}

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

.chat-bubble.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-bubble.assistant {
    align-self: flex-start;
}

.bubble-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,212,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00d4ff;
    flex-shrink: 0;
}

.bubble-content {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 12px 16px;
}

.chat-bubble.user .bubble-content {
    background: rgba(0,212,255,0.08);
    border-color: rgba(0,212,255,0.15);
}

.bubble-sender {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #00d4ff;
    margin-bottom: 4px;
}

.bubble-text {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.5;
}

.chat-input-area {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    background: #0d0d14;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input:focus {
    border-color: #00d4ff;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: rgba(0,212,255,0.1);
    border: 1px solid rgba(0,212,255,0.2);
    border-radius: 10px;
    color: #00d4ff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chat-send-btn:hover {
    background: rgba(0,212,255,0.2);
    box-shadow: 0 0 16px rgba(0,212,255,0.2);
}

/* ---- SYSTEM HEALTH ---- */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.health-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.meter-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.meter-head span {
    font-size: 0.85rem;
    color: #888;
}

.meter-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: #00d4ff;
}

.meter-bar {
    height: 6px;
    background: #1a1a1a;
    border-radius: 3px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #00ffaa);
    border-radius: 3px;
    transition: width 0.8s ease;
}

.firewall-panel {
    max-height: 400px;
}

.firewall-log {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #666;
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 0;
}

.firewall-log .log-entry {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    animation: fadeInLog 0.4s ease forwards;
}

.firewall-log .log-entry.ban {
    color: #ff4466;
}

.firewall-log .log-entry.unban {
    color: #00ff88;
}

.firewall-log .log-entry.info {
    color: #00d4ff;
}

.activity-log {
    max-height: 200px;
    overflow-y: auto;
}

.activity-entry {
    font-size: 0.85rem;
    color: #888;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-ok { background: #00ff88; }
.dot-warn { background: #ffaa00; }
.dot-err { background: #ff4466; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1200px) {
    .cockpit {
        grid-template-columns: 240px 1fr 260px;
    }
}

@media (max-width: 768px) {
    .cockpit {
        grid-template-columns: 1fr;
    }
    .sidebar-left, .sidebar-right {
        display: none;
    }
    .main-content {
        padding: 16px;
    }
    .decoy-title {
        font-size: 1.5rem;
    }
    .decoy-cards {
        flex-direction: column;
    }
    .health-grid-2 {
        grid-template-columns: 1fr;
    }
}
