/* =============================================================================
   admin.css - Kürsat Gürbüz — Visual Content Studio Admin Dashboard
   Reduziertes, präzises Picdrop-Design für Fotografen
   ============================================================================= */

:root {
    --bg-canvas: #161616;
    --bg-header: #161616;
    --bg-surface: #1e1e1e;
    --bg-surface-hover: #262626;
    --border-line: #262626;
    --border-line-hover: #3a3a3a;

    --text-main: #e5e5e5;
    --text-muted: #8c8c8c;
    --text-dimmed: #525252;

    --btn-primary-bg: #e5e5e5;
    --btn-primary-text: #161616;
    --btn-primary-hover: #ffffff;

    --c-green: #22c55e;
    --c-red: #ef4444;
    --c-yellow: #eab308;
    --c-blue: #3b82f6;

    --font-studio: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-main);
    font-family: var(--font-studio);
    font-size: 13px;
    line-height: 1.45;
    letter-spacing: -0.01em;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* =============================================================================
   ADMIN HEADER
   ============================================================================= */
.admin-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-line);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.admin-brand-block {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.photographer-tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.header-sep {
    color: var(--border-line-hover);
}

.admin-page-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =============================================================================
   BUTTONS (FLACH & DEZENT)
   ============================================================================= */
.btn-primary-studio {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    padding: 0 14px;
    height: 32px;
    border-radius: 3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.12s ease;
}

.btn-primary-studio:hover {
    opacity: 0.9;
}

.btn-subtle-sm {
    background: transparent;
    border: 1px solid var(--border-line);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    padding: 0 12px;
    height: 32px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s ease;
}

.btn-subtle-sm:hover {
    border-color: var(--border-line-hover);
    background: var(--bg-surface);
}

.btn-ghost-sm {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-family: inherit;
    padding: 0 8px;
    height: 32px;
    cursor: pointer;
}

.btn-ghost-sm:hover {
    color: var(--text-main);
}

.btn-danger-studio {
    background: var(--c-red);
    color: #ffffff;
    border: none;
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    padding: 0 14px;
    height: 32px;
    border-radius: 3px;
    cursor: pointer;
}

.btn-danger-studio:hover {
    opacity: 0.9;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* =============================================================================
   MAIN CONTAINER & METRICS STRIP
   ============================================================================= */
.admin-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 28px 28px 80px 28px;
}

.metrics-strip {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-line);
    border-radius: 4px;
    padding: 16px 24px;
    margin-bottom: 28px;
    gap: 32px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-label {
    font-size: 11.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.metric-green {
    color: var(--c-green);
}

.status-ready {
    color: var(--c-green);
    font-size: 14px;
    margin-top: 4px;
}

.metric-vsep {
    width: 1px;
    height: 32px;
    background: var(--border-line);
}

/* =============================================================================
   GALERIEN LISTE / TABELLE
   ============================================================================= */
.galleries-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-line);
    border-radius: 4px;
    overflow: hidden;
}

.panel-head {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.panel-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-search-field {
    background: var(--bg-canvas);
    border: 1px solid var(--border-line);
    border-radius: 3px;
    padding: 0 10px;
    height: 30px;
    color: var(--text-main);
    font-size: 12px;
    font-family: inherit;
    width: 200px;
}

.admin-search-field:focus {
    outline: none;
    border-color: var(--border-line-hover);
}

.galleries-table-wrap {
    overflow-x: auto;
}

.galleries-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.galleries-table th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-line);
    background: rgba(0, 0, 0, 0.15);
}

.galleries-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-line);
    font-size: 12.5px;
    vertical-align: middle;
}

.galleries-table tr:hover td {
    background: var(--bg-surface-hover);
}

.gal-title-cell {
    display: flex;
    flex-direction: column;
}

.gal-name {
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
}

.gal-name:hover {
    text-decoration: underline;
}

.gal-slug {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

/* Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-status.submitted {
    background: rgba(34, 197, 94, 0.12);
    color: var(--c-green);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-status.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-line);
}

.pin-pill {
    background: var(--bg-canvas);
    border: 1px solid var(--border-line);
    padding: 2px 7px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11.5px;
    color: var(--text-main);
}

/* Aktionen Zeile */
.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.action-icon-btn {
    background: transparent;
    border: 1px solid var(--border-line);
    color: var(--text-muted);
    padding: 5px 8px;
    border-radius: 3px;
    font-size: 11.5px;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.12s ease;
    white-space: nowrap;
}

.action-icon-btn:hover {
    color: var(--text-main);
    border-color: var(--border-line-hover);
    background: var(--bg-canvas);
}

.action-icon-btn.btn-delete:hover {
    color: var(--c-red);
    border-color: rgba(239, 68, 68, 0.4);
}

/* =============================================================================
   MODAL: NEUE GALERIE & CANVAS UPLOAD
   ============================================================================= */
.studio-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.studio-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.studio-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-line-hover);
    border-radius: 4px;
    max-width: 580px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
}

.studio-modal.modal-wide {
    max-width: 680px;
}

.studio-modal.modal-compact {
    max-width: 380px;
}

.modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-line);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.modal-heading {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.modal-subheading {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.modal-x {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

.modal-x:hover {
    color: var(--text-main);
}

.modal-content {
    padding: 20px;
}

.modal-actions {
    padding: 12px 20px;
    border-top: 1px solid var(--border-line);
    background: var(--bg-canvas);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row {
    margin-bottom: 14px;
}

.form-caption {
    display: block;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.form-row input[type="text"],
.form-row input[type="date"] {
    width: 100%;
    background: var(--bg-canvas);
    border: 1px solid var(--border-line);
    border-radius: 3px;
    color: var(--text-main);
    padding: 7px 10px;
    font-size: 12.5px;
    font-family: inherit;
}

.form-row input[type="text"]:focus,
.form-row input[type="date"]:focus {
    outline: none;
    border-color: var(--border-line-hover);
}

.flat-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
}

.flat-checkbox input {
    accent-color: var(--text-main);
}

.form-sep {
    height: 1px;
    background: var(--border-line);
    margin: 16px 0;
}

/* =============================================================================
   DRAG & DROP UPLOADZONE & CANVAS PROZESSOR
   ============================================================================= */
.drop-zone {
    border: 1.5px dashed var(--border-line-hover);
    border-radius: 4px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    background: var(--bg-canvas);
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--text-main);
    background: var(--bg-surface);
}

.drop-icon {
    color: var(--text-muted);
    margin-bottom: 4px;
}

.drop-main-text {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-main);
}

.drop-sub-text {
    font-size: 11px;
    color: var(--text-muted);
}

.file-input-hidden {
    display: none;
}

/* Upload Queue */
.upload-queue-wrap {
    margin-top: 14px;
    background: var(--bg-canvas);
    border: 1px solid var(--border-line);
    border-radius: 4px;
    padding: 12px;
}

.queue-head {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.queue-bar-track {
    width: 100%;
    height: 4px;
    background: var(--border-line);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.queue-bar-fill {
    height: 100%;
    background: var(--c-green);
    transition: width 0.12s ease;
}

.queue-file-list {
    max-height: 140px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    padding: 2px 4px;
}

.queue-item.done {
    color: var(--c-green);
}

/* =============================================================================
   MASTER-PASSWORT LOGIN OVERLAY
   ============================================================================= */
.admin-login-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-canvas);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.admin-login-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.login-box {
    max-width: 320px;
    width: 100%;
    text-align: center;
}

.login-brand {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.login-title {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.form-field input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-line);
    border-radius: 3px;
    padding: 8px 12px;
    color: var(--text-main);
    font-size: 13px;
    font-family: inherit;
    margin-bottom: 12px;
}

.form-field input:focus {
    outline: none;
    border-color: var(--text-main);
}

.login-error {
    font-size: 11.5px;
    color: var(--c-red);
    margin-bottom: 10px;
}

.login-hint {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-line);
    font-size: 11px;
    color: var(--text-dimmed);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    text-decoration: underline;
    cursor: pointer;
}

/* Toast */
.studio-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.studio-toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-line-hover);
    border-radius: 3px;
    padding: 7px 12px;
    font-size: 12px;
    color: var(--text-main);
    pointer-events: auto;
    animation: toastFade 0.2s ease;
}

@keyframes toastFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Foto-Verwaltung Modal */
.admin-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    padding: 6px 0;
    max-height: 55vh;
    overflow-y: auto;
}

.admin-photo-card {
    background: var(--bg-canvas);
    border: 1px solid var(--border-line);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease;
}

.admin-photo-card:hover {
    border-color: var(--border-line-hover);
}

.admin-photo-thumb-wrap {
    width: 100%;
    aspect-ratio: 3/2;
    background: #111;
    overflow: hidden;
    position: relative;
}

.admin-photo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-photo-meta {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-photo-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-photo-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.admin-photo-subfolder {
    font-size: 10px;
    color: var(--text-muted);
}

.btn-delete-single-photo {
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 10.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.12s ease;
}

.btn-delete-single-photo:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.hidden {
    display: none !important;
}
