/* ============================================
   ADPR SELECT — Global Styles
   ============================================ */
:root {
    --bg: #0a0a0a;
    --bg-card: #141414;
    --bg-elevated: #1a1a1a;
    --bg-hover: #222;
    --border: #2a2a2a;
    --border-light: #333;
    --text: #f0f0f0;
    --text-muted: #888;
    --text-dim: #555;
    --accent: #fff;
    --accent-blue: #4a9eff;
    --accent-red: #ff4757;
    --accent-green: #2ed573;
    --accent-yellow: #ffa502;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 20px rgba(0,0,0,0.3);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* ============================================
   LOGIN
   ============================================ */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    text-align: center;
    padding: 48px;
    max-width: 400px;
    width: 100%;
}

.login-logo {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--accent);
    margin-bottom: 8px;
}

.login-brand-logo {
    height: 24px;
    opacity: 0.5;
    margin-bottom: 20px;
}

.login-sub {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-form input {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.login-form input:focus {
    border-color: var(--text-muted);
}

.error-msg {
    background: rgba(255,71,87,0.1);
    border: 1px solid rgba(255,71,87,0.3);
    color: var(--accent-red);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    transition: all 0.15s;
    text-decoration: none;
}

.btn:hover { background: var(--bg-hover); text-decoration: none; }

.btn-primary {
    background: #fff;
    color: #000;
    border-color: #fff;
}
.btn-primary:hover { background: #e0e0e0; }

.btn-danger { border-color: var(--accent-red); color: var(--accent-red); }
.btn-danger:hover { background: rgba(255,71,87,0.1); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; min-width: 36px; }

.filter-btn {
    border-color: var(--border);
    color: var(--text-muted);
    transition: all 0.15s;
}
.filter-btn.active {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: rgba(255,71,87,0.1);
}

/* ============================================
   ADMIN LAYOUT
   ============================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    flex-shrink: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 4px;
    padding: 0 24px;
    margin-bottom: 32px;
    color: var(--accent);
}

.sidebar-brand {
    padding: 0 24px;
    margin-bottom: 12px;
}

.sidebar-brand-logo {
    height: 20px;
    opacity: 0.5;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    color: var(--text-muted);
    font-size: 14px;
    transition: all 0.15s;
    text-decoration: none;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    color: var(--text);
    background: var(--bg-hover);
}

.admin-main {
    flex: 1;
    margin-left: 240px;
    padding: 32px;
    max-width: 1200px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 600;
}

/* ============================================
   CARDS & TABLES
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-header h3 { font-size: 16px; font-weight: 600; }

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

th, td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

tr:hover td { background: rgba(255,255,255,0.02); }

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--font);
}

.form-control:focus { border-color: var(--text-muted); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ============================================
   CAMPAIGN GRID (Admin)
   ============================================ */
.campaign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.campaign-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s;
    text-decoration: none;
    color: var(--text);
    display: block;
}

.campaign-card:hover {
    border-color: var(--text-dim);
    text-decoration: none;
}

.campaign-card-cover {
    width: 100%;
    height: 200px;
    background: var(--bg-elevated);
    object-fit: cover;
}

.campaign-card-body {
    padding: 20px;
}

.campaign-card-artist {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.campaign-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.campaign-card-date {
    font-size: 13px;
    color: var(--text-dim);
}

/* ============================================
   BOARD LAYOUT
   ============================================ */
.board-layout {
    min-height: 100vh;
}

.board-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10,10,10,0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
}

.board-header-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.board-title {
    font-size: 14px;
    font-weight: 600;
}

.board-artist {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.board-tabs {
    display: flex;
    gap: 4px;
}

.board-tab {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    background: none;
    font-family: var(--font);
}

.board-tab:hover { color: var(--text); }
.board-tab.active {
    color: var(--text);
    background: var(--bg-elevated);
    border-color: var(--border);
}

.board-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Member tabs */
.member-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    max-width: 100%;
}

.member-tab {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    border: 1px solid transparent;
    background: none;
    white-space: nowrap;
    transition: all 0.15s;
    font-family: var(--font);
}

.member-tab:hover { color: var(--text); }
.member-tab.active {
    color: var(--text);
    background: var(--bg-elevated);
    border-color: var(--border);
}

/* ============================================
   IMAGE GRID
   ============================================ */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

.image-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.image-card:hover { border-color: var(--text-dim); }

.image-card.selected { border-color: var(--accent-red); }

.image-card img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 32px 12px 12px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.image-filename {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.image-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.select-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    backdrop-filter: blur(4px);
}

.select-btn:hover { background: rgba(255,255,255,0.25); }
.select-btn.active {
    background: var(--accent-red);
    color: #fff;
}

.select-count {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    min-width: 16px;
    text-align: center;
}

.comment-count {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

/* Selected badge */
.image-card.selected::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-red);
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.95);
    display: none;
    flex-direction: column;
}

.lightbox.open { display: flex; }

.lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.lightbox-filename {
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.lightbox-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.lightbox-image-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    touch-action: pan-y pinch-zoom;
}

.lightbox-image-area img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    transition: background 0.15s;
}

.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-sidebar {
    width: 340px;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.lightbox-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.lightbox-select-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.lightbox-select-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: none;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
}

.lightbox-select-btn:hover { background: var(--bg-hover); }
.lightbox-select-btn.active {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: #fff;
}

.select-names {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.lightbox-comments {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.comment-item {
    margin-bottom: 16px;
}

.comment-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
}

.comment-role {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 6px;
    font-weight: 400;
}

.comment-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.comment-time {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

.comment-form {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.comment-form input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    font-family: var(--font);
}

.comment-form input:focus { border-color: var(--text-muted); }

.comment-form button {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 14px;
    cursor: pointer;
    padding: 0 8px;
    font-family: var(--font);
    font-weight: 600;
}

/* ============================================
   UPLOAD AREA
   ============================================ */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 24px;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--text-muted);
}

.upload-zone-icon {
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--text-dim);
}

.upload-zone-text {
    font-size: 14px;
    color: var(--text-muted);
}

.upload-progress {
    margin-top: 16px;
}

.progress-bar {
    height: 4px;
    background: var(--bg);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 2px;
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   BADGES & TAGS
   ============================================ */
.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid;
}

.badge-active { border-color: var(--accent-green); color: var(--accent-green); background: rgba(46,213,115,0.1); }
.badge-locked { border-color: var(--accent-yellow); color: var(--accent-yellow); background: rgba(255,165,2,0.1); }
.badge-inactive { border-color: var(--text-dim); color: var(--text-dim); }

/* ============================================
   MODAL
   ============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-backdrop.open { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

/* ============================================
   DOWNLOAD BAR
   ============================================ */
.download-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--accent-blue);
    color: #fff;
    padding: 12px 24px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 200;
    font-size: 14px;
    font-weight: 500;
}

.download-bar.show { display: flex; }

/* ============================================
   UTILITIES
   ============================================ */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.copy-btn { cursor: pointer; }
.copy-btn:hover { color: var(--accent-blue); }

/* ============================================
   PASSWORD DISPLAY
   ============================================ */
.pw-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 13px;
}

.pw-display code { flex: 1; }

/* ============================================
   RESPONSIVE
/* ============================================
   MOBILE LIGHTBOX TOOLBAR (base styles)
   ============================================ */
.lightbox-mobile-toolbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10002;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    align-items: center;
    gap: 12px;
}

.lb-mobile-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.lb-mobile-btn .lb-mobile-heart {
    font-size: 18px;
}

.lb-mobile-btn.active {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: #fff;
}

.lb-mobile-btn.active .lb-mobile-heart {
    color: #fff;
}

.lb-mobile-names {
    flex: 1;
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-mobile-comment-btn {
    background: transparent;
    border-color: var(--border);
    font-size: 13px;
}

/* Mobile Comment Sheet */
.lightbox-mobile-comments {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10003;
    background: var(--bg-card);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    max-height: 60vh;
    flex-direction: column;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}

.lightbox-mobile-comments.open {
    display: flex;
}

.lb-mobile-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 15px;
}

.lb-mobile-sheet-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
}

.lb-mobile-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    min-height: 120px;
}

.lb-mobile-sheet-body .comment-item {
    padding: 10px 20px;
}

.lightbox-mobile-comments .comment-form {
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 768px) {
    .admin-sidebar { display: none; }
    .admin-main { margin-left: 0; padding: 16px; }
    .form-row { grid-template-columns: 1fr; }
    .image-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 12px; }
    .board-header-inner { flex-wrap: wrap; }
    .board-tabs { overflow-x: auto; width: 100%; }
    .lightbox-sidebar { display: none; }
    .lightbox-image-area { padding: 10px; padding-bottom: 80px; }
    .lightbox-nav { display: none; }
    .lightbox-mobile-toolbar { display: flex; }
    .campaign-grid { grid-template-columns: 1fr; }
    .image-overlay { opacity: 1; }
    .select-btn { width: 36px; height: 36px; font-size: 18px; }
}

/* Name input page */
.name-container {
    max-width: 400px;
    width: 100%;
    text-align: center;
    padding: 48px 24px;
}

/* Stage progress */
.stage-progress {
    display: flex;
    gap: 2px;
    margin: 16px 0;
}

.stage-dot {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--border);
}

.stage-dot.active { background: var(--accent-blue); }
.stage-dot.complete { background: var(--accent-green); }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 9999;
    transition: transform 0.3s;
    pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* Loading spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-dim);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}