/* ===========================
   Memphis Dark Theme - theme.css
   Complete + Table Components
   =========================== */

/* ---- Global ---- */
:root {
    --bg-main: #111;
    --bg-surface: #181818;
    --bg-elevated: #222;

    --border-subtle: #333;
    --border-strong: #444;

    --text-main: #eee;
    --text-muted: #bbb;
    --text-heading: #fff;
    --link: #4ea3ff;

    --radius-sm: 0.3rem;
    --radius-md: 0.4rem;
    --radius-lg: 0.5rem;

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;

    --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-size-sm: 0.8rem;
    --font-size-md: 0.9rem;
    --font-size-base: 1rem;
}

/* ---- Base ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-main);
    color: var(--text-main);
    padding: var(--space-xl);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    margin-top: 0;
}

a {
    color: var(--link);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

p {
    margin: 0 0 var(--space-md) 0;
}

/* ---- Layout ---- */
.page {
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    margin-bottom: var(--space-xl);
}

/* ---- Cards ---- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.card-title {
    font-weight: 600;
}

.card-meta {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.card-body {
    padding: var(--space-lg);
}

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-right: var(--space-sm);
    background: var(--bg-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-strong);
}

.loc-badge {
    display: inline-block;
    padding: 0.05rem 0.35rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.25rem;
    color: #000;
}

/* ===========================
   TABLES (Base, Striped, Sortable)
   =========================== */

/* ---- Base Table ---- */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-lg);
    font-size: var(--font-size-md);
}

.table th,
.table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.table th {
    text-align: left;
    font-weight: 600;
    color: var(--text-heading);
    background: var(--bg-elevated);
}

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

/* ---- Striped Table ---- */
.table-striped tbody tr:nth-child(odd) {
    background: var(--bg-elevated);
}

/* ---- Sortable Table ---- */
.table-sortable th {
    cursor: pointer;
    user-select: none;
}

.table-sortable th:hover {
    background: #333;
}

.table-sortable th.sorted-asc::after {
    content: " ▲";
    color: var(--text-muted);
}

.table-sortable th.sorted-desc::after {
    content: " ▼";
    color: var(--text-muted);
}

/* ---- Inputs ---- */
input, select, textarea {
    background: var(--bg-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 0.4rem 0.6rem;
    font-family: var(--font-ui);
}

/* ---- Code ---- */
pre {
    background: #000;
    padding: 0.6rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-size: var(--font-size-sm);
}

/* ---- Meta ---- */
.meta {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ---- Utility Colors for Password Checker ---- */
.green {
    color: #5bd75b;
    font-weight: bold;
}

.red {
    color: #ff6b6b;
    font-weight: bold;
}

/* ---- Textarea Utilities ---- */
.textarea-md {
    height: 180px;
    min-height: 180px;
}

/* ---- Global Textarea Default ---- */
textarea {
    min-height: 180px;
}

/* ---- Textarea Utility (ASN Tool) ---- */
.textarea-sm {
    min-height: 80px;
}

/* ----------------------------------------------------
   Textarea Layout Fix
   Prevents margin collapse and restores visual spacing
   ---------------------------------------------------- */
.card-body textarea,
.section textarea {
    margin-bottom: 18px !important;
    padding: 10px 12px;
    min-height: 180px;
    display: block;
}

/* ----------------------------------------------------
   IP Tool Textarea Width Fix
   ---------------------------------------------------- */
#ipForm {
    width: 100%;
}

#ipForm textarea {
    width: 70%;
    box-sizing: border-box;
}

/* ----------------------------------------------------
   Global Tool Textarea Width (excludes ASN)
   ---------------------------------------------------- */
.tool-form {
    width: 100%;
}

.tool-form textarea {
    width: 70%;
    box-sizing: border-box;
}

/* -------------------------------------------------
   Badge Spacing (Menu Items)
   Adds vertical rhythm between stacked badges
   used on the main index menu and tool lists.
--------------------------------------------------*/
.card-body .badge {
    display: inline-block;
    margin-bottom: 6px; /* 8–10px for more breathing room */
}
