/* ============================================
   MockServer — Global Stylesheet
   Built on Bootstrap 5 + Open Sans
   ============================================ */

:root {
    --me-bg:        #F8F9FB;
    --me-sidebar:   #1A1D23;
    --me-sidebar-hover: #2D3139;
    --me-primary:   #4F6EF7;
    --me-primary-dark: #3a56d4;
    --me-success:   #22C98E;
    --me-warning:   #F5A623;
    --me-danger:    #E5534B;
    --me-info:      #5BC0DE;
    --me-text:      #1A1D23;
    --me-muted:     #6C757D;
    --me-border:    #E4E7EC;
    --me-card:      #FFFFFF;
    --me-sidebar-w: 230px;
}

/* Base */
body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--me-bg);
    color: var(--me-text);
    font-size: 0.875rem;
}

/* ============================================
   AUTH LAYOUT
   ============================================ */
.auth-topbar {
    background-color: var(--me-sidebar);
    padding: 1rem 2rem;
}

.auth-topbar .brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.3px;
}

.auth-topbar .brand span {
    color: var(--me-primary);
}

.auth-card {
    background: var(--me-card);
    border: 1px solid var(--me-border);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    width: 100%;
    max-width: 440px;
}

.auth-card .auth-icon {
    width: 52px;
    height: 52px;
    background: rgba(79,110,247,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.4rem;
}

/* OTP Input */
.otp-inputs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.otp-inputs input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid var(--me-border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
    color: var(--me-text);
}

.otp-inputs input:focus {
    border-color: var(--me-primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,0.15);
}

.otp-inputs input.filled {
    border-color: var(--me-primary);
    background-color: rgba(79,110,247,0.04);
}

/* ============================================
   APP LAYOUT — SIDEBAR
   ============================================ */
.me-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--me-sidebar-w);
    height: 100vh;
    background: var(--me-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.me-sidebar .sidebar-brand {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.me-sidebar .sidebar-brand a {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.3px;
}

.me-sidebar .sidebar-brand a span {
    color: var(--me-primary);
}

.pro-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    background: linear-gradient(135deg, #f5a623 0%, #e8920f 100%);
    color: #fff;
    vertical-align: middle;
    margin-left: 8px;
    line-height: 1.6;
}

.sidebar-feedback-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.75rem;
    margin-top: 0.35rem;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.45);
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.sidebar-feedback-btn:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.75);
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 0.75rem 1.25rem 0.25rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1.25rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: var(--me-sidebar-hover);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--me-sidebar-hover);
    border-left-color: var(--me-primary);
}

.sidebar-nav .nav-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.sidebar-footer .user-chip {
    background: rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-footer .user-chip .avatar {
    width: 30px;
    height: 30px;
    background: var(--me-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-footer .user-chip .user-info {
    min-width: 0;
}

.sidebar-footer .user-chip .user-email {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer .user-chip .user-slug {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   APP LAYOUT — MAIN CONTENT
   ============================================ */
.me-main {
    margin-left: var(--me-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.me-topbar {
    background: var(--me-card);
    border-bottom: 1px solid var(--me-border);
    padding: 0.75rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.me-topbar .page-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--me-text);
    margin: 0;
}

.me-content {
    flex: 1;
    padding: 1.75rem;
}

/* ============================================
   CARDS & PANELS
   ============================================ */
.me-card {
    background: var(--me-card);
    border: 1px solid var(--me-border);
    border-radius: 10px;
    padding: 1.25rem;
}

.me-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.me-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--me-text);
    margin: 0;
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
    background: var(--me-card);
    border: 1px solid var(--me-border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}

.stat-card .stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--me-muted);
    margin-bottom: 0.4rem;
}

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

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* ============================================
   TABLES
   ============================================ */
.me-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.835rem;
}

.me-table th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--me-muted);
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--me-border);
    text-align: left;
    background: var(--me-bg);
    white-space: nowrap;
}

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

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

.me-table tr:hover td {
    background: rgba(79,110,247,0.02);
}

/* ============================================
   METHOD BADGES
   ============================================ */
.badge-method {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    min-width: 52px;
    text-align: center;
}

.badge-GET    { background: rgba(34,201,142,0.12); color: #17a471; }
.badge-POST   { background: rgba(91,192,222,0.12); color: #2a97b8; }
.badge-PUT    { background: rgba(245,166,35,0.12); color: #c98000; }
.badge-PATCH  { background: rgba(245,166,35,0.12); color: #c98000; }
.badge-DELETE { background: rgba(229,83,75,0.12);  color: #c0392b; }
.badge-OPTIONS { background: rgba(108,117,125,0.12); color: #555; }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    background-color: var(--me-primary) !important;
    border-color: var(--me-primary) !important;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--me-primary-dark) !important;
    border-color: var(--me-primary-dark) !important;
}

.btn-outline-primary {
    color: var(--me-primary) !important;
    border-color: var(--me-primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--me-primary) !important;
    color: #fff !important;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    border: 1px solid var(--me-border);
    background: transparent;
    color: var(--me-muted);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.8rem;
}

.btn-icon:hover { background: var(--me-bg); color: var(--me-text); }
.btn-icon.danger:hover { background: rgba(229,83,75,0.08); color: var(--me-danger); border-color: var(--me-danger); }

/* ============================================
   FORMS
   ============================================ */
.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--me-text);
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    border: 1px solid var(--me-border);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--me-text);
    background-color: var(--me-card);
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s, color 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--me-primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,0.15);
    outline: none;
    background-color: var(--me-card);
    color: var(--me-text);
}

.form-control::placeholder {
    color: var(--me-muted);
    opacity: 0.6;
}

/* Disabled inputs — keep background consistent, just dim with opacity */
.form-control:disabled, .form-select:disabled,
.form-control[readonly] {
    background-color: var(--me-bg) !important;
    color: var(--me-muted) !important;
    border-color: var(--me-border) !important;
    opacity: 0.6;
    cursor: not-allowed;
}

/* option elements inherit select background (browser-dependent) */
.form-select option {
    background-color: var(--me-card);
    color: var(--me-text);
}

textarea.form-control {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    resize: vertical;
}

.input-group-text {
    background-color: var(--me-bg);
    border-color: var(--me-border);
    color: var(--me-muted);
    transition: background-color 0.2s, border-color 0.2s;
}

/* btn-outline-secondary — theme-aware */
.btn-outline-secondary {
    color: var(--me-muted) !important;
    border-color: var(--me-border) !important;
    background: transparent !important;
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background: var(--me-bg) !important;
    color: var(--me-text) !important;
    border-color: var(--me-muted) !important;
}

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

/* ============================================
   CODE / URL DISPLAY
   ============================================ */
.endpoint-url {
    background: var(--me-bg);
    border: 1px solid var(--me-border);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.78rem;
    color: var(--me-primary);
    word-break: break-all;
}

/* ============================================
   LIVE FEED PULSE
   ============================================ */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--me-muted);
}

.live-indicator .dot {
    width: 7px;
    height: 7px;
    background: var(--me-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

/* ============================================
   AD BANNER SLOT
   ============================================ */
.ad-banner-slot {
    background: var(--me-bg);
    border: 1px dashed var(--me-border);
    border-radius: 8px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--me-muted);
    font-size: 0.75rem;
    margin-top: auto;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--me-muted);
}

.empty-state .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border-radius: 9px;
    font-size: 0.85rem;
    border: none;
}

/* ============================================
   MODALS
   ============================================ */
.modal-content {
    border-radius: 12px;
    border: 1px solid var(--me-border);
    background-color: var(--me-card);
    color: var(--me-text);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid var(--me-border);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.modal-footer {
    border-top: 1px solid var(--me-border);
    padding: 1rem 1.5rem;
}

/* Template cards in modal */
.template-card {
    border: 2px solid var(--me-border);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: var(--me-primary);
    background: rgba(79,110,247,0.04);
}

.template-card.selected {
    border-color: var(--me-primary);
    background: rgba(79,110,247,0.06);
}

.template-card .template-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.template-card h6 {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.template-card p {
    font-size: 0.72rem;
    color: var(--me-muted);
    margin: 0;
}

/* ============================================
   TIER BADGE
   ============================================ */
.tier-free { background: rgba(108,117,125,0.1); color: var(--me-muted); }
.tier-paid { background: rgba(79,110,247,0.12); color: var(--me-primary); }

.tier-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--me-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #c0c7d0; }

/* ============================================
   UTILITIES
   ============================================ */
.text-primary { color: var(--me-primary) !important; }
.bg-primary   { background-color: var(--me-primary) !important; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.font-mono {
    font-family: 'Fira Code', 'Courier New', monospace;
}

.cursor-pointer { cursor: pointer; }

.gap-2 { gap: 0.5rem !important; }

