/* Indicator Editor Styles - BetaBot TV */

/* ========================================
   BOTÃO DE INDICADORES NO HEADER
   ======================================== */
.header-indicator-btn {
    position: fixed;
    top: 6px;
    right: 260px;
    z-index: 9999;
    height: 28px;
    padding: 0 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(156, 39, 176, 0.1));
    transition: all 0.2s;
    font-family: 'Trebuchet MS', -apple-system, sans-serif;
    color: #00d4ff;
    font-size: 12px;
    font-weight: 600;
}

.header-indicator-btn:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(156, 39, 176, 0.25));
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.header-indicator-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.header-indicator-btn span {
    font-size: 14px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .header-indicator-btn {
        top: 50px;
        right: 110px;
        height: 36px;
        padding: 0 14px;
        background: rgba(0, 212, 255, 0.2);
        border-radius: 18px;
    }
}

/* ========================================
   MODAL DE INDICADORES
   ======================================== */
.indicator-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.indicator-modal.open {
    opacity: 1;
    visibility: visible;
}

.indicator-modal-content {
    background: linear-gradient(145deg, rgba(25, 28, 38, 0.98), rgba(15, 17, 24, 0.98));
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(0, 212, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

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

.indicator-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.05), rgba(156, 39, 176, 0.05));
}

.indicator-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Segoe UI', sans-serif;
}

.indicator-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.indicator-modal-close:hover {
    background: rgba(255, 77, 77, 0.2);
    color: #ff5252;
    transform: rotate(90deg);
}

/* ========================================
   TABS
   ======================================== */
.indicator-tabs {
    display: flex;
    gap: 5px;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Segoe UI', sans-serif;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(156, 39, 176, 0.15));
    color: #00d4ff;
}

.indicator-tab-content {
    padding: 20px 25px;
    max-height: calc(85vh - 200px);
    overflow-y: auto;
}

.indicator-tab-content.hidden {
    display: none;
}

/* Custom scrollbar */
.indicator-tab-content::-webkit-scrollbar {
    width: 6px;
}

.indicator-tab-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.indicator-tab-content::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 3px;
}

/* ========================================
   CATEGORIAS
   ======================================== */
.indicator-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: #888;
    font-size: 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-btn:hover {
    border-color: rgba(0, 212, 255, 0.3);
    color: #ccc;
}

.category-btn.active {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.4);
    color: #00d4ff;
}

/* ========================================
   GRID DE INDICADORES
   ======================================== */
.indicator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.indicator-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    backdrop-filter: blur(5px);
}

.indicator-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 212, 255, 0.1);
}

.indicator-icon {
    font-size: 28px;
}

.indicator-info h3 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.indicator-info p {
    margin: 0;
    font-size: 11px;
    color: #888;
}

.indicator-add-btn {
    padding: 10px;
    border: none;
    background: linear-gradient(135deg, #00d4ff, #9c27b0);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: auto;
}

.indicator-add-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

/* ========================================
   INDICADORES ATIVOS
   ======================================== */
.active-indicators-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 40px;
    font-size: 14px;
}

.active-indicator-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.2s;
}

.active-indicator-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.active-indicator-item .indicator-icon {
    font-size: 24px;
}

.indicator-details {
    flex: 1;
}

.indicator-details strong {
    display: block;
    color: #fff;
    font-size: 14px;
    margin-bottom: 2px;
}

.indicator-details small {
    color: #888;
    font-size: 11px;
}

.indicator-remove-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 77, 77, 0.1);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.indicator-remove-btn:hover {
    background: rgba(255, 77, 77, 0.25);
    transform: scale(1.1);
}

/* ========================================
   EDITOR AVANÇADO
   ======================================== */
.advanced-editor {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.advanced-info {
    padding: 15px;
    background: rgba(0, 212, 255, 0.05);
    border-left: 3px solid #00d4ff;
    border-radius: 0 8px 8px 0;
    color: #aaa;
    font-size: 13px;
    line-height: 1.5;
}

.advanced-info strong {
    color: #fff;
}

#custom-indicator-code {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #00ff88;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.6;
    resize: vertical;
}

#custom-indicator-code:focus {
    outline: none;
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

#custom-indicator-code::placeholder {
    color: #555;
}

.advanced-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ========================================
   BOTÕES GERAIS
   ======================================== */
.btn-primary {
    padding: 12px 24px;
    border: none;
    background: linear-gradient(135deg, #00d4ff, #9c27b0);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    padding: 12px 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #aaa;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* ========================================
   MODAL DE PARÂMETROS
   ======================================== */
.params-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.params-modal-content {
    background: linear-gradient(145deg, rgba(30, 33, 45, 0.98), rgba(20, 22, 30, 0.98));
    border-radius: 16px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.params-modal-content h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #fff;
}

.params-modal-content>p {
    margin: 0 0 20px 0;
    font-size: 13px;
    color: #888;
}

#params-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.param-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.param-row label {
    font-size: 13px;
    color: #ccc;
}

.param-row input[type="number"] {
    width: 100px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    text-align: center;
}

.param-row input[type="number"]:focus {
    outline: none;
    border-color: #00d4ff;
}

.param-row input[type="color"] {
    width: 50px;
    height: 35px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

.params-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ========================================
   TEMA CLARO
   ======================================== */
body.light-theme .indicator-modal-content {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 250, 0.98));
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .indicator-modal-header h2 {
    color: #1a1a1a;
}

body.light-theme .tab-btn {
    color: #666;
}

body.light-theme .tab-btn.active {
    color: #0066cc;
}

body.light-theme .indicator-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .indicator-info h3 {
    color: #1a1a1a;
}

body.light-theme .params-modal-content {
    background: linear-gradient(145deg, #fff, #f5f7fa);
}

body.light-theme #custom-indicator-code {
    background: rgba(0, 0, 0, 0.05);
    color: #006600;
}

/* ========================================
   RESPONSIVO MOBILE
   ======================================== */
@media (max-width: 768px) {
    .indicator-modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 16px;
    }

    .indicator-modal-header {
        padding: 15px 20px;
    }

    .indicator-modal-header h2 {
        font-size: 16px;
    }

    .indicator-tabs {
        padding: 10px 15px;
        overflow-x: auto;
    }

    .tab-btn {
        padding: 8px 14px;
        font-size: 12px;
        white-space: nowrap;
    }

    .indicator-tab-content {
        padding: 15px;
    }

    .indicator-grid {
        grid-template-columns: 1fr;
    }

    .advanced-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}