/* ============================================= */
/* --- 1. ESTILOS GLOBAIS E VARIÁVEIS --- */
/* ============================================= */

:root {
    /* Cores Principais */
    --primary: #25D366; /* Verde WhatsApp */
    --primary-rgb: 37, 211, 102;
    --primary-dark: #1A8C47; /* Verde escuro */
    --primary-light: #4AE88A; /* Verde claro para destaques */
    --secondary: #E0E0E0; /* Prata claro, inspirado em alumínio */
    --secondary-rgb: 224, 224, 224;
    --dark: #000000; /* Preto puro para fundo black piano */
    --light: #FFFFFF; /* Branco puro */
    --success-color: #2ECC71; /* Verde suave para sucesso */
    --error-color: #E74C3C; /* Vermelho elegante para erros */
    --warning-color: #F1C40F; /* Amarelo sutil para avisos */
    
    /* Cores de Fundo */
    --dark-bg: #000000; /* Fundo black piano */
    --background-medium: #1A1A1A; /* Cinza escuro metálico */
    --background-light: #2C2C2C; /* Cinza ligeiramente mais claro */
    --neutral-bg: #E8ECEF; /* Fundo neutro claro */
    
    /* Cores de Texto */
    --text-color: #FFFFFF;
    --text-secondary: #C4C4C4; /* Cinza claro para contraste */
    
    /* Bordas */
    --border-color: rgba(255, 255, 255, 0.15);
    
    /* Cores para Dispositivos */
    --device-color-1: rgba(37, 211, 102, 0.1); /* Verde suave */
    --device-color-2: rgba(224, 224, 224, 0.1); /* Prata */
    --device-color-3: rgba(46, 204, 113, 0.1); /* Verde médio */
    --device-color-4: rgba(52, 152, 219, 0.1); /* Azul suave */
    --device-color-5: rgba(241, 196, 15, 0.1); /* Amarelo suave */
    --device-border-1: #25D366;
    --device-border-2: #E0E0E0;
    --device-border-3: #2ECC71;
    --device-border-4: #3498DB;
    --device-border-5: #F1C40F;
    
    /* Novas cores para fluxos */
    --flow-color-1: #00C4B4; /* Ciano vibrante */
    --flow-color-2: #FF6B6B; /* Vermelho coral */
    --flow-color-3: #4B7BFF; /* Azul elétrico */
    --flow-color-4: #F39C12; /* Laranja quente */
    --flow-color-5: #9B59B6; /* Roxo vibrante */
    
    /* Gradientes para fluxos */
    --flow-gradient-1: linear-gradient(145deg, var(--flow-color-1), #00838F);
    --flow-gradient-2: linear-gradient(145deg, var(--flow-color-2), #C0392B);
    --flow-gradient-3: linear-gradient(145deg, var(--flow-color-3), #2E5BFF);
    --flow-gradient-4: linear-gradient(145deg, var(--flow-color-4), #E67E22);
    --flow-gradient-5: linear-gradient(145deg, var(--flow-color-5), #8E44AD);
    
    /* Bordas e detalhes */
    --flow-border-1: rgba(0, 196, 180, 0.5);
    --flow-border-2: rgba(255, 107, 107, 0.5);
    --flow-border-3: rgba(75, 123, 255, 0.5);
    --flow-border-4: rgba(243, 156, 18, 0.5);
    --flow-border-5: rgba(155, 89, 182, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
	max-width: 100%;
	position: relative;
    min-height: 100vh;
    background: var(--dark-bg);
    color: var(--text-color);
    font-family: 'Roboto', 'Montserrat', sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

#main-content-wrapper {
    width: 100%;
    overflow: hidden; /* ✅ Impede QUALQUER conteúdo de vazar para os lados */
    position: relative;
    z-index: 1; /* Garante que fique abaixo das sidebars */
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ============================================= */
/* --- 2. LANDING PAGE --- */
/* ============================================= */

#landing-page {
    display: block;
}

.premium-header {
    background: linear-gradient(135deg, var(--background-medium), var(--dark-bg));
    padding: 5rem 2rem 9rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid rgba(var(--primary-rgb), 0.2);
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
    margin-bottom: 2rem;
    backdrop-filter: blur(8px);
}

.premium-header:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.05) 0%, transparent 60%);
    animation: subtlePulse 20s infinite ease-in-out;
}

@keyframes subtlePulse {
    0% { transform: scale(0.95); opacity: 0.1; }
    50% { transform: scale(1.05); opacity: 0.2; }
    100% { transform: scale(0.95); opacity: 0.1; }
}

/* REGRAS PARA O LOGO PRINCIPAL */
.logo {
    font-size: clamp(2.4rem, 6vw, 2.8rem);
    font-weight: 900;
    color: var(--light); /* What em branco (#FFFFFF) */
    margin-bottom: 1rem;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.logo span {
    color: var(--primary); /* Status em verde WhatsApp (#25D366) */
    position: relative;
    margin-left: 2px;
}

/* Efeito opcional de brilho no verde */
.logo span::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary);
    z-index: -1;
    filter: blur(3px);
    opacity: 0.3;
    border-radius: 3px;
}

.tagline {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    max-width: 700px;
    margin: 0 auto 2rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.cta-button.primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    margin-top: 2rem;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    color: var(--dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.cta-button.primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.3s ease;
}

.cta-button.primary:hover::after {
    left: 100%;
}

.cta-button.primary:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
}

.benefits {
    padding: 5rem 2rem;
    animation: fadeIn 0.8s ease-out;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: var(--light);
    margin-bottom: 1rem;
}

.section-title .primary-color {
    color: var(--primary);
}

.section-subtitle {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: var(--text-secondary);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.benefit-card {
    background: linear-gradient(145deg, var(--background-light), var(--background-medium));
    border-radius: 16px;
    padding: 2.5rem;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s ease;
    border: none;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.8s ease-out;
    backdrop-filter: blur(6px);
}

.benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.benefit-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.benefit-title {
    font-size: clamp(1.2rem, 3vw, 1.4rem);
    color: var(--light);
    margin-bottom: 1rem;
    font-weight: 700;
}

.login-section {
    padding: 5rem 2rem;
}

.login-card {
    background: linear-gradient(145deg, var(--background-light), var(--background-medium));
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: none;
    max-width: 500px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out;
    backdrop-filter: blur(6px);
}

.login-card h2 {
    color: var(--light);
    margin-top: 0;
    text-align: center;
    font-weight: 700;
}

.login-card p {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.footer {
    text-align: center;
    padding: 3rem 0;
    background: var(--dark-bg);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-disclaimer {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ============================================= */
/* --- 3. PAINEL DE CONTROLE (CSS CORRIGIDO) --- */
/* ============================================= */

#dashboard-section {
    display: none; /* O JS continua controlando a visibilidade */
    position: relative;
    padding: 2rem 2rem 50px 2rem; /* Adicionado um padding no topo e na base */
    
    /* --- As 4 linhas mágicas --- */
    height: 100vh; /* 1. Força a seção a ter exatamente a altura da tela */
    box-sizing: border-box; /* 2. Garante que o padding não quebre a altura */
    overflow-y: auto; /* 3. A MUDANÇA PRINCIPAL: Permite rolar para baixo */
    -webkit-overflow-scrolling: touch; /* 4. Deixa a rolagem suave no iPhone/iPad */
}

/* --- CORREÇÃO DEFINITIVA PARA A TELA PRETA --- */

/* Esta regra cria uma "lei": Se a seção #dashboard-section estiver
   escondida com display: none (o que nosso JS faz),
   então o #sidebar-overlay DENTRO dela DEVE ser escondido também,
   com prioridade máxima (!important).
*/
#dashboard-section[style*="display: none"] #sidebar-overlay {
    display: none !important;
    visibility: hidden !important;
}

/* --- VÍDEO DE FUNDO --- */
.vimeo-background-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;  /* Camada 0: O fundo de tudo */
    pointer-events: none;
    overflow: hidden;
}

.vimeo-background-container iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Adiciona um filtro escuro para o texto ser mais legível */
.vimeo-background-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

/* --- CAMADA DE CONTEÚDO PRINCIPAL --- */
/* Garante que todos os containers diretos fiquem na frente do vídeo */
#header-fixed-area,
#header-fixed-area-tabs,
#main-config-accordion,
#app-main-container {
    position: relative;
    z-index: 1; /* Camada 1: Na frente do vídeo */
    background-color: transparent; /* Deixa os containers transparentes */
}

/* --- ILHAS DE CONTEÚDO SÓLIDO --- */
/* Devolve a cor de fundo SÓLIDA para os painéis de conteúdo */
#main-config-accordion .accordion-content,
#app-main-container .card,
#piloto-container .card,
#sequencias-list-container,
#sequence-editor {
    background-color: var(--background-medium); /* Use a sua cor de fundo para cards */
    /* Este z-index garante que eles apareçam, mesmo dentro de um container transparente */
    position: relative; 
    z-index: 2; /* Camada 2: Na frente de tudo */
}

/* --- ESTILOS VISUAIS (Mantidos como estavam) --- */
#header-fixed-area {
    padding-top: 2rem;
}

#header-fixed-area h1 {
    font-size: clamp(2rem, 5vw, 2.4rem);
    text-align: center;
    color: var(--light);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

#header-fixed-area svg {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

#header-fixed-area svg:hover {
    transform: scale(1.1);
}

#header-fixed-area p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
}

#header-fixed-area-tabs {
    margin-bottom: 2rem;
}

.mode-control {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    justify-content: center;
}

.mode-btn {
    padding: 12px 24px;
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid transparent;
}

.mode-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.mode-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mode-section.active {
    display: block;
}

/* ============================================= */
/* --- 4. COMPONENTES GENÉRICOS (BOTÕES, INPUTS) --- */
/* ============================================= */

.button {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    color: #000000 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.3s ease;
}

.button:hover::after {
    left: 100%;
}

.button:hover:not(:disabled) {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.3);
}

.button:disabled {
    background: var(--background-medium);
    color: var(--text-secondary) !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.button.secondary {
    background: linear-gradient(90deg, var(--background-medium), var(--background-light));
    border: 1px solid var(--border-color);
    color: var(--text-color) !important;
}

.button.secondary:hover:not(:disabled) {
    background: var(--background-light);
    border-color: var(--primary);
    color: var(--primary) !important;
}

.button.danger {
    background: linear-gradient(90deg, var(--error-color), #C0392B);
    color: var(--light) !important;
}

.button.danger:hover:not(:disabled) {
    background: var(--error-color);
}

.button.success {
    background: linear-gradient(90deg, var(--success-color), #27AE60);
    color: var(--light) !important;
}

.button.success:hover:not(:disabled) {
    background: var(--success-color);
}

.button.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.button.btn-icon {
    padding: 8px;
}

.button i {
    font-size: 1.2rem;
    vertical-align: middle;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    background: var(--background-light);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.form-control:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.input-group {
    display: flex;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .button {
    border-radius: 0 8px 8px 0;
}

.required {
    color: var(--error-color);
    margin-left: 4px;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* ============================================= */
/* --- 5. SEÇÃO DE SEQUÊNCIAS --- */
/* ============================================= */

.sequence-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

#sequences-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

#sequences-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.period-accordion {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
    background: var(--background-medium);
}

.period-header {
    background: var(--background-light);
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.period-header:hover {
    background: linear-gradient(90deg, var(--background-light), var(--background-medium));
}

.period-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--light);
    font-weight: 600;
}

.period-count-badge {
    background: var(--primary);
    color: var(--dark);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.period-chevron {
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    color: var(--text-secondary);
}

.period-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding: 0 16px;
    background: var(--background-medium);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.23, 1, 0.32, 1), padding 0.3s ease;
}

.period-accordion.active .period-content {
    max-height: 2000px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.period-content.has-single-card {
    grid-template-columns: 1fr;
}

.sequence-card {
    background: linear-gradient(145deg, var(--background-light), var(--background-medium));
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary);
    border-radius: 10px;
    padding: 16px;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sequence-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.sequence-card h4 {
    margin: 0 0 8px 0;
    color: var(--light);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.sequence-card p {
    margin: 5px 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.sequence-card.status-running {
    border-left-color: var(--success-color);
}

.sequence-card.status-error {
    border-left-color: var(--error-color);
}

.sequence-card.status-ready {
    border-left-color: var(--secondary);
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.card-actions button {
    flex-grow: 1;
}

#sequence-editor {
    background: var(--background-medium);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sequence-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.sequence-post-item {
    background: var(--background-light);
    border-radius: 8px;
    padding: 16px;
    position: relative;
    border-left: 3px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sequence-post-item.drag-over {
    transform: scale(1.03);
    box-shadow: 0 0 25px rgba(var(--primary-rgb), 0.5);
}

.sequence-post-item.drag-over::before {
    content: 'Solte o arquivo aqui';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--primary-rgb), 0.85);
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    z-index: 10;
    pointer-events: none;
}

.post-number {
    position: absolute;
    top: -10px;
    left: -10px;
    background: var(--primary);
    color: var(--dark);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.drag-handle {
    position: absolute;
    top: 16px;
    right: 40px;
    cursor: grab;
    color: var(--text-secondary);
    opacity: 0.5;
}

.drag-handle:active {
    cursor: grabbing;
}

.weekday-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background-color: rgba(var(--dark-rgb), 0.5);
    padding: 1rem;
    border-radius: 8px;
}

.weekday-selector label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* ============================================= */
/* --- 6. MODAIS E TOASTS --- */
/* ============================================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: linear-gradient(135deg, rgba(var(--background-light-rgb, 44, 44, 44), 0.9), rgba(var(--background-medium-rgb, 26, 26, 26), 0.9));
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 12px;
    width: 700px;
    max-width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border: none;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.close-modal:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.sequence-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 1.5rem 0;
}

.sequence-info-grid > div {
    padding: 12px;
    background: var(--background-light);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.sequence-posts-modal {
    flex-grow: 1;
    overflow-y: auto;
    margin: 1.5rem 0;
    padding: 8px;
    background: var(--background-light);
    border-radius: 8px;
}

.modal-post-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-post-item:last-child {
    border-bottom: none;
}

.thumbnail-container {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: var(--background-medium);
    position: relative;
}
/* ======================================= */
/* --- ADIÇÃO PARA O ÍCONE DE PLAY (VÍDEO) --- */
/* ======================================= */

.thumbnail-container .play-icon {
    /* Tira o ícone do fluxo normal e o coloca "flutuando" sobre o container */
    position: absolute; 
    
    /* Centraliza o ícone perfeitamente no meio */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    /* Estilo visual do ícone */
    color: white;
    font-size: 24px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 5px black;
    pointer-events: none; /* Impede que o ícone seja clicável */
}

.post-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.text-thumbnail {
    padding: 10px;
    text-align: center;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================= */
/* --- 7. ACCORDIONS E DISPOSITIVOS --- */
/* ============================================= */

.accordion-item {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin: 12px 0;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.accordion-item.active {
    border-color: rgba(var(--primary-rgb), 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.accordion-header {
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--background-light);
    min-height: 56px;
    transition: background-color 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.accordion-header:hover {
    background: linear-gradient(90deg, var(--background-light), var(--background-medium));
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.23, 1, 0.32, 1), padding 0.3s ease;
    background: var(--background-medium);
}

.accordion-item.active .accordion-content {
    /* A linha max-height foi removida. O JavaScript controlará a altura. */
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.accordion-chevron {
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    margin-left: 10px;
    color: var(--text-secondary);
}

.accordion-item.active .accordion-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.device-accordion {
    background: var(--background-light);
}

.device-accordion.active {
    border-color: rgba(var(--secondary-rgb), 0.2);
}

.device-accordion .accordion-header:hover {
    background: linear-gradient(90deg, var(--background-light), var(--background-medium));
}

.device-accordion.active .accordion-chevron {
    color: var(--primary);
}

.device-management-section {
    position: relative;
    padding-bottom: 140px;
}

#devices-container {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
    margin-right: -8px;
    scrollbar-width: thin;
}

#devices-container::-webkit-scrollbar {
    width: 6px;
}

#devices-container::-webkit-scrollbar-thumb {
    background-color: rgba(var(--primary-rgb), 0.3);
    border-radius: 3px;
}

#devices-container::-webkit-scrollbar-track {
    background-color: rgba(var(--border-color-rgb), 0.1);
}

.device-management-actions {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--background-medium);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 16px;
    z-index: 1000;
    width: calc(100% - 48px);
    max-width: 800px;
    justify-content: space-between;
}

#add-device-button {
    background: var(--primary);
    color: var(--dark);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#add-device-button:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

#save-main-config-button {
    background: var(--secondary);
    color: var(--dark);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#save-main-config-button:hover {
    background: var(--light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--secondary-rgb), 0.3);
}

/* ============================================= */
/* --- 8. FEEDBACK E ESTADOS --- */
/* ============================================= */

.empty-message {
    text-align: center;
    padding: 2.5rem;
    color: var(--text-secondary);
    background: var(--background-medium);
    border-radius: 10px;
    border: 1px dashed var(--border-color);
    font-size: 1rem;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--background-medium);
    color: var(--text-color);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1), transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background: var(--success-color);
    color: var(--dark);
}

.toast.error {
    background: var(--error-color);
    color: var(--light);
}

.toast.info {
    background: var(--secondary);
    color: var(--dark);
}

.toast.warning {
    background: var(--warning-color);
    color: var(--dark);
}

/* ============================================= */
/* --- 9. FORMULÁRIOS E INPUTS AVANÇADOS --- */
/* ============================================= */

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.input-field {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: var(--background-light);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    width: 100%;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

input:focus,
select:focus,
textarea:focus,
.input-field:focus {
    border-color: var(--primary);
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    transform: translateY(-1px);
}

.input-label {
    position: absolute;
    top: -8px;
    left: 12px;
    background: var(--background-medium);
    padding: 0 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    z-index: 2;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2325D366'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

select:hover {
    border-color: var(--primary);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
    transition: opacity 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

input:focus::placeholder,
textarea:focus::placeholder {
    opacity: 0.4;
}

input:disabled,
select:disabled,
textarea:disabled {
    background: var(--background-medium);
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none !important;
}

.form-container {
    background: var(--background-medium);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================= */
/* --- 10. MEDIA QUERIES --- */
/* ============================================= */

@media (max-width: 767px) {
    .mode-control {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .sequence-list, .sequence-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95vw;
        padding: 16px;
    }
    
    .modal-post-item {
        flex-direction: column;
    }
    
    .device-management-actions {
        flex-direction: column;
        gap: 12px;
        width: calc(100% - 32px);
        padding: 12px;
    }
    
    .button {
        width: 100%;
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    .accordion-header {
        padding: 12px;
    }
    
    .sequence-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .mode-control {
        flex-wrap: wrap;
    }
    
    .sequence-posts {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 15px;
    }
    
    .sequence-post {
        flex-basis: calc(50% - 7.5px);
    }
    
    .sequence-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .modal-content {
        width: 80%;
        padding: 24px;
    }
    
    .sequence-info-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1025px) {
    .mode-control {
        flex-wrap: nowrap;
    }
    
    .sequence-posts {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 20px;
    }
    
    .sequence-post {
        flex-basis: calc(33.33% - 13.33px);
    }
    
    .sequence-list {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 24px;
    }
    
    .modal-content {
        width: 700px;
        padding: 32px;
    }
    
    .sequence-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    .accordion-item,
    .accordion-content,
    .accordion-chevron,
    #add-device-button,
    #save-main-config-button,
    .button,
    .sequence-card,
    .toast {
        transition: none !important;
    }
    
    .premium-header:before {
        animation: none !important;
    }
}


/* ============================================= */
/* --- ESTILO DO CONTAINER PRINCIPAL ----------- */
/* ============================================= */
.time-picker-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #181818;
    padding: 1rem;
    border-radius: 12px;
    max-width: 200px;
    margin: 0 auto;
    border: 1px solid #333;
}

/* ============================================= */
/* --- COLUNAS DE HORA E MINUTO ---------------- */
/* ============================================= */
.time-picker-column {
    flex: 1;
    text-align: center;
}

/* ============================================= */
/* --- ÁREA DO "WHEEL" (ROLAGEM) --------------- */
/* ============================================= */
.picker-wheel {
    height: 120px;
    position: relative;
    overflow: hidden;
    cursor: grab;
    touch-action: none; /* Impede rolagem da página no mobile */
}

.picker-wheel:active {
    cursor: grabbing;
}

.picker-wheel::after {
    content: '';
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(var(--primary-rgb), 0.1);
    border-top: 1px solid rgba(var(--primary-rgb), 0.4);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.4);
    pointer-events: none;
    z-index: 1;
}

/* ============================================= */
/* --- LISTA DE OPÇÕES ROLÁVEIS ---------------- */
/* ============================================= */
.wheel-options {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-top: 40px;
    padding-bottom: 40px;
    transition: transform 0.2s ease-out;
    touch-action: none; /* Ref refina ainda mais o bloqueio do scroll */
}

.wheel-options li {
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
    transition: color 0.2s;
}

/* ============================================= */
/* --- SEPARADOR DOS DOIS WHEELS --------------- */
/* ============================================= */
.time-picker-separator {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0 5px;
}

/* ============================================= */
/* --- ITEM SELECIONADO ------------------------ */
/* ============================================= */
.wheel-options li.is-selected {
    color: var(--light);
    transform: scale(1.1);
    font-weight: 700;
}





/* ===== BLOCO DE NOTAS ===== */
#notes-sidebar {
    position: fixed;
    top: 60px;
    right: 0;
    width: 280px;
    height: calc(100vh - 60px);
    background: var(--background-light);
    border-left: 1px solid var(--border-color);
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 100;
}

#notes-sidebar.expanded {
    transform: translateX(0);
}

#notes-handle {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white; /* Alterei para combinar com o queue-handle */
    padding: 10px 5px; /* Reduzi o padding horizontal para melhor encaixe vertical */
    border-radius: 5px 0 0 5px;
    cursor: pointer;
    display: flex;
    flex-direction: column; /* Muda a direção dos itens internos para vertical */
    align-items: center;
    gap: 5px; /* Reduzi o gap para melhor espaçamento vertical */
    font-size: 0.8rem; /* Ajustei o tamanho da fonte para caber melhor verticalmente */
    font-weight: 600;
    writing-mode: vertical-rl; /* Define a escrita vertical da direita para a esquerda */
    text-orientation: mixed; /* Mantém a orientação dos caracteres corrigida */
}

#notes-handle:hover {
    background: var(--primary-light);
}

#notes-content {
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#notes-textarea {
    flex-grow: 1;
    resize: none;
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-color);
    margin-bottom: 10px;
}

.notes-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#notes-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Ajuste do container principal */
.container {
    position: relative;
    padding-right: 40px; /* Espaço para o handle */
    transition: padding-right 0.3s ease;
}

#notes-sidebar.expanded ~ .container {
    padding-right: 320px; /* Largura do sidebar + handle */
}

.notes-sections-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.notes-section {
    display: flex;
    flex-direction: column;
    min-height: 100px;
}

.notes-section label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
    opacity: 0.8;
}

.notes-section textarea {
    flex-grow: 1;
    width: 100%;
    resize: none;
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-color);
    box-sizing: border-box;
}

/* Remove a estilização antiga para a textarea única */
#notes-textarea {
    display: none;
}

/* Estilização para as seções de notas */
.notes-section textarea {
    border-left: 4px solid var(--border-color);
    transition: border-color 0.2s ease;
}

#notes-area-1 {
    border-left-color: #3498db;
}

#notes-area-2 {
    border-left-color: #f1c40f;
}

#notes-area-3 {
    border-left-color: #2ecc71;
}

#notes-area-4 {
    border-left-color: #95a5a6;
}

.notes-section textarea:focus {
    border-color: var(--primary);
}

/* ============================================= */
/* --- ESTILOS UNIFICADOS PARA BARRAS LATERAIS --- */
/* ============================================= */

/* --- 1. Overlay (Fundo Escuro) --- */
#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Um pouco mais escuro para melhor contraste */
    z-index: 999; 
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
#sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* --- 2. Estilo Base Comum para AMBAS as Barras --- */
#queue-sidebar, 
#notes-sidebar {
    position: fixed;
    top: 0;
    width: 320px; /* Tamanho padronizado */
    max-width: 90vw; /* Garante que não ocupe a tela toda em celulares */
    height: 100%;
    background: var(--background-light);
    box-shadow: 0 0 25px rgba(0,0,0,0.3);
    z-index: 1000; /* Ficam por cima de tudo */
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1); /* Animação mais suave */
    display: flex; /* Garante que o display seja flexível */
    flex-direction: column;
}

/* --- 3. Posições e Animações Específicas --- */
/* Barra da Fila (Esquerda) */
#queue-sidebar {
    left: 0;
    border-right: 1px solid var(--border-color);
    transform: translateX(-100%);
}
#queue-sidebar.expanded {
    transform: translateX(0);
}

/* Barra de Notas (Direita) */
#notes-sidebar {
    right: 0;
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
}
#notes-sidebar.expanded {
    transform: translateX(0);
}

/* --- 4. Estilo Comum para os "Puxadores" (Handles) --- */
#queue-handle,
#notes-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    padding: 15px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 1px;
    transition: background-color 0.2s;
}
#queue-handle:hover,
#notes-handle:hover {
    background: var(--primary-dark);
}

/* Posições Específicas dos Puxadores */
#queue-handle {
    right: -45px; /* Alinhado para fora */
    border-radius: 0 8px 8px 0;
}
#notes-handle {
    left: -45px; /* Alinhado para fora */
    border-radius: 8px 0 0 8px;
}

/* --- 5. Estilo Comum para o Conteúdo Interno --- */
#queue-content,
#notes-content {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

/* ======================================== */
/* --- ESTILOS PARA OS CARDS DA FILA --- */
/* ======================================== */

#queue-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.queue-post-card {
    display: flex;
    gap: 15px;
    align-items: center;
    background: var(--background-medium);
    padding: 12px;
    border-radius: 10px;
}

.queue-post-thumbnail {
    width: 55px;
    height: 55px;
    border-radius: 50%; /* Garante que seja um círculo */
    background-color: var(--background-light); /* Cor de fundo enquanto a imagem carrega */
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    
    /* --- CORREÇÕES CRÍTICAS --- */
    position: relative; /* ESSENCIAL: Torna-se a referência de posição para a bolha */
    overflow: hidden;   /* ESSENCIAL: Corta a imagem para caber perfeitamente no círculo */
}

/* 2. A Imagem DENTRO da thumbnail */
.queue-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Garante que a imagem preencha o círculo sem distorcer */
}

.queue-post-thumbnail .text-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%; /* Garante que a imagem/ícone também seja circular */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

/* 3. A "Bolha" do dispositivo */
.device-indicator-bubble {
    /* --- CORREÇÕES CRÍTICAS DE POSICIONAMENTO --- */
    position: absolute; /* Posiciona a bolha EM RELAÇÃO à thumbnail */
    bottom: -2px;       /* Posição no aro (ajuste fino) */
    right: -2px;        /* Posição no aro (ajuste fino) */
    z-index: 5;         /* Garante que a bolha fique POR CIMA da imagem */

    /* Seus estilos visuais (que já estavam bons) */
    width: 22px;
    height: 22px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border: 2px solid var(--background-light);
    cursor: help;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.queue-post-details {
    min-width: 0; /* Permite que o texto quebre corretamente */
}

.queue-post-details .post-caption {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ============================================= */
/* --- ESTILOS PARA A SECÇÃO DE PLANOS (STRIPE) --- */
/* ============================================= */

.pricing-section {
    padding: 4rem 1rem;
    background-color: var(--background-dark);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.plan-card {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.plan-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.2);
}

.plan-card.recommended {
    border-color: var(--primary);
    box-shadow: 0 0 25px rgba(var(--primary-rgb), 0.3);
}

.plan-badge {
    position: absolute;
    top: 15px;
    right: -40px;
    background-color: var(--primary);
    color: white;
    padding: 5px 40px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    transform: rotate(45deg);
}

.plan-header {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.plan-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    margin: 0;
}

.plan-period {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    flex-grow: 1;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.plan-features li .fa-check-circle {
    color: var(--primary);
}

.plan-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
}

/* ============================================= */
/* --- ESTILOS PARA A SEÇÃO PILOTO AUTOMÁTICO --- */
/* ============================================= */

/* Estilização dos cards de fluxo */
#piloto-section .streams-list .accordion-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Suporte para Safari */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Aplicar cores diferentes para cada fluxo com base no índice */
#piloto-section .streams-list .accordion-item:nth-child(5n+1) {
    background: rgba(0, 196, 180, 0.2); /* Ciano com transparência */
    border-left: 4px solid var(--flow-color-1);
}

#piloto-section .streams-list .accordion-item:nth-child(5n+2) {
    background: rgba(255, 107, 107, 0.2); /* Coral com transparência */
    border-left: 4px solid var(--flow-color-2);
}

#piloto-section .streams-list .accordion-item:nth-child(5n+3) {
    background: rgba(75, 123, 255, 0.2); /* Azul com transparência */
    border-left: 4px solid var(--flow-color-3);
}

#piloto-section .streams-list .accordion-item:nth-child(5n+4) {
    background: rgba(243, 156, 18, 0.2); /* Laranja com transparência */
    border-left: 4px solid var(--flow-color-4);
}

#piloto-section .streams-list .accordion-item:nth-child(5n+5) {
    background: rgba(155, 89, 182, 0.2); /* Roxo com transparência */
    border-left: 4px solid var(--flow-color-5);
}

/* Classes dinâmicas para fluxos (opcional, se usado com JavaScript) */
#piloto-section .streams-list .accordion-item.flow-color-1 {
    background: rgba(0, 196, 180, 0.2);
    border-left: 4px solid var(--flow-color-1);
}

#piloto-section .streams-list .accordion-item.flow-color-2 {
    background: rgba(255, 107, 107, 0.2);
    border-left: 4px solid var(--flow-color-2);
}

#piloto-section .streams-list .accordion-item.flow-color-3 {
    background: rgba(75, 123, 255, 0.2);
    border-left: 4px solid var(--flow-color-3);
}

#piloto-section .streams-list .accordion-item.flow-color-4 {
    background: rgba(243, 156, 18, 0.2);
    border-left: 4px solid var(--flow-color-4);
}

#piloto-section .streams-list .accordion-item.flow-color-5 {
    background: rgba(155, 89, 182, 0.2);
    border-left: 4px solid var(--flow-color-5);
}

/* Efeito de hover para destacar o fluxo */
#piloto-section .streams-list .accordion-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* Estilizar o cabeçalho do fluxo */
#piloto-section .streams-list .accordion-header {
    background: transparent;
    padding: 16px 20px;
}

/* Estilizar o badge do tipo de fluxo */
#piloto-section .streams-list .badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--light);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#piloto-section .streams-list .badge[data-flow-type="aleatorio"] {
    background: rgba(255, 255, 255, 0.2);
}

#piloto-section .streams-list .badge[data-flow-type="sequencial"] {
    background: rgba(var(--primary-rgb), 0.3);
}

#piloto-section .streams-list .flow-main-info h4 {
    color: var(--light);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

#piloto-section .streams-list .flow-main-info .summary-item {
    color: var(--light);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    
    display: inline-flex;
    align-items: center;
    gap: 6px; 
}

/* Ajustar botão de exclusão para combinar com o tema */
#piloto-section .streams-list .btn-remove-stream {
    background: linear-gradient(90deg, var(--error-color), #C0392B);
    color: var(--light);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#piloto-section .streams-list .btn-remove-stream:hover {
    background: var(--error-color);
}

/* Botão de adicionar fluxo */
#btn-add-stream {
    background: linear-gradient(90deg, var(--primary-dark), var(--flow-color-1));
    color: var(--dark);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#btn-add-stream:hover {
    background: var(--flow-color-1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 196, 180, 0.4);
}

#btn-add-stream::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.3s ease;
}

#btn-add-stream:hover::after {
    left: 100%;
}

/* Estilizar o card de status do piloto */
.piloto-status-card {
    background: rgba(var(--primary-rgb), 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#piloto-status-indicator {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#piloto-status-indicator.active {
    background: rgba(var(--primary-rgb), 0.3);
    color: var(--light);
}

#piloto-status-indicator.inactive {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

/* --- ESTILOS PARA FLUXO PAUSADO --- */
.accordion-item.stream-paused {
    opacity: 0.7;
    border-left: 4px solid var(--warning); /* Usando uma cor de aviso */
    background-image: linear-gradient(45deg, rgba(0,0,0,0.02) 25%, transparent 25%, transparent 50%, rgba(0,0,0,0.02) 50%, rgba(0,0,0,0.02) 75%, transparent 75%, transparent);
    background-size: 40px 40px;
}

.accordion-item.stream-paused .accordion-header {
    background-color: transparent;
}


/* ============================================= */
/* --- ANIMAÇÃO PARA FLUXOS EM EXECUÇÃO --- */
/* ============================================= */

/* Animação que move o background para a direita */
@keyframes move-arrows {
    from {
        background-position: 0 0;
    }
    to {
        /* Move o background exatamente a largura de um padrão */
        background-position: 56px 0;
    }
}

/* Aplica o estilo ao header do accordion quando o fluxo está em execução */
.accordion-item.stream-running .accordion-header {
    position: relative; /* Necessário para o pseudo-elemento */
    overflow: hidden;   /* Garante que a animação não vaze para fora */
}

/* Cria a camada da animação sobre o header */
.accordion-item.stream-running .accordion-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* O gradiente que cria o efeito de "setas" >>> */
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.08),
        rgba(255, 255, 255, 0.08) 15px, /* Largura da parte visível da "seta" */
        transparent 15px,
        transparent 28px  /* Espaçamento entre as "setas" */
    );
    
    /* Define o tamanho do padrão do background */
    background-size: 56px 56px; 

    /* Aplica a animação */
    animation: move-arrows 1s linear infinite;
    
    /* Garante que o texto fique legível */
    z-index: 0;
    opacity: 0.5;
}

/* Garante que o conteúdo do header fique por cima da animação */
.accordion-item.stream-running .accordion-header > * {
    position: relative;
    z-index: 1;
}

/* Assuming .logo is styled in your existing CSS */
.logo {
    position: relative; /* Required for positioning the pseudo-element */
    display: inline-block; /* Ensure the element sizes to its content */
    font-size: 2rem; /* Adjust as needed based on your design */
    font-weight: 700; /* Example styling */
    color: var(--primary); /* Use your theme's primary color */
}

.logo::after {
    content: '>>>>'; /* The arrows to display */
    position: absolute;
    right: -60px; /* Start position, adjust based on spacing */
    top: 50%;
    transform: translateY(-50%); /* Center vertically */
    color: var(--primary); /* Match logo color or adjust */
    font-size: 1.2rem; /* Size of the arrows */
    animation: moveArrows 1.5s linear infinite; /* Animation for moving arrows */
}

@keyframes moveArrows {
    0% {
        right: -60px; /* Start position (outside the logo) */
        opacity: 1;
    }
    50% {
        right: -100px; /* Move further right */
        opacity: 0.5; /* Fade slightly for effect */
    }
    100% {
        right: -140px; /* End position */
        opacity: 0; /* Fade out completely */
    }
}

.section-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.section-top-bar .section-header {
    flex-grow: 1;
    margin-bottom: 0;
}

.section-top-bar .sequence-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Estilos para o drag and drop */
.streams-list {
    min-height: 100px;
}

.drag-handle {
    cursor: move;
    padding: 8px;
    margin-right: 8px;
    color: var(--text-secondary);
}

.drag-handle:hover {
    color: var(--primary-color);
}

.sortable-ghost {
    opacity: 0.5;
    background: rgba(200, 235, 251, 0.5);
    border: 2px dashed var(--primary-color);
}

.sortable-chosen {
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.sortable-drag {
    opacity: 1 !important;
    transform: rotate(2deg);
}




/* --- Estilos para o Indicador de Status do Fluxo --- */

/* 1. Estilo para alinhar o círculo e o título */
.flow-main-info {
    display: flex;
    align-items: center;
}

/* 2. Cria o formato do círculo */
.flow-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%; /* A mágica do círculo */
    background-color: #555; /* Cor padrão (cinza) */
    flex-shrink: 0; /* Impede que o círculo seja esmagado */
    margin-right: 10px; /* Espaço entre o círculo e o nome do fluxo */
    transition: background-color 0.3s ease;
}

/* 3. Define a cor VERDE para o status ATIVO */
.flow-status-indicator.status-active {
    background-color: var(--success-color); 
    box-shadow: 0 0 8px var(--success-color); /* Efeito de brilho opcional */
}

/* 4. Define a cor AMARELA para o status PAUSADO */
.flow-status-indicator.status-paused {
    background-color: var(--warning-color); 
    box-shadow: 0 0 8px var(--warning-color); /* Efeito de brilho opcional */
}

.offer-post-content.form-control {
    width: 100%;
    resize: vertical;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
}
.offer-post-feedback {
    margin-top: 5px;
}
.form-hint {
    margin-top: 5px;
    color: gray;
    font-size: 0.9em;
}

/* ====================================================== */
/* SUBSTITUA SEU .header-top-bar POR ISTO: */
.header-top-bar {
  position: relative; /* Define este como o contêiner de referência */
  display: flex;
  justify-content: center; /* FORÇA o item principal (logo) a ficar no centro */
  align-items: center;
  width: 100%;
  margin-bottom: 2rem;
}

/* SUBSTITUA SEU .login-link POR ISTO: */
.login-link {
  position: absolute; /* "Solta" o link do layout normal */
  right: 20px;        /* Prende ele a 20px da borda direita */
  top: 50%;
  transform: translateY(-50%); /* Alinha verticalmente de forma perfeita */

  /* Seus estilos de aparência foram mantidos: */
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.login-prompt {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}
.login-prompt a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

/* Estilo para o "escudo" do free trial */
#trial-overlay {
  display: none; /* Começa escondido por padrão */
  position: absolute; /* Posição relativa ao dashboard */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.05); /* Levemente escuro para dar feedback, ou use 'transparent' */
  z-index: 999; /* Garante que ele fique ACIMA do conteúdo do dashboard */
  cursor: pointer; /* Mostra que é clicável */
}

/* ====================================================== */
/* CSS FINAL E COMPLETO PARA AS TELAS DE AUTENTICAÇÃO     */
/* ====================================================== */

/* 1. O contêiner principal (como já tínhamos) */
#auth-section {
  position: relative;
  min-height: 550px; /* Garante que o contêiner tenha altura */
  background-color: #f0f2f5; /* ✅ ADIÇÃO: Fundo claro para evitar "tela preta" se o conteúdo demorar a aparecer */
  padding: 20px; /* Adiciona espaçamento para melhor layout */
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 2. REGRA PARA O ESTADO PADRÃO (ESCONDIDO) PARA TODAS AS TELAS */
/* Esta parte você já tem e está correta */
#login-view,
#signup-view,
#reset-password-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0; /* Começam transparentes */
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

/* 3. REGRA PARA O ESTADO ATIVO (VISÍVEL) - ESTA É A PARTE CRUCIAL */
/* Esta regra diz ao formulário com a classe .active-view para aparecer */
#login-view.active-view,
#signup-view.active-view,
#reset-password-view.active-view {
  position: relative; 
  opacity: 1; /* Fica 100% visível */
  pointer-events: auto; /* Torna-se clicável */
  z-index: 1; /* ✅ ADIÇÃO: Garante que a view ativa fique acima das outras */
}

/* ====================================================== */
/* CORREÇÃO DEFINITIVA E COMPLETA PARA O RECAPTCHA        */
/* ====================================================== */

/* Regra 1: Força o contêiner "mãe" a se comportar */
/* Muitas vezes, o Google cria esta div para envolver o selo */
div.grecaptcha-badge-container {
  background: none !important;
  box-shadow: none !important;
  
  /* MUITO IMPORTANTE: Permite que seus cliques "atravessem" esta camada */
  pointer-events: none !important; 
}

/* Regra 2: Força o selo em si a ficar no lugar certo */
.grecaptcha-badge {
  /* Garante que o selo fique fixo no canto da tela */
  position: fixed !important;
  bottom: 15px !important;
  right: 15px !important;
  
  /* Garante que ele fique acima de outros elementos */
  z-index: 999 !important; 
  
  /* ====================================================== */
  /* ✅ CORREÇÃO APLICADA AQUI */
  /* Removemos o '!important' e definimos o estado PADRÃO como escondido. */
  /* ====================================================== */
  visibility: hidden; 
  
  /* Estilos opcionais para melhorar a aparência (mantidos) */
  box-shadow: 0 0 10px rgba(0,0,0,0.2) !important;
  transition: none !important; /* Desabilita animações que podem bugar */
}

/* ====================================================== */
/* ADIÇÕES PARA O EDITOR DE SEQUÊNCIA E DASHBOARD         */
/* ====================================================== */

/* ✅ ADIÇÃO: Fundo claro para o editor de sequência, evitando tela preta */
#sequence-editor {
  background-color: #ffffff; /* Branco ou sua cor de fundo padrão */
  padding: 20px;
  border-radius: 8px; /* Opcional: Para melhor visual */
  box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Opcional: Sombra leve */
}

/* ✅ ADIÇÃO: Fundo claro para a lista de sequências */
#sequences-list-container {
  background-color: transparent;
  padding: 20px;
}

/* ✅ ADIÇÃO: Fallback para o background de vídeo (se demorar a carregar, evita preto) */
.vimeo-background-container {
  background-color: #000000; /* Preto como fallback, mas se for o problema, mude para uma imagem ou cor sólida */
  background-image: url('fallback-background.jpg'); /* Opcional: Adicione uma imagem fallback se tiver */
  background-size: cover;
}

/* ✅ ADIÇÃO: Garanta que o dashboard tenha fundo se o vídeo falhar */
#dashboard-section {
  position: relative;
  background-color: #000000; /* Fundo preto como fallback para o vídeo */
  min-height: 100vh; /* Garante altura total */
}

.delete-queue-post-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
  margin-left: auto; /* Empurra o botão para a direita */
  transition: color 0.2s;
}
.delete-queue-post-btn:hover {
  color: var(--error-color);
}


.caption-wrapper {
    position: relative;
    display: flex;
    align-items: center;
  }
  
  .caption-wrapper textarea {
    width: 100%;
    padding-right: 40px; /* Cria espaço para o botão */
  }
  
  .emoji-picker-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem; /* Tamanho do emoji */
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
  }
  
  .emoji-picker-btn:hover {
    opacity: 1;
  }

  .emoji-picker__wrapper {
    /* Um z-index alto garante que ele flutue acima de quase tudo */
    z-index: 1100 !important; 
  }
  /* ============================================= */
/* --- ESTILOS DO BOTÃO ROI E BARRA DE USUÁRIO --- */
/* ============================================= */

.user-welcome-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: -10px;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    flex-wrap: wrap;
}

/* Estilo específico do botão ROI */
.button.btn-roi {
    background: linear-gradient(90deg, #3b82f6, #2563eb); /* Azul profissional diferente do verde do Zap */
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    text-decoration: none; /* Remove sublinhado do link */
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.button.btn-roi:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.5);
}

.button.btn-roi i {
    font-size: 1.1em;
}