/* ============================================
   Rote Digital VOD Manager Styles
   Dark theme matching admin app aesthetics
   ============================================ */

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --bg-hover: #303030;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #707070;
    --border-color: #333333;
    --primary: #667eea;
    --primary-hover: #5a6fd6;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --info: #4299e1;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.2s ease;
}

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

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

/* ============================================
   Views
   ============================================ */

.view {
    display: none;
}

.view.active {
    display: block;
}

/* ============================================
   Login View
   ============================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a2e 100%);
}

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

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 16px;
}

.header-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* ============================================
   Dashboard View
   ============================================ */

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

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right #admin-name {
    color: var(--text-secondary);
    font-size: 14px;
}

.main {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   Cards
   ============================================ */

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

.card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

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

.section-header h2 {
    margin-bottom: 0;
}

/* ============================================
   Forms
   ============================================ */

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

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

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   File Upload
   ============================================ */

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

.file-upload-area:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.file-icon {
    font-size: 40px;
}

.file-text {
    font-size: 14px;
    color: var(--text-secondary);
}

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

.file-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.file-selected .file-name {
    color: var(--primary);
    font-weight: 500;
}

.btn-remove-file {
    background: var(--danger);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Progress Bar
   ============================================ */

.progress-container {
    margin-bottom: 20px;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--info));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

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

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
}

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

.btn-danger:hover:not(:disabled) {
    background: #e53e3e;
}

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

.btn-full {
    width: 100%;
}

.btn .btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: inline;
}

/* ============================================
   Videos List
   ============================================ */

.videos-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.video-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .video-item {
        grid-template-columns: 1fr;
    }
}

.video-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.video-url-container {
    margin-top: 12px;
}

.video-url {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 12px;
    overflow: hidden;
}

.video-url input {
    flex: 1;
    background: none;
    border: none;
    color: var(--primary);
    font-family: monospace;
    font-size: 12px;
    outline: none;
}

.btn-copy {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--primary-hover);
}

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

/* ============================================
   Status Badges
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-pending {
    background: rgba(237, 137, 54, 0.2);
    color: var(--warning);
}

.badge-processing {
    background: rgba(66, 153, 225, 0.2);
    color: var(--info);
    animation: pulse 1.5s infinite;
}

.badge-completed {
    background: rgba(72, 187, 120, 0.2);
    color: var(--success);
}

.badge-failed {
    background: rgba(245, 101, 101, 0.2);
    color: var(--danger);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ============================================
   Loading & Empty States
   ============================================ */

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

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

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

/* ============================================
   Error Message
   ============================================ */

.error-message {
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(245, 101, 101, 0.1);
    border-radius: var(--radius);
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* ============================================
   Pagination
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   Toast Notifications
   ============================================ */

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--info);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   Utilities
   ============================================ */

.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted);
}

.text-danger {
    color: var(--danger);
}

.mt-2 {
    margin-top: 8px;
}

/* ============================================
   Tabs
   ============================================ */

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
    font-family: inherit;
}

.tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   Modals
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 440px;
    margin: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

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

.modal-close:hover {
    color: var(--text-primary);
}

.modal-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ============================================
   Admins List
   ============================================ */

.admins-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.admin-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.admin-info .admin-email {
    color: var(--text-secondary);
    font-size: 13px;
}

.admin-info .admin-meta {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

.admin-actions {
    display: flex;
    gap: 8px;
}