/* ==========================================
   RESET E BASE
   ========================================== */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f0f1a;
    color: #eee;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================
   HEADER SUPERIOR
   ========================================== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(20, 20, 35, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 8px 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    color: white;
}

/* ==========================================
   BOTÃO GERENCIADOR
   ========================================== */
.btn-manager {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(139,124,182,0.2), rgba(139,124,182,0.05));
    border: 1px solid rgba(139,124,182,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    color: #a99bd4;
    flex-shrink: 0;
}

.btn-manager:hover {
    background: linear-gradient(135deg, rgba(139,124,182,0.35), rgba(139,124,182,0.15));
    border-color: rgba(139,124,182,0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139,124,182,0.25);
}

.btn-manager svg {
    width: 16px;
    height: 16px;
}

/* ==========================================
   LAYOUT CONTROLS
   ========================================== */
.layout-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.resize-controls {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.04);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    z-index: 10;
}

.layout-btn {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.layout-btn:hover {
    transform: scale(1.1);
}

.control-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    user-select: none;
}

.control-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.control-btn.active {
    background: rgba(139,124,182,0.3);
    color: #a99bd4;
}

/* ==========================================
   CONTADORES
   ========================================== */
.counters-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: rgba(255,255,255,0.5);
}

.counters-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.counters-divider {
    color: rgba(255,255,255,0.2);
    font-size: 10px;
}

.counter-item {
    display: flex;
    align-items: center;
    gap: 2px;
}

.counter-badge {
    font-size: 8px;
    font-weight: 600;
    padding: 1px 3px;
    border-radius: 3px;
}

.counter-badge.hl { 
    background: rgba(255,107,122,0.25);
    color: #ff9aa8;
}

.counter-badge.lm { 
    background: rgba(139,124,182,0.25);
    color: #b8aee0;
}

.counter-star {
    color: #FFD700;
    font-size: 8px;
}

.counter-value {
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    font-size: 10px;
    min-width: 22px;
    text-align: left;
}

.counter-total-label {
    font-size: 8px;
    color: rgba(255,215,0,0.7);
    font-weight: 600;
}

/* ==========================================
   FILTROS
   ========================================== */
.filters-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters-row {
    display: flex;
    align-items: center;
}

/* ==========================================
   ORDENAÇÃO
   ========================================== */
.sort-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.sort-btn {
    padding: 5px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    color: rgba(255,255,255,0.5);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sort-btn:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
}

.sort-btn.active {
    background: rgba(139,124,182,0.25);
    border-color: rgba(139,124,182,0.3);
    color: #fff;
}

.sort-indicator {
    font-size: 7px;
    margin-left: 2px;
    opacity: 0.7;
}

/* ==========================================
   BOTÃO RESET
   ========================================== */
.reset-btn {
    width: 26px;
    height: 26px;
    background: rgba(255,152,0,0.1);
    border: 1px solid rgba(255,152,0,0.2);
    border-radius: 6px;
    color: #FF9800;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.reset-btn:hover {
    background: rgba(255,152,0,0.2);
    transform: rotate(180deg);
}

/* ==========================================
   BOTÃO DE PAÍS
   ========================================== */
.country-btn,
.country-display-compact.country-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    max-width: none;
}

.country-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.country-btn .icon {
    font-size: 12px;
}

.country-btn .arrow {
    font-size: 8px;
    opacity: 0.5;
}

/* ==========================================
   SYNC / TIMER
   ========================================== */
.sync-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sync-timer {
    display: flex;
    align-items: center;
}

.sync-time {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    min-width: 28px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.sync-btn {
    width: 24px;
    height: 24px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sync-btn:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
}

.sync-btn svg {
    width: 12px;
    height: 12px;
}

.sync-btn.refresh:hover svg {
    animation: spin-refresh 0.6s ease;
}

@keyframes spin-refresh {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sync-group.paused .sync-btn {
    border-color: rgba(255,193,7,0.4);
    color: #FFC107;
}

.sync-group.paused .sync-time {
    color: #FFC107;
}

/* ==========================================
   SISTEMA DE FILTROS (DENTRO DOS PAINÉIS)
   ========================================== */
.filter-toggle-icon {
    display: inline-block;
    margin-left: 8px;
    cursor: pointer;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.50);
    transition: color 0.2s;
    user-select: none;
}

.filter-toggle-icon:hover {
    color: rgba(255, 255, 255, 0.80);
}

.panel-filters {
    position: absolute;
    top: 30px;
    left: 0;
    right: auto;
    background: rgba(0, 0, 0, 0.75);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    z-index: 99;
    transition: max-height 0.3s ease, padding 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9pt;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.panel-filters.active {
    max-height: 40px;
    padding: 6px 6px;
    gap: 4px;
}

.filter-label-compact {
    color: rgba(255, 255, 255, 0.70);
    font-weight: normal;
    white-space: nowrap;
}

/* ==========================================
   SELETOR DE PAÍSES (COMPACT)
   ========================================== */
.country-select-compact {
    position: relative;
    width: 100px;
    flex-shrink: 0;
}

.country-display-compact {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: none;
    padding: 3px 20px 3px 6px;
    font-size: 9pt;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.country-arrow-compact {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
    font-size: 8px;
}

.country-dropdown-compact {
    position: fixed;
    top: auto;
    left: auto;
    min-width: 250px;
    background: #fff;
    border: 1px solid #ccc;
    max-height: 350px;
    overflow-y: auto;
    z-index: 100000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.country-dropdown-compact.active {
    display: block;
}

.country-search-compact {
    position: sticky;
    top: 0;
    background: #f5f5f5;
    padding: 6px;
    border-bottom: 1px solid #ddd;
}

.country-search-compact input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #ccc;
    font-size: 9pt;
    box-sizing: border-box;
}

.country-item-compact {
    padding: 5px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 9pt;
    color: #333;
    transition: background 0.2s;
}

.country-item-compact:hover {
    background: #e3f2fd;
}

.country-item-compact input[type="checkbox"] {
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.country-code-compact {
    font-weight: bold;
    color: #1976d2;
    min-width: 25px;
}

.country-name-compact {
    color: #555;
    flex: 1;
}

/* ==========================================
   ORDENAÇÃO COMPACT
   ========================================== */
.sort-btn-compact {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: rgba(255, 255, 255, 0.80);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 12px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 2px;
}

.sort-btn-compact:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sort-btn-compact.asc {
    color: #4CAF50;
}

.sort-btn-compact.desc {
    color: #f44336;
}

.reset-btn-compact {
    background: transparent;
    border: none;
    color: #ff9800;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 14px;
    transition: color 0.2s;
    margin-left: 4px;
}

.reset-btn-compact:hover {
    color: #ffc107;
}

/* ==========================================
   LAYOUT VERTICAL
   ========================================== */
#layout-vertical {
    display: flex;
    height: calc(100% - 52px);
    margin-top: 52px;
}

#layout-vertical.hidden {
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 30px);
    pointer-events: none;
}

.v-left-panel, .v-right-panel {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    min-width: 0;
}

.v-resizer {
    width: 6px;
    background-color: rgba(0, 0, 0, 0.60);
    cursor: col-resize;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v-resizer:hover {
    background-color: rgba(0, 0, 0, 0.80);
}

.v-resizer::before {
    content: '⋮ ⋮ ⋮';
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
    letter-spacing: -2px;
    text-shadow: 1px 0 0 rgba(0, 0, 0, 0.5);
}

.v-resizer:hover::before {
    color: rgba(255, 255, 255, 0.8);
}

/* ==========================================
   GERENCIADOR DE IDS - MODAL
   ========================================== */
#manager-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 9999999;
}

#manager-modal.active {
    display: flex;
}

.manager-container {
    width: 700px;
    max-height: 85vh;
    background: rgba(20,20,35,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: grab;
    user-select: none;
}

.manager-header:active {
    cursor: grabbing;
}

.manager-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.manager-header h2 svg {
    opacity: 0.7;
}

.manager-header .drag-hint {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    margin-left: 10px;
}

.manager-close {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.manager-close:hover {
    background: rgba(244,67,54,0.15);
    border-color: rgba(244,67,54,0.3);
    color: #f44336;
}

/* ==========================================
   MANAGER - BUSCA E FILTROS
   ========================================== */
.manager-search {
    padding: 12px 20px;
    background: rgba(255,255,255,0.01);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.manager-search input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.manager-search input::placeholder {
    color: rgba(255,255,255,0.35);
}

.manager-search input:focus {
    outline: none;
    border-color: rgba(139,124,182,0.5);
    background: rgba(255,255,255,0.08);
}

.search-row {
    margin-bottom: 10px;
}

.search-row .input-wrapper {
    width: 100%;
}

.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
}

.filter-select {
    padding: 8px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:hover {
    background: rgba(255,255,255,0.1);
}

.filter-select:focus {
    outline: none;
    border-color: rgba(139,124,182,0.5);
}

.filter-select option {
    background: #1a1a2e;
    color: #fff;
}

/* ==========================================
   BOTÕES DE FILTRO
   ========================================== */
.filter-btn {
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-1px);
}

.filter-btn svg {
    width: 16px;
    height: 16px;
}

.filter-btn.red {
    border-color: rgba(244,67,54,0.3);
    color: #f44336;
}

.filter-btn.red:hover {
    background: rgba(244,67,54,0.1);
}

.filter-btn.gray {
    border-color: rgba(136,136,136,0.3);
    color: #888;
}

.filter-btn.gray:hover {
    background: rgba(136,136,136,0.1);
}

.filter-btn.orange {
    border-color: rgba(255,152,0,0.3);
    color: #FF9800;
}

.filter-btn.orange:hover {
    background: rgba(255,152,0,0.1);
}

.filter-btn.green {
    border-color: rgba(76,175,80,0.3);
    color: #4CAF50;
}

.filter-btn.green:hover {
    background: rgba(76,175,80,0.1);
}

.filter-btn.purple {
    border-color: rgba(139,124,182,0.3);
    color: #a99bd4;
}

.filter-btn.purple:hover {
    background: rgba(139,124,182,0.1);
}

/* ==========================================
   MANAGER - LISTA
   ========================================== */
.manager-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    min-height: 200px;
    overflow: hidden;
}

.manager-item {
    contain: content;
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.manager-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
}

.manager-item.recording {
    border-left: 3px solid #f44336;
}

.manager-item-info {
    flex: 1;
    min-width: 0;
}

.manager-item-id {
    font-size: 14px;
    color: #2196F3;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-block;
    max-width: 100%;
}

.manager-item-id:hover {
    color: #64B5F6;
    text-decoration: underline;
}

.manager-item-name {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: fit-content;
    max-width: 100%;
}

/* ==========================================
   ITENS DA ABA OCULTOS
   ========================================== */
.item-info {
    flex: 1;
    min-width: 0;
}

.item-id {
    font-size: 14px;
    color: #2196F3;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color 0.2s ease;
}

.item-id:hover {
    color: #64B5F6;
    text-decoration: underline;
}

.item-name {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-actions {
    display: flex;
    gap: 6px;
    margin-left: 10px;
}

.btn-unhide {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-unhide:hover {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
}

.btn-unhide svg {
    width: 18px;
    height: 18px;
}

.manager-item-actions {
    display: flex;
    gap: 4px;
    margin-left: 10px;
}

/* ==========================================
   MANAGER - BOTÕES
   ========================================== */
.manager-btn {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}

.manager-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.manager-btn svg {
    width: 16px;
    height: 16px;
}

.manager-btn-remove {
    color: rgba(244,67,54,0.6);
}

.manager-btn-remove:hover {
    background: rgba(244,67,54,0.15);
    color: #ff6b6b;
}

.manager-btn-edit {
    color: rgba(255,255,255,0.5);
}

.manager-btn-edit:hover {
    background: rgba(139,124,182,0.15);
    color: #a99bd4;
}

.manager-btn-auto {
    color: #f44336;
    border-color: rgba(244,67,54,0.3);
}

.manager-btn-auto:hover {
    background: rgba(244,67,54,0.15);
}

.manager-btn-auto.inactive {
    color: #888;
    border-color: rgba(136,136,136,0.3);
}

.manager-btn-auto.inactive:hover {
    background: rgba(136,136,136,0.15);
}

.manager-btn-star {
    color: rgba(255,215,0,0.5);
    border-color: rgba(255,215,0,0.2);
}

.manager-btn-star:hover {
    background: rgba(255,215,0,0.15);
    color: #FFD700;
}

.manager-select-condition {
    padding: 6px 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 80px;
}

.manager-select-condition:hover {
    background: rgba(255,255,255,0.1);
}

.manager-select-condition:focus {
    outline: none;
    border-color: rgba(139,124,182,0.5);
}

.manager-select-condition option {
    background: #1a1a2e;
    color: #fff;
}

.manager-btn-stop {
    color: #f44336;
    border-color: rgba(244,67,54,0.3);
    background: rgba(244,67,54,0.1);
}

.manager-btn-stop:hover {
    background: rgba(244,67,54,0.25);
}

/* ==========================================
   SCROLLBAR
   ========================================== */
.manager-list::-webkit-scrollbar,
.recorder-tab-content::-webkit-scrollbar {
    width: 6px;
}

.manager-list::-webkit-scrollbar-track,
.recorder-tab-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.02);
}

.manager-list::-webkit-scrollbar-thumb,
.recorder-tab-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.manager-list::-webkit-scrollbar-thumb:hover,
.recorder-tab-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* ==========================================
   INDICADOR DE GRAVAÇÃO
   ========================================== */
.recording-indicator {
    width: 10px;
    height: 10px;
    background: #f44336;
    border-radius: 50%;
    animation: pulse-recording 1s ease-in-out infinite;
    flex-shrink: 0;
    cursor: pointer;
}

.recording-indicator.clicked {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8);
}

.video-id-copy.clicked {
    color: #4CAF50;
}

@keyframes pulse-recording {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* ==========================================
   CONTROLES DE GRAVAÇÃO
   ========================================== */
.recording-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-multistream-manager {
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.06);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-multistream-manager:hover {
    background: rgba(255,255,255,0.12);
}

.btn-multistream-manager svg {
    width: 14px;
    height: 14px;
}

/* ==========================================
   VIDEO ID
   ========================================== */
.item-video-id {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.video-id-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.video-id-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.video-id-label {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    flex-shrink: 0;
}

.video-id-value {
    font-size: 12px;
    color: #f44336;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-id-stop {
    width: 24px;
    height: 24px;
    background: rgba(244,67,54,0.15);
    border: none;
    border-radius: 4px;
    color: #f44336;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    animation: pulse-stop 1.5s ease-in-out infinite;
}

.video-id-stop:hover {
    background: rgba(244,67,54,0.25);
}

.video-id-stop svg {
    width: 18px;
    height: 18px;
}

@keyframes pulse-stop {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(244,67,54,0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(244,67,54,0);
    }
}

.video-id-copy,
.video-id-multistream {
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.06);
    border: none;
    border-radius: 4px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.video-id-copy:hover,
.video-id-multistream:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.video-id-copy svg {
    width: 13px;
    height: 13px;
}

.video-id-multistream svg {
    width: 14px;
    height: 14px;
}

/* ==========================================
   BOTÃO STOP NA LISTA
   ========================================== */
.btn-stop-recording {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-stop-recording:hover {
    transform: scale(1.1);
}

.manager-empty {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* ==========================================
   MANAGER - ADICIONAR
   ========================================== */
.manager-add {
    padding: 16px 20px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.manager-add input {
    padding: 10px 36px 10px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    transition: all 0.2s ease;
}

.manager-add input::placeholder {
    color: rgba(255,255,255,0.35);
}

.manager-add input:focus {
    outline: none;
    border-color: rgba(139,124,182,0.5);
    background: rgba(255,255,255,0.08);
}

.add-row {
    display: flex;
    gap: 8px;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.input-wrapper input {
    width: 100%;
    box-sizing: border-box;
}

.input-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.input-clear:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ==========================================
   BOTÃO ADICIONAR
   ========================================== */
.btn-add {
    width: 42px;
    height: 42px;
    background: rgba(255,215,0,0.15);
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 8px;
    color: #FFD700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-add:hover {
    background: rgba(255,215,0,0.25);
    transform: translateY(-1px);
}

.btn-add svg {
    width: 20px;
    height: 20px;
}

.btn-add.record {
    background: rgba(244,67,54,0.15);
    border-color: rgba(244,67,54,0.3);
    color: #f44336;
}

.btn-add.btn-hide {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
}

.btn-add.btn-hide:hover {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
}

/* ==========================================
   ABAS DO GERENCIADOR
   ========================================== */
.manager-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 20px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.manager-tab {
    padding: 10px 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.manager-tab:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
}

.manager-tab.active {
    background: linear-gradient(135deg, rgba(139,124,182,0.25), rgba(139,124,182,0.1));
    border-color: rgba(139,124,182,0.3);
    color: #fff;
}

.manager-tab svg {
    width: 14px;
    height: 14px;
}

.manager-tab-content {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    flex-direction: column;
}

.manager-tab-content.active {
    display: flex;
}

/* ==========================================
   CAIXAS DE DIÁLOGO PERSONALIZADAS
   ========================================== */
.custom-dialog-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999999;
    justify-content: center;
    align-items: center;
}

.custom-dialog-overlay.active {
    display: flex;
}

.custom-dialog {
    background: rgba(20, 20, 35, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 25px;
    min-width: 300px;
    max-width: 400px;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.custom-dialog-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
}

.custom-dialog-message {
    font-size: 13px;
    margin-bottom: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

.custom-dialog-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.06);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.custom-dialog-input:focus {
    outline: none;
    border-color: rgba(139,124,182,0.5);
    background: rgba(255,255,255,0.08);
}

.custom-dialog-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-dialog-btn {
    padding: 10px 25px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    flex: 1;
    transition: all 0.2s ease;
}

.custom-dialog-btn:hover {
    transform: translateY(-1px);
}

.custom-dialog-btn-confirm {
    background: rgba(76,175,80,0.2);
    border-color: rgba(76,175,80,0.3);
    color: #4CAF50;
}

.custom-dialog-btn-confirm:hover {
    background: rgba(76,175,80,0.3);
}

.custom-dialog-btn-delete {
    background: rgba(244,67,54,0.2);
    border-color: rgba(244,67,54,0.3);
    color: #f44336;
}

.custom-dialog-btn-delete:hover {
    background: rgba(244,67,54,0.3);
}

.custom-dialog-btn-cancel {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
}

.custom-dialog-btn-cancel:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* ==========================================
   NOTIFICAÇÕES TOAST
   ========================================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 999999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(20, 20, 35, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 13px;
    min-width: 280px;
    max-width: 380px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(400px);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.toast-success {
    background: rgba(76, 175, 80, 0.25);
    border-color: rgba(76, 175, 80, 0.4);
}

.toast-error {
    background: rgba(244, 67, 54, 0.25);
    border-color: rgba(244, 67, 54, 0.4);
}

.toast-info {
    background: rgba(139, 124, 182, 0.25);
    border-color: rgba(139, 124, 182, 0.4);
}

/* ==========================================
   CAMPO DE BUSCA GLOBAL
   ========================================== */
.global-search-container {
    display: flex;
    align-items: center;
}

#global-search-input {
    width: 150px;
    padding: 6px 28px 6px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    color: #fff;
    font-size: 11px;
    transition: all 0.3s ease;
}

#global-search-input::placeholder {
    color: rgba(255,255,255,0.35);
}

#global-search-input:focus {
    outline: none;
    background: rgba(255,255,255,0.08);
    border-color: rgba(139,124,182,0.4);
}

#clear-search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: none;
    opacity: 0.5;
    transition: all 0.2s;
}

#clear-search-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

#clear-search-btn svg circle {
    fill: rgba(255, 255, 255, 0.3);
}

#clear-search-btn:hover svg circle {
    fill: rgba(255, 255, 255, 0.5);
}

.search-loading {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #00BCD4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.search-loading.active {
    display: block;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.search-container {
    position: relative;
    display: inline-block;
}

/* ==========================================
   BUSCA DE PAÍSES
   ========================================== */
.country-search-wrapper {
    position: relative;
    display: block;
}

.country-search-compact input {
    padding-right: 24px !important;
}

.clear-country-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 14px;
    height: 14px;
    display: none;
    opacity: 0.5;
    transition: all 0.2s;
}

.clear-country-search:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.clear-country-search svg circle {
    fill: #999;
}

.clear-country-search:hover svg circle {
    fill: #666;
}

/* ==========================================
   CONTADOR DO GERENCIADOR
   ========================================== */
.manager-counter {
    padding: 8px 20px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

.manager-counter span {
    color: #fff;
    font-weight: 600;
}

/* ==========================================
   SUB-ABAS DO RECORDER
   ========================================== */
.recorder-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.01);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.recorder-tab {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.recorder-tab:hover {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.04);
}

.recorder-tab.active {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    color: #fff;
}

.recorder-tab-count {
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
}

.recorder-tab.active .recorder-tab-count {
    background: rgba(139,124,182,0.3);
}

.recorder-tab-content {
    display: none;
}

.recorder-tab-content.active {
    display: block;
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

#hide-list {
    overflow-y: auto;
    flex: 1;
}

/* ==========================================
   PAGINAÇÃO
   ========================================== */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid rgba(255,255,255,0.06);
}

.pagination-btn {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: rgba(139,124,182,0.25);
    border-color: rgba(139,124,182,0.3);
    color: #fff;
}

.pagination-info {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    margin: 0 8px;
}

.pagination-total {
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    margin-left: 8px;
}

/* ==========================================
   ANIMAÇÕES
   ========================================== */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* ===== ÁREA DIREITA DO HEADER ===== */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== BOTÃO LOGOUT ===== */
.logout-btn {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    transition: all 0.2s ease;
}

.logout-btn svg {
    width: 18px;
    height: 18px;
    stroke: #dc3545;
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.4);
    border-color: #dc3545;
}