/**
 * Tec-Ni-Chat – Modern responsive styles
 * Mobile-first, CSS custom properties, no frameworks
 */

:root {
    --color-bg: #0a0a0a;
    --color-surface: rgba(0, 0, 0, 0.85);
    --color-surface-border: #333;
    --color-primary: #fff;
    --color-secondary: #20c997;
    --color-accent: #007bff;
    --color-highlight: #ffeb3b;
    --color-body: #fff;
    --color-muted: #aaa;
    --font-heading: 'Outfit', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --max-content: 1000px;
    --header-height: 48px;
    --radius: 8px;
    --radius-lg: 12px;
    --space: 1rem;
    --space-lg: 1.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-body);
    background: var(--color-bg) url('/images/backgrounds/background01.png') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    overflow-x: hidden;
}

.page-wrap {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}
.main-content {
    padding: var(--space-lg) var(--space-lg) 4rem;
    max-width: var(--max-content);
    margin: 0 auto;
}
@media (max-width: 640px) {
    .main-content {
        margin: 0;
        padding: var(--space) 0 4rem;
        max-width: 100%;
    }
}

/* ========== Mobile nav overlay & drawer ========== */
.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(280px, 85vw);
    z-index: 999;
    background: rgba(10, 10, 10, 0.98);
    border-left: 1px solid var(--color-surface-border);
    padding: calc(var(--header-height) + 1rem) var(--space) var(--space);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}
.nav-drawer.is-open {
    transform: translateX(0);
}

.nav-list-mobile {
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-list-mobile li { margin: 0; }
.nav-list-mobile a {
    display: block;
    padding: 0.6rem 0.75rem;
    color: var(--color-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
}
.nav-list-mobile a:hover {
    color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
}
.nav-account { color: var(--color-highlight) !important; }
.nav-admin { color: #e57373 !important; }
.nav-highlight { color: var(--color-highlight) !important; }
.nav-flash {
    animation: pulse 2s ease-in-out infinite;
    background: rgba(200, 50, 50, 0.3);
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* Hide drawer on desktop */
@media (min-width: 992px) {
    .nav-overlay, .nav-drawer { display: none !important; }
}

/* ========== Header & desktop nav ========== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid var(--color-surface-border);
    backdrop-filter: blur(8px);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    margin: 0 auto;
    padding: 0.5rem var(--space);
    gap: var(--space);
}
@media (max-width: 640px) {
    .header-inner {
        padding: 0.5rem 0.75rem;
    }
}
@media (min-width: 992px) {
    .header-inner {
        max-width: var(--max-content);
        justify-content: flex-start;
        gap: 1.5rem;
    }
}
.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--color-secondary);
    text-decoration: none;
    white-space: nowrap;
}
.logo:hover { color: var(--color-primary); }

/* Hamburger - mobile only */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
}
.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
@media (min-width: 992px) {
    .nav-toggle { display: none; }
}

/* Desktop nav - dropdowns, single row */
.main-nav {
    display: none;
}
@media (min-width: 992px) {
    .main-nav {
        display: block;
        flex: 1;
    }
}

.nav-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-row > li { position: relative; }
.nav-row > li > a,
.nav-dropdown-trigger {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    font-size: 0.875rem;
    color: var(--color-secondary);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
}
.nav-row > li > a:hover,
.nav-dropdown-trigger:hover {
    color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
}
.nav-dropdown-trigger {
    padding-right: 1.25rem;
}
.nav-dropdown-trigger::after {
    content: '';
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-top-color: currentColor;
    margin-top: 2px;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    margin: 0.15rem 0 0;
    padding: 0.35rem 0;
    list-style: none;
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
    z-index: 50;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-menu a {
    display: block;
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    color: var(--color-secondary);
    text-decoration: none;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover {
    color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Content container */
.content-container, .content-box, .div_main, .fb_box {
    max-width: var(--max-content);
    margin: 0 auto;
    padding: var(--space-lg);
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-lg);
}
@media (max-width: 640px) {
    .content-container, .content-box, .div_main, .fb_box {
        margin: 0;
        padding: var(--space);
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    margin: 1.25em 0 0.5em;
    line-height: 1.3;
}
h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); text-align: center; }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); color: var(--color-secondary); text-align: center; }
h3 { font-size: 1.15rem; color: var(--color-accent); }
h4 { font-size: 1rem; margin-left: 0.5rem; }
p, li {
    margin: 0.5em 0;
    color: var(--color-body);
}
ul { margin: 0.5em 0; padding-left: 1.5em; }
a {
    color: var(--color-highlight);
    text-decoration: none;
}
a:hover { color: var(--color-primary); }
.highlight { color: var(--color-secondary); }
hr {
    border: none;
    border-top: 2px solid var(--color-surface-border);
    margin: 1.5rem auto;
    max-width: var(--max-content);
}

/* Forms */
label { display: block; margin-top: 0.75rem; }
.form-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius);
}
.form-section:first-child { margin-top: 0; }
.officer-card {
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius);
    padding: var(--space);
    margin-bottom: var(--space);
    background: rgba(0, 0, 0, 0.85);
}
.form-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-surface-border);
}
.form-group {
    margin-bottom: 1.25rem;
}
.form-group:last-child { margin-bottom: 0; }
.form-group label,
.form-group .form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
}
.form-note {
    font-size: 0.875rem;
    color: var(--color-muted);
    margin-top: 0.5rem;
}
.form-note input, .form-note select {
    max-width: 10rem;
    padding: 0.35rem 0.5rem;
}
.form-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-surface-border);
    text-align: center;
}
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}
.form-row .form-group { flex: 1; min-width: 200px; }

/* Admin edit form - labels left, inputs right, notes under field */
.edit-form .form-section { margin-bottom: 2rem; }
.edit-form .form-section h3 { margin-bottom: 1rem; }
.edit-form .form-group {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0.5rem 1rem;
    align-items: start;
    margin-bottom: 1rem;
}
.edit-form .form-group label,
.edit-form .form-group .form-label {
    margin: 0;
    padding-top: 0.4rem;
    grid-column: 1;
    font-weight: 500;
}
.edit-form .form-group input,
.edit-form .form-group select,
.edit-form .form-group textarea { grid-column: 2; }
.edit-form .form-note {
    grid-column: 2;
    margin-top: 0.25rem;
    margin-bottom: 0;
    font-size: 0.875rem;
    color: var(--color-muted);
}
.edit-form .form-group-checkbox {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.edit-form .form-group-checkbox label { margin: 0; }
/* Full-width map page (repeaters) */
body.page-map .main-content { padding: 0; margin: 0; max-width: none; }
body.page-map .page-hero { margin: 0; padding: 0.25rem var(--space); min-height: 0; background: none; border: none; }
body.page-map .page-hero h1 { margin: 0; font-size: 1rem; }
body.page-map #map {
    width: 100%;
    height: calc(100vh - var(--header-height) - 2.5rem);
    min-height: 400px;
}
body.page-map .page-wrap { overflow: visible; }

@media (max-width: 600px) {
    .edit-form .form-group { grid-template-columns: 1fr; }
    .edit-form .form-group label,
    .edit-form .form-group .form-label { grid-column: 1; }
    .edit-form .form-group input,
    .edit-form .form-group select,
    .edit-form .form-group textarea,
    .edit-form .form-note { grid-column: 1; }
}
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="date"], input[type="url"], select, textarea {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem 0.75rem;
    font: inherit;
    background: #e8e8e8;
    border: 1px solid #999;
    border-radius: var(--radius);
    color: #111;
}
button, .btn, input[type="submit"] {
    padding: 0.5rem 1.25rem;
    font: inherit;
    background: var(--color-secondary);
    color: #000;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    margin-top: 0.75rem;
}
button:hover, .btn:hover, input[type="submit"]:hover {
    background: var(--color-primary);
    color: #000;
}

/* Footer */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem var(--space);
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid var(--color-surface-border);
    font-size: 0.8rem;
    color: var(--color-muted);
    text-align: center;
}
@media (max-width: 640px) {
    .site-footer {
        padding: 0.5rem 0.75rem;
    }
}

/* Utilities */
.text-center { text-align: center; }
.error-msg { color: #e57373; text-align: center; }
.flash { animation: pulse 2s ease-in-out infinite; }
.flash2 { animation: pulse 1s ease-in-out infinite; }

/* Float layout (officers) */
.container { overflow: auto; margin-bottom: 1rem; }
.float-left, .float-right { margin: 0 1rem 0.5rem 0; }
.float-left { float: left; }
.float-right { float: right; margin: 0 0 0.5rem 1rem; }
.float-left img, .float-right img {
    height: 100px;
    border-radius: var(--radius-lg);
    display: block;
}

/* Page title in hero */
.page-hero {
    text-align: center;
    padding: 1.5rem var(--space);
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}
.page-hero h1 { margin: 0; }

/* Prevent horizontal overflow */
img, video, iframe, table, pre, code {
    max-width: 100%;
}
