/* --- Global Styles --- */
:root {
    --bg-main: #0b1120;
    --bg-card: #1e293b;
    --bg-card-hover: #26354a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --border-color: #334155;
    --get-color: #10b981;
    --post-color: #f59e0b;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    margin: 0;
    display: flex;
    background-color: var(--bg-main);
    color: var(--text-main);
    scroll-behavior: smooth;
    line-height: 1.6;
}

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.fade-in { animation: fadeIn 0.8s ease-out forwards; }
.slide-up { animation: slideUp 0.6s ease-out forwards; opacity: 0; }
.api-card:nth-child(2) { animation-delay: 0.1s; }
.api-card:nth-child(3) { animation-delay: 0.2s; }
.api-card:nth-child(4) { animation-delay: 0.3s; }

/* --- Mobile Header --- */
.mobile-header {
    display: none;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px 20px;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-color);
}
.mobile-title { font-size: 1.2rem; font-weight: 700; color: var(--accent); letter-spacing: 0.5px;}
.menu-btn { background: none; border: none; color: white; cursor: pointer; padding: 5px; display: flex; align-items: center;}

/* --- Sidebar --- */
.sidebar {
    width: 280px;
    background: var(--bg-card);
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    z-index: 1001;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-header {
    padding: 25px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-header h2 { margin: 0; font-size: 1.3rem; color: var(--accent); }
.close-btn { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; transition: color 0.2s;}
.close-btn:hover { color: white; }

.search-container { padding: 20px; }
.search-box {
    width: 100%;
    padding: 12px 15px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s;
}
.search-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.nav-links { padding: 10px 20px; overflow-y: auto; flex-grow: 1; }
.nav-links a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.nav-links a:hover {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    border-left: 3px solid var(--accent);
    transform: translateX(4px);
}

/* --- Main Content --- */
.main-content {
    margin-left: 280px;
    padding: 50px 5%; /* Use percentage for dynamic width */
    width: calc(100% - 280px);
    box-sizing: border-box;
}

/* For very large ultra-wide screens to keep it looking clean */
@media screen and (min-width: 1500px) {
    .main-content {
        padding-left: 8%;
        padding-right: 8%;
    }
}

.hero-section { margin-bottom: 50px; }
.hero-section h1 { font-size: 2.8rem; margin-bottom: 15px; font-weight: 700; letter-spacing: -0.5px;}
.hero-section p { color: var(--text-muted); font-size: 1.15rem; max-width: 800px;} /* Keep paragraph readable */

/* Base URL Card */
.base-url-card {
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 20px;
    border-radius: 12px;
    margin-top: 30px;
    max-width: 800px;
}
.base-url-label { font-size: 0.9rem; font-weight: 600; color: var(--accent); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px;}
.base-url-input-group { display: flex; gap: 10px; margin-bottom: 10px; }
.base-url-input-group input {
    flex-grow: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 15px;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
.base-url-input-group input:focus { border-color: var(--accent); }
.base-url-card small { color: var(--text-muted); font-size: 0.85rem; }

/* API Cards */
.api-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    scroll-margin-top: 40px;
    transition: all 0.3s ease;
    width: 100%; /* Make cards take full width available */
    box-sizing: border-box;
}
.api-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
    border-color: #475569;
}
.api-heading { margin-top: 0; color: white; font-size: 1.6rem; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; font-weight: 600;}
.api-desc { color: var(--text-muted); margin-bottom: 25px; font-size: 1.05rem;}

/* Endpoint Block */
.endpoint-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid #334155;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}
.endpoint-url { display: flex; align-items: center; gap: 15px; word-break: break-all;}
.method { font-weight: 700; padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; letter-spacing: 0.5px;}
.badge-get { background: rgba(16, 185, 129, 0.15); color: var(--get-color); border: 1px solid rgba(16, 185, 129, 0.3);}
.badge-post { background: rgba(245, 158, 11, 0.15); color: var(--post-color); border: 1px solid rgba(245, 158, 11, 0.3);}
.url-text { font-family: 'Fira Code', monospace; color: var(--accent); font-size: 1.05rem;}

/* Buttons */
.copy-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--text-muted); }
.copy-btn.copied { background: var(--get-color); color: white; border-color: var(--get-color);}

/* Tables */
.table-wrapper { overflow-x: auto; margin-bottom: 25px; border-radius: 8px; border: 1px solid var(--border-color);}
table { width: 100%; border-collapse: collapse; min-width: 600px; background: #0f172a;}
th, td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 0.95rem;}
th { color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.5px; background: rgba(255,255,255,0.02);}
td:last-child { color: var(--text-muted); }
.type-string { color: #a78bfa; font-family: 'Fira Code', monospace; background: rgba(167, 139, 250, 0.1); padding: 2px 6px; border-radius: 4px;}
.req-yes { color: #ef4444; font-size: 0.8rem; border: 1px solid rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.1); padding: 4px 8px; border-radius: 6px; font-weight: 600;}

/* Code Blocks */
.code-block-wrapper { position: relative; width: 100%; }
pre {
    background: #0f172a;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    color: #e2e8f0;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}
.code-block-wrapper .copy-btn { position: absolute; top: 12px; right: 12px; padding: 6px 12px; font-size: 0.8rem;}

/* --- Mobile Responsive --- */
@media screen and (max-width: 768px) {
    .mobile-header { display: flex; }
    .sidebar { transform: translateX(-100%); width: 300px; box-shadow: 10px 0 30px rgba(0,0,0,0.6);}
    .sidebar.active { transform: translateX(0); }
    .close-btn { display: block; }
    .main-content { margin-left: 0; width: 100%; padding: 90px 20px 40px 20px; }
    .hero-section h1 { font-size: 2.2rem; }
    .base-url-input-group { flex-direction: column; }
    .base-url-input-group button { align-self: flex-start; width: 100%;}
    .endpoint-block { flex-direction: column; align-items: flex-start; padding: 15px;}
    .copy-btn { align-self: stretch; }
    .api-card { padding: 20px; margin-bottom: 25px;}
}
