/* ==============================
   Asena İHA — API Panel Styles
   ============================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-sidebar: #0d1220;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-input: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-active: rgba(99, 102, 241, 0.4);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-1: #6366f1;
    --accent-2: #8b5cf6;
    --accent-3: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
    --glow-1: rgba(99, 102, 241, 0.3);
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-1);
    border-radius: 3px;
}

/* ─── Sidebar ────────────────────── */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition-smooth);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.sidebar-header h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-header small {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav .nav-section {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 12px 12px 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    margin-bottom: 2px;
}

.sidebar-nav a:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-1);
}

.sidebar-nav a i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-glass);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.sidebar-footer a:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

/* ─── Main Content ───────────────── */
.main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── Top Bar ────────────────────── */
.topbar {
    padding: 16px 32px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 14, 23, 0.7);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-search {
    position: relative;
}

.topbar-search input {
    padding: 9px 16px 9px 36px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    width: 240px;
    transition: var(--transition-fast);
}

.topbar-search input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px var(--glow-1);
}

.topbar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.95rem;
}

.btn-icon:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-1);
    border-color: var(--accent-1);
}

/* ─── Page Content ───────────────── */
.page-content {
    flex: 1;
    padding: 28px 32px;
}

/* ─── Stats Row ──────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.stat-card-header .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.stat-icon.green {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-2);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.stat-card-value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 100px;
}

.stat-badge.up {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.stat-badge.down {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

/* ─── Panel Sections ─────────────── */
.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.panel-card.full-width {
    grid-column: 1 / -1;
}

.panel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-glass);
}

.panel-card-header h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
}

.panel-card-body {
    padding: 20px 22px;
}

/* ─── Buttons ────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 12px var(--glow-1);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--glow-1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

.btn-outline:hover {
    background: var(--bg-glass);
    border-color: var(--accent-1);
    color: var(--text-primary);
}

/* ─── API Endpoint List ──────────── */
.endpoint-list {
    max-height: 420px;
    overflow-y: auto;
}

.endpoint-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: var(--transition-fast);
}

.endpoint-item:last-child {
    border-bottom: none;
}

.endpoint-item:hover {
    background: rgba(255, 255, 255, 0.01);
    padding-left: 6px;
}

.method-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    min-width: 56px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-badge.get {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.method-badge.post {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info);
}

.method-badge.put {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.method-badge.delete {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.method-badge.patch {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-2);
}

.endpoint-info {
    flex: 1;
}

.endpoint-path {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.endpoint-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.endpoint-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: var(--transition-fast);
}

.endpoint-item:hover .endpoint-actions {
    opacity: 1;
}

.endpoint-actions button {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    transition: var(--transition-fast);
}

.endpoint-actions button:hover {
    color: var(--accent-1);
    border-color: var(--accent-1);
}

.endpoint-actions button.delete-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* ─── API Tester Form ────────────── */
.tester-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.tester-method {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    min-width: 100px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 8L9 4.5' fill='none' stroke='%2394a3b8' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.tester-method option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.tester-url {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-fast);
}

.tester-url:focus,
.tester-method:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 2px var(--glow-1);
}

.tester-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-glass);
}

.tester-tab {
    padding: 8px 18px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
}

.tester-tab.active {
    color: var(--accent-1);
    border-bottom-color: var(--accent-1);
}

.tester-tab:hover {
    color: var(--text-primary);
}

.tester-body {
    width: 100%;
    min-height: 100px;
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    outline: none;
    resize: vertical;
    line-height: 1.6;
    transition: var(--transition-fast);
}

.tester-body:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 2px var(--glow-1);
}

/* ─── Response Viewer ────────────── */
.response-viewer {
    margin-top: 16px;
}

.response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.response-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
}

.response-status .status-code {
    font-family: var(--font-mono);
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
}

.status-code.s2xx {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.status-code.s3xx {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info);
}

.status-code.s4xx {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.status-code.s5xx {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.response-time {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.response-body {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-3);
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.7;
}

/* ─── Modal ──────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 520px;
    padding: 0;
    transform: scale(0.9) translateY(20px);
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-md);
}

.modal-overlay.open .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-glass);
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--bg-glass);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition-fast);
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 2px var(--glow-1);
}

.modal-body select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 8L9 4.5' fill='none' stroke='%2394a3b8' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.modal-body select option {
    background: var(--bg-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-glass);
}

/* ─── Empty state ────────────────── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ─── Toast ──────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.4s ease forwards;
    min-width: 260px;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.info {
    background: var(--info);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(60px);
    }
}

/* ─── Responsive ─────────────────── */
@media (max-width: 1024px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }

    .sidebar.open {
        width: 260px;
    }

    .main-content {
        margin-left: 0;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 14px 16px;
    }

    .page-content {
        padding: 20px 16px;
    }

    .topbar-search input {
        width: 160px;
    }

    .tester-row {
        flex-direction: column;
    }
}