/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green-dark:   #0d2a4a;
    --green-mid:    #1565c0;
    --green-light:  #2196f3;
    --tan:          #90caf9;
    --tan-light:    #e3f2fd;
    --text:         #0d1b2a;
    --text-muted:   #4a6080;
    --surface:      #ffffff;
    --surface-alt:  #f0f4f9;
    --border:       #c5d5e8;
    --radius:       6px;
    --shadow:       0 2px 8px rgba(0,0,0,.10);
    --shadow-card:  0 4px 16px rgba(0,0,0,.12);
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--surface-alt);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--green-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Layout ───────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

main { flex: 1; padding: 2rem 0; }

/* ── Header / Nav ─────────────────────────────────────────── */
header {
    background: var(--green-dark);
    color: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: .75rem;
    padding-bottom: .75rem;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tan);
    letter-spacing: .5px;
}
.site-logo span { color: #fff; }

.fish-logo {
    width: 48px;
    height: 22px;
    perspective: 200px;
    flex-shrink: 0;
}
.fish-logo svg {
    width: 100%;
    height: 100%;
    animation: fish-spin 4s ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(33,150,243,0.5));
}
@keyframes fish-spin {
    0%   { transform: rotateY(0deg); }
    50%  { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}

nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

nav a, .btn-link {
    color: #bbdefb;
    font-size: .9rem;
    padding: .3rem .6rem;
    border-radius: var(--radius);
    transition: background .15s;
}
nav a:hover, .btn-link:hover { background: rgba(255,255,255,.12); text-decoration: none; }
nav a.active { color: #fff; font-weight: 600; }

.btn-link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: inherit;
}

.btn {
    display: inline-block;
    padding: .45rem 1.1rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity .15s, box-shadow .15s;
    text-align: center;
}
.btn:hover { opacity: .88; text-decoration: none; }

.btn-primary {
    background: var(--green-light);
    color: #fff;
    box-shadow: var(--shadow);
}
.btn-danger {
    background: #c62828;
    color: #fff;
}
.btn-outline {
    background: transparent;
    border-color: var(--green-mid);
    color: var(--green-mid);
}
.btn-outline:hover { background: var(--green-mid); color: #fff; }
.btn-sm { padding: .3rem .75rem; font-size: .82rem; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-spinner {
    display: inline-block;
    width: .85em;
    height: .85em;
    border: 2px solid rgba(255,255,255,.5);
    border-top-color: #fff;
    border-radius: 50%;
    margin-right: .45em;
    vertical-align: -.15em;
    animation: btn-spin .6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ── Flash messages ───────────────────────────────────────── */
.flash {
    padding: .8rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1.2rem;
    font-size: .92rem;
}
.flash-error   { background: #fdecea; color: #b71c1c; border-left: 4px solid #c62828; }
.flash-success { background: #e8f5e9; color: #1b5e20; border-left: 4px solid #43a047; }

/* ── Page headings ────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.75rem; color: var(--green-dark); }

/* ── Category filter bar ──────────────────────────────────── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.75rem;
}

.filter-bar a {
    padding: .35rem .85rem;
    border-radius: 999px;
    font-size: .85rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    transition: all .15s;
}
.filter-bar a:hover,
.filter-bar a.active {
    background: var(--green-mid);
    border-color: var(--green-mid);
    color: #fff;
    text-decoration: none;
}

/* ── Admin user list ──────────────────────────────────────── */
.user-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1.75rem;
}
.user-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
}
.user-row-meta {
    color: var(--text-muted);
    font-size: .85rem;
    flex: 1;
}
.user-row-delete { margin: 0; }

/* ── Fly grid ─────────────────────────────────────────────── */
.fly-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.fly-card {
    position: relative;
    flex: 1 1 260px;
    max-width: 340px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s;
}
.fly-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.15); }

.fly-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.fly-card-user {
    position: relative;
    z-index: 2;
}

.fly-card-img {
    width: 100%;
    height: 195px;
    overflow: hidden;
    background: var(--tan-light);
}
.fly-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fly-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.fly-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--green-dark);
}

.fly-card-meta {
    font-size: .8rem;
    color: var(--text-muted);
}

.tag {
    display: inline-block;
    padding: .2rem .6rem;
    background: var(--tan-light);
    border-radius: 999px;
    font-size: .75rem;
    color: var(--green-dark);
    font-weight: 600;
}

/* ── Single fly detail ────────────────────────────────────── */
.fly-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
    max-width: 640px;
    margin: 0 auto;
}

.fly-detail-img {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    background: var(--tan-light);
}
.fly-detail-img img { width: 100%; }

.fly-detail-info { display: flex; flex-direction: column; gap: 1.25rem; }
.fly-detail-info h1 { font-size: 1.75rem; color: var(--green-dark); }

.section-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: .35rem;
}

.detail-text { white-space: pre-wrap; line-height: 1.7; }

/* ── Forms ────────────────────────────────────────────────── */
.form-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 2rem;
    max-width: 520px;
    margin: 0 auto;
}
.form-card h1 { margin-bottom: 1.5rem; color: var(--green-dark); font-size: 1.5rem; }

.form-group { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem; }
.form-group label { font-size: .88rem; font-weight: 600; color: var(--text); }

.form-group input,
.form-group select,
.form-group textarea {
    padding: .55rem .75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s;
    width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--green-mid);
    box-shadow: 0 0 0 3px rgba(21,101,192,.15);
}
.form-group textarea { resize: vertical; min-height: 110px; }

.form-hint { font-size: .78rem; color: var(--text-muted); }

.form-actions { margin-top: 1.5rem; display: flex; gap: 1rem; align-items: center; }

/* Upload form wider */
.form-card.wide { max-width: 720px; }

/* ── Profile ──────────────────────────────────────────────── */
.profile-header {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--green-mid);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-info h2 { font-size: 1.4rem; color: var(--green-dark); }
.profile-info p  { color: var(--text-muted); font-size: .9rem; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: .4rem;
    margin-top: 2.5rem;
}
.pagination a, .pagination span {
    padding: .4rem .9rem;
    border-radius: var(--radius);
    font-size: .9rem;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
}
.pagination a:hover { background: var(--green-mid); border-color: var(--green-mid); color: #fff; text-decoration: none; }
.pagination .current { background: var(--green-mid); border-color: var(--green-mid); color: #fff; font-weight: 700; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}
.empty-state p { font-size: 1.05rem; margin-bottom: 1rem; }

/* ── Status badges ────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.status-pending  { background: #fff3cd; color: #856404; }
.status-rejected { background: #fde8e8; color: #b91c1c; }

/* ── Admin actions (mod queue) ────────────────────────────── */
.admin-actions {
    display: flex;
    gap: .5rem;
    padding: .65rem .75rem;
    border-top: 1px solid var(--border);
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
    background: var(--green-dark);
    color: #90b8d8;
    text-align: center;
    padding: 1.1rem;
    font-size: .85rem;
}
footer a { color: var(--tan); }

/* ── Settings sections ────────────────────────────────────── */
.settings-section {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--border);
    padding-bottom: .4rem;
    margin: 1.5rem 0 1rem;
}

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 520px) {
    .form-card { padding: 1.25rem 1rem; }
    .page-header { flex-direction: column; }
    .profile-header { flex-direction: column; text-align: center; }
}
