/* ==========================================
   Film Collection System — Full Stylesheet
   ========================================== */

:root {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --card: #242424;
    --border: #333;
    --text: #e0e0e0;
    --muted: #999;
    --heading: #fff;
    --accent: #4da6ff;
    --success: #4cd964;
    --error: #ff4d4d;
    --warning: #ffcc00;
    --forsale: #ff9500;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    padding: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

header h1 {
    color: var(--heading);
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

nav a {
    background: var(--card);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s;
}

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

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card h2, .card h3, .card h4 {
    color: var(--heading);
    margin-bottom: 1rem;
}

label {
    display: block;
    margin: 0.75rem 0 0.25rem;
    font-size: 0.9rem;
    color: var(--muted);
}

input, select, textarea, button {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
}

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

button {
    background: var(--accent);
    color: white;
    border: none;
    margin-top: 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

button:hover {
    background: #3399ff;
}

.btn-small {
    display: inline-block;
    background: var(--surface);
    color: var(--accent);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    margin: 0.25rem 0.25rem 0.25rem 0;
    transition: all 0.2s;
}

.btn-small:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-danger, .btn-small.btn-danger {
    background: rgba(255, 77, 77, 0.1);
    color: var(--error);
    border-color: var(--error);
}

.btn-danger:hover, .btn-small.btn-danger:hover {
    background: var(--error);
    color: white;
}

.success { border-left: 4px solid var(--success); }
.err     { border-left: 4px solid var(--error); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.rank-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: 0.75rem;
}

.rank-new       { background: #333; color: #ccc; }
.rank-building  { background: #4d3800; color: #ffd700; }
.rank-growing   { background: #004d26; color: #4cd964; }
.rank-avid      { background: #003d66; color: #4da6ff; }
.rank-ultimate  { background: #4d0000; color: #ff6666; }

.label {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 0.25rem 0.5rem 0.25rem 0;
}

.label-forsale {
    background: rgba(255, 149, 0, 0.15);
    color: var(--forsale);
    border: 1px solid var(--forsale);
}

.priority-high   { color: var(--error); font-weight: 500; }
.priority-medium { color: var(--warning); font-weight: 500; }
.priority-low    { color: var(--success); font-weight: 500; }

.wishlist-match {
    background: rgba(255, 149, 0, 0.05);
    border: 1px solid var(--forsale);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

/* ==========================================
   Marketplace Layout — Image Left, Content Right
   ========================================== */

.grid-half {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.marketplace-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
}

.marketplace-img-wrap {
    flex: 0 0 auto;
    width: 130px;
}

.marketplace-img {
    height: 190px !important;
    max-height: 190px !important;
    width: auto !important;
    max-width: 130px !important;
    object-fit: contain !important;
    object-position: center;
    border-radius: 4px;
    display: block;
}

.marketplace-content {
    flex: 1;
    min-width: 0;
}

.marketplace-actions {
    margin-top: 0.75rem;
}

@media (max-width: 600px) {
    .marketplace-card {
        flex-direction: column;
    }
    .marketplace-img-wrap {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .marketplace-img {
        max-width: 100%;
    }
}

.username {
    color: var(--accent);
    font-weight: 500;
}

/* ==========================================
   Admin Page Specific
   ========================================== */
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

table th, table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table th {
    background: var(--surface);
    color: var(--heading);
}

table tr:hover {
    background: var(--surface);
}

.backup-list {
    margin-top: 1rem;
}

.backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}
