:root {
    --accent: #ff2222;
    --accent-light: #ff5555;
    --accent-dark: #cc0000;
    --text-color: #fff0f0;
    --text-muted: #ffd0d0;
    --bg-color: #0a0a0a;
    --bg-surface: #1a1a1a;
    --bg-card: #222;
    --success: #55cc55;
    --warning: #ffaa00;
    --error: #ff2222;
    --font: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.5;
    background-image: url("https://raw.githubusercontent.com/wallace-aph/tiles-and-such/master/Anime/221.gif");
    background-repeat: repeat;
    background-attachment: fixed;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Main Layout */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Navigation */
nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--bg-card);
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

nav a:hover, nav a.active {
    color: var(--accent);
}

/* Typography */
h1 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--accent);
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

h3 {
    font-size: 1rem;
    color: var(--text-color);
}

p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

a {
    color: var(--accent-light);
    text-decoration: none;
}

a:hover {
    color: var(--accent);
}

/* Compact Glink List */
.glink-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
}

.glink-item {
    background: var(--bg-surface);
    padding: 0.6rem 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.glink-item:hover {
    background: var(--bg-card);
}

.glink-item a {
    color: var(--text-color);
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.glink-meta {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 0.5rem;
    white-space: nowrap;
}

/* Auth Forms */
.auth-box {
    background: var(--bg-surface);
    padding: 1.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.auth-box h1 {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    background: var(--bg-card);
    border: 1px solid #333;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

button, .btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}

button:hover, .btn:hover {
    background: var(--accent-dark);
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* Social Login */
.social-login {
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--bg-card);
    border-bottom: 1px solid var(--bg-card);
}

.social-login ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.social-login a {
    display: block;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    color: var(--text-color);
}

.social-login a:hover {
    background: #333;
}

/* Messages */
.messages {
    margin-bottom: 1rem;
}

.alert {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.alert-success { background: rgba(85, 204, 85, 0.2); color: var(--success); }
.alert-error, .alert-danger { background: rgba(255, 34, 34, 0.2); color: var(--error); }
.alert-warning { background: rgba(255, 170, 0, 0.2); color: var(--warning); }

/* Link List (inside a glink) */
.link-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: var(--bg-surface);
}

.link-item a {
    color: var(--text-color);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-item form {
    margin: 0;
    padding: 0;
}

.delete-btn {
    background: transparent;
    color: var(--error);
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
}

.delete-btn:hover {
    background: var(--error);
    color: white;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dashboard-item {
    background: var(--bg-surface);
    padding: 0.75rem;
}

.dashboard-item h3 {
    margin-bottom: 0.25rem;
}

.dashboard-item p {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.dashboard-item .meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

hr {
    border: none;
    border-top: 1px solid var(--bg-card);
    margin: 1rem 0;
}

/* Landing Page */
.landing {
    text-align: center;
    padding: 3rem 1rem;
}

.landing h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.landing .tagline {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.landing .cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.landing .btn-secondary {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.landing .btn-secondary:hover {
    background: var(--accent);
    color: white;
}

/* 404 Page */
.error-page {
    text-align: center;
    padding: 4rem 1rem;
}

.error-page h1 {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.error-page p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Profile */
.profile-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.profile-header .username {
    font-size: 1.5rem;
    color: var(--accent);
}

.profile-header .member-since {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* View list page */
.list-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bg-card);
}

.list-header h1 {
    margin-bottom: 0.25rem;
}

.list-header .description {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.list-header .meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Form inline */
.form-inline {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-inline input {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg-card);
    border: 1px solid #333;
    color: var(--text-color);
    font-family: inherit;
}

.form-inline button {
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 600px) {
    .glink-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    nav {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .landing h1 {
        font-size: 1.8rem;
    }

    .landing .cta {
        flex-direction: column;
        align-items: center;
    }
}
