/* ===================================
   GAMET LIBRARY - Admin Panel Styles
   =================================== */

:root {
    --color-bg: #0a0a0a;
    --color-surface: #111111;
    --color-card: #161616;
    --color-border: rgba(255, 255, 255, 0.08);

    --color-text: #ffffff;
    --color-text-secondary: #a1a1a1;
    --color-text-muted: #666666;

    --color-primary: #ffffff;
    --color-danger: #ef4444;
    --color-success: #22c55e;
    --color-warning: #eab308;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --sidebar-width: 240px;
    --header-height: 64px;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --transition: 200ms ease;
}

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

html,
body {
    height: 100%;
}

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

/* ===================================
   LOGIN SCREEN
   =================================== */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--color-bg);
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 40px;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.login-logo img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.login-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 32px;
    color: var(--color-text-secondary);
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

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

.form-error {
    color: var(--color-danger);
    font-size: 0.875rem;
    min-height: 20px;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 24px;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--color-text);
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-bg);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8125rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
}

/* ===================================
   DASHBOARD LAYOUT
   =================================== */

.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
}

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

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center the logo in sidebar header */
    text-decoration: none;
}

.sidebar-logo img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--color-border);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.logout-btn svg {
    width: 20px;
    height: 20px;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.content-body {
    padding: 32px;
}

/* ===================================
   STATS CARDS
   =================================== */

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

.stat-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

/* ===================================
   VIDEO TABLE
   =================================== */

.table-container {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

.video-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

.video-table th,
.video-table td {
    padding: 16px 12px;
    text-align: left;
    vertical-align: middle;
}

/* Fixed column widths */
.video-table th:nth-child(1),
.video-table td:nth-child(1) {
    width: 100px;
}

/* Vorschau */
.video-table th:nth-child(2),
.video-table td:nth-child(2) {
    width: 200px;
}

/* Titel */
.video-table th:nth-child(3),
.video-table td:nth-child(3) {
    width: 140px;
}

/* Kategorie */
.video-table th:nth-child(4),
.video-table td:nth-child(4) {
    width: 80px;
}

/* Jahr */
.video-table th:nth-child(5),
.video-table td:nth-child(5) {
    width: 80px;
}

/* Aufrufe */
.video-table th:nth-child(6),
.video-table td:nth-child(6) {
    width: 90px;
}

/* Status */
.video-table th:nth-child(7),
.video-table td:nth-child(7) {
    width: 120px;
}

/* Aktionen */

.video-table th {
    background: var(--color-surface);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.video-table td {
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.video-table tr:last-child td {
    border-bottom: none;
}

.video-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.video-row-thumb {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

.video-row-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-row-category {
    color: var(--color-text-secondary);
}

.video-row-actions {
    display: flex;
    gap: 4px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
}

.badge-featured {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-success);
}

/* ===================================
   UPLOAD FORM
   =================================== */

.upload-form {
    max-width: 600px;
}

.upload-form .form-group {
    margin-bottom: 24px;
}

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

.file-upload {
    position: relative;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.file-upload:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.02);
}

.file-upload.has-file {
    border-color: var(--color-success);
    background: rgba(34, 197, 94, 0.05);
}

.file-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.file-upload-text {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

.file-upload-name {
    color: var(--color-success);
    font-weight: 500;
    margin-top: 8px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary);
}

/* ===================================
   CATEGORIES
   =================================== */

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.category-name {
    font-weight: 500;
}

.add-category-form {
    display: flex;
    gap: 12px;
    max-width: 400px;
    margin-bottom: 24px;
}

.add-category-form input {
    flex: 1;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-family: inherit;
}

/* ===================================
   MODAL
   =================================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 90%;
    text-align: center;
}

.modal-sm {
    max-width: 400px;
}

.modal-content h3 {
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

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

.progress-bar {
    height: 100%;
    background: var(--color-primary);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

/* ===================================
   EMPTY STATE
   =================================== */

.empty-state {
    text-align: center;
    padding: 64px;
    color: var(--color-text-muted);
}

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

.empty-state h3 {
    color: var(--color-text);
    margin-bottom: 8px;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .content-header {
        padding: 16px 20px;
    }

    .content-body {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .video-table {
        font-size: 0.875rem;
    }

    .video-table th,
    .video-table td {
        padding: 12px;
    }
}