/* =========================
   ROOT / THEME
   ========================= */
:root {
    --bg: #0f1115;
    --bg-card: #161a22;
    --bg-hover: #1f2430;

    --text: #e6e6eb;
    --text-muted: #9aa0b3;

    --primary: #4f7cff;
    --danger: #ff5c5c;
    --border: #252b3a;

    --radius: 10px;
}

/* =========================
   RESET
   ========================= */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

/* =========================
   LAYOUT
   ========================= */
header, footer {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer {
    padding: 14px;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

main {
    padding: 24px;
    max-width: 1200px;
    margin: auto;
}

/* =========================
   TYPO
   ========================= */
h1, h2, h3, h4 {
    margin-top: 0;
}

h2 {
    margin-bottom: 16px;
}

small {
    color: var(--text-muted);
}

/* =========================
   LINKS & BUTTONS
   ========================= */
a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius);
    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}

button.danger {
    background: var(--danger);
}

button.delete {
    width: auto;
    background: var(--danger);
    color: #fff;
}

/* =========================
   FORMS
   ========================= */
input, select {
    width: 100%;
    background: var(--bg-hover);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: var(--radius);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

form {
    margin-bottom: 24px;
}

.inline-form {
    margin: 8px 0 0;
}

/* =========================
   GALLERY
   ========================= */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-card);
    padding: 12px;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.card:hover {
    background: var(--bg-hover);
}

.card img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    cursor: pointer;
}

.card input {
    margin-top: 8px;
    font-size: 12px;
}

.delete {
    color: var(--danger);
    font-size: 13px;
}

/* =========================
   LIGHTBOX
   ========================= */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

#overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius);
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    main {
        padding: 16px;
    }
}
