/* ============================================================
   msalinas.info — Dark Theme Shared Stylesheet
   Link this file on any page: 
   <link rel="stylesheet" href="/dark-theme.css">
   ============================================================ */

:root {
    --bg: #0d1117;
    --panel: #161b22;
    --border: #30363d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #58a6ff;
    --code-bg: #0a0e14;
    --success: #3fb950;
    --heading: #f0f6fc;
    --btn-bg: #21262d;
    --btn-hover: #30363d;
    --highlight: #ffd479;
    --code-highlight: #a5d6ff;
    --radius: 8px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.6;
    padding: 40px 20px;
    min-height: 100vh;
}

.container {
    max-width: 960px;
    margin: 0 auto;
}

/* ---------- Typography ---------- */
h1 {
    color: var(--heading);
    font-size: 2rem;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

h2 {
    color: var(--heading);
    font-size: 1.5rem;
    margin-bottom: 12px;
}

h3, h4, h5, h6 {
    color: var(--heading);
    margin-bottom: 8px;
}

p {
    margin-bottom: 12px;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.subtitle {
    color: var(--muted);
    margin-bottom: 40px;
    font-size: 0.95rem;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* ---------- Sections ---------- */
.section {
    margin-bottom: 48px;
}

.section-title {
    color: var(--accent);
    font-size: 1.3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ---------- Code Cards (with Copy Button) ---------- */
.code-card {
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.code-card:hover {
    border-color: #484f58;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background-color: #0d1117;
    border-bottom: 1px solid var(--border);
}

.code-label {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.8rem;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--btn-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    font-family: var(--sans);
}

.copy-btn:hover {
    background-color: var(--btn-hover);
    border-color: #8b949e;
}

.copy-btn.copied {
    background-color: rgba(63, 185, 80, 0.15);
    border-color: var(--success);
    color: var(--success);
}

.copy-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--code-highlight);
    white-space: pre-wrap;
    word-break: break-word;
}

pre b, pre .hl {
    color: var(--highlight);
}

code {
    font-family: var(--mono);
}

.inline-code {
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.9em;
}

/* ---------- Tables ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

th {
    background-color: #0d1117;
    color: var(--heading);
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

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

tr:hover td {
    background-color: #1c2128;
}

/* ---------- Callouts / Notes ---------- */
.callout {
    background-color: var(--panel);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.callout.warning {
    border-left-color: #e3b341;
}

.callout.danger {
    border-left-color: #f85149;
}

.callout.success {
    border-left-color: var(--success);
}

/* ---------- Generic Buttons ---------- */
.btn {
    display: inline-block;
    background-color: var(--btn-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: var(--btn-hover);
    border-color: #8b949e;
    text-decoration: none;
}

.btn.primary {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #0d1117;
    font-weight: 600;
}

.btn.primary:hover {
    background-color: #79b8ff;
}

/* ---------- Navigation ---------- */
nav {
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: 32px;
}

nav a {
    color: var(--text);
    margin-right: 20px;
    font-size: 0.95rem;
}

nav a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* ---------- Footer ---------- */
.footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

/* ---------- Utility ---------- */
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }

/* ---------- Scrollbar styling ---------- */
pre::-webkit-scrollbar {
    height: 8px;
}
pre::-webkit-scrollbar-track {
    background: var(--bg);
}
pre::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    body {
        padding: 24px 12px;
    }
    h1 { font-size: 1.6rem; }
    .section-title { font-size: 1.1rem; }
    pre { font-size: 0.8rem; padding: 12px; }
    .code-header { flex-direction: column; gap: 8px; align-items: flex-start; }
}

/* ---------- Spacing Utilities ---------- */
.spacer { height: 24px; }
.spacer-sm { height: 12px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ---------- Directory Listing ---------- */
.listing {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--panel);
}

.listing li + li {
    border-top: 1px solid var(--border);
}

.listing a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.listing a:hover {
    background-color: #1c2128;
}

.listing .icon {
    width: 1.3rem;
    text-align: center;
    opacity: 0.85;
    flex-shrink: 0;
}

.listing .name {
    font-family: var(--mono);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.listing .name.dir {
    color: var(--accent);
    font-weight: 600;
}

.listing .meta {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.78rem;
    font-family: var(--mono);
    flex-shrink: 0;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 16px;
}

.breadcrumbs a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .sep {
    margin: 0 6px;
    color: var(--border);
}

/* ---------- Profile / Center Card (index page) ---------- */
.center { text-align: center; }
.profile {
    max-width: 520px;
    margin: 0 auto 32px;
    text-align: center;
}
.profile .avatar {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    margin-bottom: 16px;
    display: inline-block;
}
.profile .avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.profile h1 {
    margin-bottom: 4px;
}
.profile .visitor {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 16px;
    margin-top: 16px;
    font-family: var(--mono);
    font-size: 0.85rem;
}
.profile .visitor .ip {
    color: var(--accent);
    font-weight: 600;
}

/* ---------- Full-page vertical centering (landing/profile pages) ---------- */
.centered-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
