/* ==================== QUEUE & CREDITS WIDGETS ==================== */

/* Sidebar Widgets */
.sidebar-widget {
    margin: 0.5rem 1rem;
}

/* Credits Widget */
.credits-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    margin-top: 16px;
}

.credits-widget:hover {
    transform: translateY(-2px);
}

.credits-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-radius: 0.5rem;
    color: white;
    flex-shrink: 0;
}

.credits-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.credits-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
}


.credits-text {

    color: var(--text-primary);
    text-align: right;
}

.credits-bar-container {
    position: relative;
    height: 0.5rem;
    background: var(--background-switch-off);
    border-radius: 0.25rem;
    overflow: hidden;
}

.credits-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #eab308 100%);
    border-radius: 0.25rem;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* Queue Widget */
.queue-widget {
    padding: 0;
    background: none;
    border: none;
}

.queue-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--background-dropdown-menu);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.queue-button:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.queue-button i {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--primary-color);
}

.queue-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.queue-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.queue-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.queue-badge.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ==================== ADMIN QUEUE TABLE ==================== */

.queue-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card-small {
    background: var(--background-dropdown-menu);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

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

.stat-card-small .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.queue-table .user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.queue-table .user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.queue-table .user-info {
    min-width: 0;
    flex: 1;
}

.queue-table .user-name {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-table .user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-title-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-icon {
    padding: 0.5rem;
    background: var(--background-dropdown-menu);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
}

.btn-icon i {
    width: 1rem;
    height: 1rem;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--background-dropdown-menu);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: var(--surface-hover);
}

.dropdown-menu a.danger {
    color: var(--danger-color);
}

.dropdown-menu a.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ==================== COMPACT QUEUE TABLE (Sidepanel) ==================== */

.queue-sidepanel-content {
    padding: 0;
}

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

.compact-queue-table thead {
    background: var(--background-dropdown-menu);
    position: sticky;
    top: 0;
    z-index: 10;
}

.compact-queue-table th {
    padding: 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

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

.compact-queue-table tbody tr {
    transition: background 0.2s;
}

.compact-queue-table tbody tr:hover {
    background: var(--surface-hover);
}

.compact-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.title-text {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.title-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.badge-mini {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-mini i {
    width: 0.875rem;
    height: 0.875rem;
}

.badge-mini.badge-gray {
    background: #6b7280;
    color: white;
}

.badge-mini.badge-blue {
    background: #3b82f6;
    color: white;
}

.badge-mini.badge-green {
    background: #10b981;
    color: white;
}

.badge-mini.badge-red {
    background: #ef4444;
    color: white;
}

.badge-mini.badge-format {
    background: var(--primary-color);
    color: white;
}

.compact-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-icon-small {
    padding: 0.375rem;
    background: var(--background-dropdown-menu);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-small:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
}

.btn-icon-small i {
    width: 0.875rem;
    height: 0.875rem;
}

.spinning {
    animation: spin 1s linear infinite;
}

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

.empty-state-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
