:root {
    --bg: #050617;
    --panel: #111326;
    --panel-soft: #181a32;
    --accent: #7b5cff;
    --text: #f9fafb;
    --muted: #9ca3af;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    background: var(--bg); /* static color */
    color: var(--text);
}

.app {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.logo-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text h1 {
    margin: 0;
    font-size: 20px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-form {
    margin: 0;
}

.logout-btn {
    padding: 6px 10px;
    border-radius: 18px;
    border: none;
    cursor: pointer;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
}

/* Nav buttons */
.nav-buttons {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
}

.nav-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
}

.nav-btn.active {
    background: var(--accent);
    color: #fff;
}

/* Main */
main {
    background: var(--panel);
    padding: 20px;
    border-radius: 18px;
}

/* Alerts */
.alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Toolbar / Search */
.toolbar {
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: var(--panel-soft);
    color: var(--text);
    font-size: 14px;
}

.search-input::placeholder {
    color: var(--muted);
}

/* Project grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

/* Card with delete button */
.card {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--panel-soft);
    padding: 12px;
    border-radius: 14px;
    transition: 0.2s;
}

.card:hover {
    transform: translateY(-2px);
}

/* Inner clickable area */
.card-click {
    cursor: pointer;
}

.card img {
    width: 100%;
    border-radius: 10px;
    display: block;
}

.card h3 {
    margin: 10px 0 4px;
    font-size: 16px;
}

.desc {
    color: var(--muted);
    font-size: 14px;
}

/* Delete button on cards (admin only) */
.card-delete-form {
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
}

.card-delete-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.85);
    color: #fca5a5;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-delete-btn:hover {
    background: rgba(127, 29, 29, 0.95);
    color: #fee2e2;
}

/* Preferences / Forms */
#admin h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

input,
textarea,
button {
    padding: 10px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
}

input,
textarea {
    background: var(--panel-soft);
    color: var(--text);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

button {
    background: var(--accent);
    color: white;
    cursor: pointer;
    margin-top: 6px;
}

button:hover {
    opacity: 0.92;
}

/* login form smaller width */
.login-form {
    max-width: 320px;
}
