/* ============================================
   YYCatalog — Nautical Theme
   ============================================ */

:root {
    --bg: #0A1628;
    --bg-light: #122240;
    --bg-card: #1A2E4A;
    --accent: #C9A84C;
    --accent-hover: #D4B85C;
    --teal: #2A7F7F;
    --teal-hover: #35999A;
    --surface: #F5F0E8;
    --text: #F5F0E8;
    --text-dark: #0A1628;
    --text-muted: #8899AA;
    --border: #1E3A5F;
    --error: #E74C3C;
    --success: #27AE60;
    --radius: 8px;
}

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

body {
    font-family: 'Calibri', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

h1, h2, h3, h4 {
    font-family: 'Georgia', serif;
    color: var(--accent);
}

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

/* ---- Layout ---- */

.app-header {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.app-logo {
    font-family: 'Georgia', serif;
    font-size: 1.4rem;
    color: var(--accent);
    font-weight: bold;
    white-space: nowrap;
}

.app-logo span {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: 'Calibri', sans-serif;
    margin-left: 8px;
}

#auth-bar {
    display: flex;
    align-items: center;
}

.auth-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all 0.2s;
}
.nav-link:hover {
    color: var(--text);
    background: var(--bg);
}
.nav-link.active {
    color: var(--accent);
    background: var(--bg);
}

.auth-identity {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-link-btn {
    background: none;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.auth-link-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}
.container.compact {
    padding: 12px 24px;
}

/* ---- Buttons ---- */

.btn {
    padding: 8px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-light);
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn.primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    font-weight: 600;
}
.btn.primary:hover {
    background: var(--accent-hover);
}

.btn.teal {
    background: var(--teal);
    color: var(--text);
    border-color: var(--teal);
}
.btn.teal:hover {
    background: var(--teal-hover);
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- Cards ---- */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent);
    font-family: 'Georgia', serif;
}

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

/* Compact stats bar */
.stats-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.stats-bar strong {
    color: var(--accent);
    font-family: 'Georgia', serif;
    font-size: 1rem;
}
.stat-sep {
    color: var(--border);
}

/* ---- Filter bar ---- */

.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.filter-bar.compact {
    gap: 6px;
    margin-bottom: 8px;
    padding: 8px 12px;
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="number"] {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.filter-bar.compact select,
.filter-bar.compact input[type="text"],
.filter-bar.compact input[type="number"] {
    padding: 5px 8px;
    font-size: 0.8rem;
}
.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: var(--accent);
}

.filter-bar label {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.filter-check {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.radio-group {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.radio-btn {
    background: var(--bg);
    color: var(--text-muted);
    border: none;
    border-right: 1px solid var(--border);
    padding: 5px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.radio-btn:last-child { border-right: none; }
.radio-btn:hover { color: var(--text); }
.radio-btn.active {
    background: var(--accent);
    color: var(--bg);
    font-weight: 600;
}

/* ---- Image Grid ---- */

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.image-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}
.image-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.image-card .thumb {
    width: 100%;
    aspect-ratio: 3/4;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.image-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-card .thumb .placeholder {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.image-card .card-info {
    padding: 10px;
}
.image-card .card-title {
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.image-card .card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge.cover { background: var(--accent); color: var(--bg); }
.badge.design { background: var(--teal); color: var(--text); }
.badge.raw { background: var(--border); color: var(--text-muted); }
.badge.curated { background: var(--success); color: white; }
.badge.flagged { background: var(--error); color: white; }

/* ---- Pagination ---- */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding: 16px 0;
}

.pagination .page-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---- Forms ---- */

.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* ---- Modal ---- */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-close:hover {
    color: var(--text);
}

.modal-content h2 {
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: var(--radius);
    font-size: 1rem;
    margin-bottom: 12px;
}
.modal-content input:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-message {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.auth-message.error {
    background: rgba(231, 76, 60, 0.15);
    color: var(--error);
}
.auth-message.success {
    background: rgba(39, 174, 96, 0.15);
    color: var(--success);
}

/* ---- Table ---- */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    color: var(--accent);
    font-size: 0.85rem;
    font-family: 'Georgia', serif;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.data-table tr:hover td {
    background: var(--bg-light);
}

/* ---- Sync/Progress ---- */

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
}

.log-entry {
    padding: 8px 12px;
    border-left: 3px solid var(--border);
    margin: 8px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.log-entry.success { border-color: var(--success); }
.log-entry.error { border-color: var(--error); }

/* ---- Utilities ---- */

.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 8px;
    }
    .auth-user {
        flex-direction: column;
        gap: 8px;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    .filter-bar {
        flex-direction: column;
    }
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- Login Page ---- */

.login-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    text-align: center;
    padding: 40px 24px;
}

.login-hero h1 {
    font-size: 3rem;
    margin-bottom: 8px;
}

.login-hero .tagline {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 32px;
}

.login-hero .btn {
    font-size: 1.1rem;
    padding: 12px 32px;
}

.build-number {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 40px;
    opacity: 0.5;
}
