/* Reset and Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.login-box h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 28px;
}

.login-box h2 {
    color: var(--text-color);
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

.login-note {
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}

/* Admin Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    color: #fff;
    font-size: 20px;
    margin: 0;
    font-weight: 700;
}

.sidebar-header img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 4px 12px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 15px;
}

.nav-item:hover {
    background: rgba(102, 126, 234, 0.15);
    color: #fff;
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.nav-icon {
    margin-right: 14px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    text-align: center;
}

.user-info strong {
    display: block;
    color: #fff;
    margin-bottom: 4px;
}

.user-info small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

.top-header {
    background: var(--card-bg);
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.top-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
}

.content-area {
    flex: 1;
    padding: 30px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.card h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-color);
    font-weight: 600;
}

.card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-color);
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: #fff;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-link {
    background: transparent;
    color: var(--primary-color);
    text-decoration: none;
    box-shadow: none;
}

.btn-link:hover {
    text-decoration: underline;
    transform: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: #f8fafc;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-light);
    font-size: 13px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #e2e8f0;
    color: #475569;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge.new,
.badge.queued {
    background: #e0e7ff;
    color: #3730a3;
}

.badge.processing,
.badge.running {
    background: #fef3c7;
    color: #92400e;
}

.badge.ready,
.badge.done {
    background: #d1fae5;
    color: #065f46;
}

.badge.failed {
    background: #fee2e2;
    color: #991b1b;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    background: var(--bg-color);
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: var(--bg-color);
}

.text-center {
    text-align: center;
}

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

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

/* Dashboard */
.dashboard {
    width: 100%;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 12px;
    color: white;
}

.stat-content h3 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
}

.stat-content p {
    color: var(--text-light);
    font-size: 13px;
    font-weight: 500;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
}

.dashboard-section {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-color);
}

/* Video Detail */
.video-detail-page {
    width: 100%;
}

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

.video-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
}

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

.video-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

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

.info-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    width: 150px;
}

.info-table td {
    padding: 8px 12px;
    color: var(--text-color);
}

.video-players-section {
    margin-top: 30px;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
}

.player-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.player-card.vertical-player-card {
    max-width: none;
    margin: 0;
}

.player-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-color);
}

.video-player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    min-height: 300px;
}

.video-player-container.vertical {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding-bottom: 177.78%; /* 9:16 aspect ratio */
    min-height: 400px;
}

.video-player-container .video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
}

.player-url {
    margin-top: 12px;
    font-size: 12px;
    word-break: break-all;
}

.player-url a {
    color: var(--primary-color);
}

/* Filters */
.filters {
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-form input,
.filter-form select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.filter-form input {
    flex: 1;
    min-width: 200px;
}

.filter-form select {
    min-width: 150px;
}

/* Page Actions */
.page-actions {
    margin-bottom: 20px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
}

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

/* Utility Classes */
.mt-4 {
    margin-top: 24px;
}

.mb-4 {
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .players-grid {
        grid-template-columns: 1fr;
    }
    
    .video-info-grid {
        grid-template-columns: 1fr;
    }
}

