/* ============================================
   Viral Marketing Machine v2 - Global Styles
   ============================================ */

:root {
    /* Defaults – overridden by header.php via CSS variables from settings */
    --vmm-body-bg: #020617;
    --vmm-header-bg: linear-gradient(90deg,#020617,#0f172a);
    --vmm-panel-bg: rgba(15,23,42,0.9);
    --vmm-accent: #38bdf8;
    --vmm-text: #e5e7eb;

    --vmm-border-soft: rgba(148,163,184,0.4);
    --vmm-border-strong: rgba(30,41,59,0.9);
    --vmm-muted: rgba(148,163,184,0.9);
}

/* Base */
body.vmm-body {
    margin: 0;
    min-height: 100vh;
    background: var(--vmm-body-bg);
    color: var(--vmm-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--vmm-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Shell layout */
.vmm-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.vmm-header {
    background: var(--vmm-header-bg);
    border-bottom: 1px solid var(--vmm-border-soft);
    box-shadow: 0 4px 20px rgba(15,23,42,0.8);
}

.vmm-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.vmm-brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.vmm-brand-link {
    text-decoration: none;
    color: var(--vmm-text);
}

.vmm-brand-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.vmm-brand-sub {
    font-size: 0.7rem;
    color: var(--vmm-muted);
}

.vmm-user-chip {
    font-size: 0.75rem;
    color: var(--vmm-muted);
}

/* Nav */
.vmm-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.85rem;
}

.vmm-nav-link {
    color: rgba(226,232,240,0.9);
    text-decoration: none;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.vmm-nav-link:hover {
    background: rgba(15,23,42,0.9);
    border-color: var(--vmm-border-soft);
}

.vmm-nav-active {
    background: rgba(8,47,73,0.9);
    border-color: rgba(56,189,248,0.8);
    color: #e0f2fe !important;
}

.vmm-nav-pill-primary {
    background: #0f172a;
    border-color: rgba(56,189,248,0.7);
}

.vmm-nav-pill-primary:hover {
    background: #020617;
}

/* Main content */
.vmm-main {
    flex: 1 1 auto;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 1rem 2rem;
}

/* Footer */
.vmm-footer {
    border-top: 1px solid var(--vmm-border-strong);
    background: #020617;
    padding: 0.75rem 1rem;
    margin-top: auto;
}

.vmm-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    font-size: 0.75rem;
    color: var(--vmm-muted);
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Panels / cards */
.vmm-panel {
    background: var(--vmm-panel-bg);
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--vmm-border-soft);
    margin-bottom: 1rem;
}

.vmm-panel-tight {
    background: var(--vmm-panel-bg);
    border-radius: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--vmm-border-soft);
    margin-bottom: 0.75rem;
}

/* New: card block used heavily in admin */
.vmm-card {
    background: var(--vmm-panel-bg);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--vmm-border-soft);
    margin-bottom: 1rem;
    box-shadow: 0 10px 35px rgba(15,23,42,0.5);
}

/* Generic forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid var(--vmm-border-soft);
    background: #020617;
    color: var(--vmm-text);
    font-size: 0.9rem;
    box-sizing: border-box;
}

textarea {
    resize: vertical;
}

label {
    display: block;
    font-size: 0.85rem;
    margin-top: 0.6rem;
    margin-bottom: 0.15rem;
}

/* New: form grouping + class-based inputs/labels */
.vmm-form-group {
    margin-top: 0.75rem;
}

.vmm-label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.vmm-input {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid var(--vmm-border-soft);
    background: #020617;
    color: var(--vmm-text);
    font-size: 0.9rem;
    box-sizing: border-box;
}

/* Buttons */
button,
.vmm-btn {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--vmm-accent);
    background: var(--vmm-accent);
    color: #020617;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

button:hover,
.vmm-btn:hover {
    background: #020617;
    color: var(--vmm-text);
}

/* New: secondary / small / danger buttons used in admin */
.vmm-btn-secondary {
    border-color: var(--vmm-border-soft);
    background: transparent;
    color: var(--vmm-text);
}

.vmm-btn-secondary:hover {
    background: rgba(15,23,42,0.9);
    border-color: var(--vmm-border-soft);
    color: var(--vmm-text);
}

.vmm-btn-small {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

.vmm-btn-danger {
    border-color: #ef4444;
    background: #b91c1c;
    color: #fee2e2;
}

.vmm-btn-danger:hover {
    background: #7f1d1d;
    color: #fee2e2;
}

/* Errors / messages */
.vmm-errors {
    background: rgba(127,29,29,0.8);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(248,113,113,0.7);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.vmm-errors ul {
    margin: 0;
    padding-left: 1rem;
}

.vmm-flash {
    background: rgba(22,101,52,0.8);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(74,222,128,0.7);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

/* New: neutral notice + help text */
.vmm-notice {
    background: rgba(30,64,175,0.85);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(129,140,248,0.9);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.vmm-help {
    font-size: 0.8rem;
    color: var(--vmm-muted);
}

/* Admin dashboard */
.vmm-admin-dashboard {
    max-width: 960px;
    margin: 0 auto;
}

.vmm-admin-dashboard h1 {
    margin-top: 0;
}

/* Tables */
table {
    border-collapse: collapse;
}

th,
td {
    padding: 0.3rem;
}

/* New: table styling for .vmm-table specifically */
.vmm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.vmm-table thead {
    background: rgba(15,23,42,0.95);
}

.vmm-table th,
.vmm-table td {
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid var(--vmm-border-soft);
    text-align: left;
    vertical-align: top;
}

.vmm-table th {
    font-weight: 600;
    color: rgba(226,232,240,0.9);
    white-space: nowrap;
}

.vmm-table tr:nth-child(even) td {
    background: rgba(15,23,42,0.6);
}

/* New: simple list */
.vmm-list {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.vmm-list li {
    margin: 0.15rem 0;
}

/* Home layout helper (for index.php) */
.vmm-home-columns {
    display: grid;
    grid-template-columns: minmax(0, 3fr);
    gap: 1rem;
}

@media (min-width: 900px) {
    .vmm-home-columns {
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    }
}

/* Small responsive tweaks */
@media (max-width: 720px) {
    .vmm-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .vmm-nav {
        justify-content: flex-start;
    }
    .vmm-main {
        padding: 1rem 0.75rem 1.5rem;
    }
}
