/* WaApi Modern Fonnte-Style Dashboard Styling */
:root {
    --bg-dark: #0a0812;
    --card-bg: rgba(20, 18, 33, 0.6);
    --card-border: rgba(255, 255, 255, 0.06);
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.35);
    --indigo: #6366f1;
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --danger: #f43f5e;
    --danger-glow: rgba(244, 63, 94, 0.2);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --font-family: 'Outfit', sans-serif;
    --radius-lg: 16px;
    --radius-md: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    overflow-y: auto;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Glass & Glow Ambient Background */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 50%, #151129 0%, #08060f 100%);
    z-index: -3;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: -2;
    pointer-events: none;
    animation: floating 12s infinite alternate ease-in-out;
}

#orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: 10%;
    left: 5%;
}

#orb-2 {
    width: 500px;
    height: 500px;
    background: var(--indigo);
    bottom: 10%;
    right: 5%;
    animation-delay: -3s;
}

@keyframes floating {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 40px) scale(1.1); }
}

/* Layout Wrapper */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Glass Sidebar Navigation */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    display: flex;
    flex-direction: column;
    padding: 35px 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 2.2rem;
    background: linear-gradient(135deg, #c084fc 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-gradient {
    background: linear-gradient(135deg, #a78bfa 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.brand-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    width: 100%;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--indigo) 100%);
    box-shadow: 0 4px 15px var(--primary-glow);
}

/* Sidebar Accordion Styles */
.nav-accordion {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.accordion-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.accordion-arrow {
    font-size: 0.75rem !important;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.nav-accordion.open .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding-left: 15px;
    margin-top: 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.nav-accordion.open .accordion-content {
    display: flex;
}

.submenu-item {
    font-size: 0.85rem;
    padding: 10px 14px;
    margin-left: 5px;
    opacity: 0.8;
}

.submenu-item i {
    font-size: 0.95rem;
}

.submenu-item:hover, .submenu-item.active {
    opacity: 1;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Main Content Area */
.main-wrapper {
    flex-grow: 1;
    padding: 35px 35px 80px 35px; /* Extra bottom padding to prevent content cutoff */
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

/* Header Bar */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-radius: var(--radius-lg);
}

.header-title h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

/* General Card Design */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i {
    font-size: 1.25rem;
}

/* 1. DASHBOARD TAB STYLING */
/* Stats grid cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

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

.bg-primary-soft { background: rgba(139, 92, 246, 0.1); }
.bg-success-soft { background: rgba(16, 185, 129, 0.1); }
.bg-info-soft { background: rgba(6, 182, 212, 0.1); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-info { color: #06b6d4; }

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.stat-info p {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Details grid overview */
.details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.detail-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.detail-card i {
    font-size: 1.2rem;
    color: var(--primary);
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 50%;
}

.detail-info h4 {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.detail-info p {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.truncate {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* 2. DEVICE TAB STYLING (Fonnte-Style) */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
}

.fonnte-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.fonnte-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.fonnte-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.fonnte-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.device-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-icon {
    font-size: 1.8rem;
    color: var(--success);
    background: rgba(16, 185, 129, 0.08);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-meta {
    display: flex;
    flex-direction: column;
}

.profile-number {
    font-weight: 600;
    color: var(--text-main);
}

.profile-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.table-badge-url {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.table-badge-online {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 500;
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.08);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(96, 165, 250, 0.15);
}

.token-code {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #f472b6;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
}

.stat-connected {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.15);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.08);
}

.stat-disconnected {
    background: rgba(244, 63, 94, 0.08);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.15);
}

.stat-connecting {
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

.stat-connected .status-dot {
    animation: pulse 1.5s infinite alternate;
}

/* Header Connection Status Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
}

.badge-connected {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.badge-disconnected {
    background: rgba(244, 63, 94, 0.08);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.2);
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.1);
}

.badge-connecting {
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
}

.badge-connected .pulse-dot {
    animation: pulse 1.5s infinite alternate;
}
.badge-connecting .pulse-dot {
    animation: pulse 1s infinite alternate;
}

.action-buttons {
    display: flex;
    gap: 6px;
}

.btn-icon-only {
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.btn-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.btn-warning:hover {
    background: #f59e0b;
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* QR Code Scan Area (Device Tab) */
.qr-setup-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px 20px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    animation: fadeIn 0.4s ease-out;
}

.qr-container-wrapper {
    position: relative;
    width: 240px;
    height: 240px;
    background: white;
    padding: 12px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    overflow: hidden;
}

#qr-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.qr-scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.scanner-line {
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--primary), transparent);
    box-shadow: 0 0 10px var(--primary);
    position: absolute;
    top: 0;
    animation: scan 3s infinite linear;
}

@keyframes scan {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

.qr-setup-area h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.step-guide {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 480px;
    text-align: center;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 12px 16px;
    border-radius: var(--radius-md);
}

/* Spinner for Loading State */
.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin: 30px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Tab Management */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--indigo) 100%);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.55);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px var(--danger-glow);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--text-main);
}

/* Forms styling */
.interactive-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.input-wrapper i.align-start {
    top: 14px;
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 12px 14px 12px 42px;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.input-wrapper select {
    appearance: none;
    -webkit-appearance: none;
}

.glass-input {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.input-wrapper select,
select.glass-input {
    padding-right: 32px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%239ca3af'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='6%209%2012%2015%2018%209'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    cursor: pointer;
}

.input-wrapper select option,
select.glass-input option {
    background-color: #121021;
    color: var(--text-main);
}

.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus,
.glass-input:focus {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

/* Response alert panels */
.alert-message {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.4;
    animation: slideUp 0.3s ease-out;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.alert-danger {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--danger);
}

/* API Docs section */
.docs-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 14px;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--card-border);
    border-bottom: none;
    font-size: 0.75rem;
    color: var(--text-muted);
}

pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 0 0 8px 8px;
    padding: 16px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #e5e7eb;
}

.highlight-token {
    color: #f472b6;
    font-weight: 600;
}

/* Edit Config Modal (Overlay + Scale animation) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 4, 10, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 60px 15px;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-card {
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close-btn:hover {
    color: var(--text-main);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Success Checkmark Animation */
.success-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    box-shadow: 0 0 30px var(--success-glow);
}

.success-icon-wrapper i {
    font-size: 3rem;
    color: var(--success);
}

.scale-up-in {
    animation: scaleUpIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUpIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0% { transform: scale(0.85); opacity: 0.5; }
    100% { transform: scale(1.2); opacity: 1; }
}

/* API Docs Styles */
.docs-section {
    margin-bottom: 35px;
}
.endpoint-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.badge-method {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}
.badge-method.post {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge-method.get {
    background: rgba(99, 102, 241, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(99, 102, 241, 0.2);
}
.endpoint-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}
.docs-sub-heading {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 15px 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.api-table-wrapper {
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.15);
}
.api-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
}
.api-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 14px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}
.api-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    vertical-align: middle;
}
.api-table tr:last-child td {
    border-bottom: none;
}
.param-name {
    font-family: monospace;
    color: #f472b6;
    font-weight: 600;
    font-size: 0.85rem;
}
.param-type {
    font-family: monospace;
    font-size: 0.78rem;
    color: #60a5fa;
}
.param-required {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}
.param-required.yes {
    background: rgba(244, 63, 94, 0.1);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.15);
}
.param-required.no {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.docs-tabs-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 8px 0;
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--card-border);
    border-bottom: none;
}
.doc-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    transition: var(--transition);
}
.doc-tab-btn:hover {
    color: var(--text-main);
}
.doc-tab-btn.active {
    color: white;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 2px solid var(--primary);
}
.docs-tab-content {
    display: none;
}
.docs-tab-content.active {
    display: block;
}
.docs-tab-content pre {
    margin-top: 0;
    border-radius: 0 0 8px 8px;
}
.responses-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 10px;
}
@media (max-width: 768px) {
    .responses-grid {
        grid-template-columns: 1fr;
    }
}
.response-box {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.response-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.response-header.success {
    color: var(--success);
}
.response-header.error {
    color: var(--danger);
}
.response-box pre {
    margin: 0;
    border: none;
    border-radius: 0;
    font-size: 0.78rem;
    background: rgba(0, 0, 0, 0.15);
}
.docs-divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 35px 0;
}

/* Sidebar Toggle & Close Buttons (Desktop Hidden) */
.sidebar-toggle-btn {
    display: none;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    font-size: 1.25rem;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 1.2rem;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.sidebar-close-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 3, 8, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Utility Helper */
.flex-align-center {
    display: flex;
    align-items: center;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
    }

    /* Fixed Drawer Navigation Sidebar */
    .sidebar {
        position: fixed;
        top: 0;
        left: -290px; /* Hidden offscreen initially */
        width: 280px;
        height: 100vh;
        z-index: 1000;
        border-right: 1px solid var(--card-border);
        border-top: none;
        border-bottom: none;
        border-radius: 0;
        background: rgba(10, 8, 18, 0.96); /* Higher opacity for mobile readability */
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        box-shadow: 20px 0 40px rgba(0, 0, 0, 0.6);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 35px 24px;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-close-btn {
        display: flex; /* Show close button on mobile drawer */
    }

    .sidebar-toggle-btn {
        display: inline-flex; /* Show hamburger menu on mobile */
    }

    /* Reset sidebar-menu back to column for accordion flow */
    .sidebar-menu {
        flex-direction: column;
        overflow-x: visible;
        padding-bottom: 0;
        gap: 8px;
    }

    .nav-item {
        width: 100%;
        white-space: normal;
    }

    /* Main Content Wrapper */
    .main-wrapper {
        padding: 16px 16px 60px 16px;
        width: 100%;
        min-width: 0;
        gap: 16px;
    }

    .app-header {
        padding: 12px 16px;
        border-radius: var(--radius-md);
    }

    .header-title h2 {
        font-size: 1.15rem;
    }

    .global-status {
        font-size: 0.85rem;
    }

    /* Form action button responsiveness */
    .form-actions {
        width: 100%;
    }
    .form-actions .btn {
        width: 100%;
    }

    /* Grids Stack */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .responses-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Table & Pre Block Scroll safety */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .fonnte-table, .api-table {
        min-width: 650px; /* Ensure columns have adequate space, triggers smooth horizontal scrolling */
    }

    pre {
        max-width: 100%;
        overflow-x: auto;
        white-space: pre;
        word-wrap: normal;
    }

    /* Modal adjustments for small viewports */
    .modal-overlay {
        padding: 20px 10px;
    }

    .modal-card {
        padding: 20px 16px;
        width: 100%;
    }

    /* Header actions layout stack */
    .card-header.flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .card-header .header-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .card-header .header-actions select, 
    .card-header .header-actions button {
        width: 100% !important;
        margin-right: 0 !important;
    }
}

@media (max-width: 480px) {
    #status-text {
        display: none;
    }
    .badge {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
        align-items: center;
        gap: 0;
    }
    .pulse-dot {
        margin: 0;
    }
}

