/* ============================================================
   ESTILOS GLOBAIS
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: #0d0d0d;
    color: #d2d2d2;
    font-family: 'Segoe UI', sans-serif;
    padding: 20px;
    min-height: 100vh;
}
.container { max-width: 1200px; margin: 0 auto; }

.header {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    padding: 20px 24px;
    border-radius: 12px;
    border-bottom: 3px solid #ffab00;
    margin-bottom: 20px;
}
.header h1 {
    color: #ffab00;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.header .sub {
    color: #8888aa;
    font-size: 14px;
    margin-top: 4px;
}

.stats {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.stats span { color: #8888aa; font-size: 14px; }
.stats strong { color: #ffab00; }

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.panel {
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    max-height: 600px;
}
.panel h3 {
    color: #ffab00;
    font-size: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.panel h3 .count {
    font-size: 12px;
    color: #8888aa;
    font-weight: 300;
}

.panel-search {
    position: relative;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.panel-search input {
    width: 100%;
    padding: 8px 36px 8px 36px;
    border-radius: 6px;
    border: 1px solid #2a2a4e;
    background: rgba(255,255,255,0.05);
    color: #d2d2d2;
    font-size: 13px;
}
.panel-search input:focus {
    outline: none;
    border-color: #ffab00;
}
.panel-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    font-size: 14px;
}
.panel-search .clear-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #ff6b6b;
    cursor: pointer;
    font-size: 14px;
    display: none;
}
.panel-search .clear-icon.visible {
    display: block;
}

.panel-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}
.panel-list::-webkit-scrollbar {
    width: 4px;
}
.panel-list::-webkit-scrollbar-thumb {
    background: #2a2a4e;
    border-radius: 4px;
}

.list-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
}
.list-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,171,0,0.15);
}
.list-item.active {
    background: rgba(255,171,0,0.12);
    border-color: #ffab00;
}
.list-item .name {
    font-size: 14px;
    word-break: break-word;
}
.list-item .check {
    color: #68d391;
    font-size: 14px;
}

.loading-more {
    text-align: center;
    padding: 10px;
    color: #8888aa;
    font-size: 13px;
}
.loading-more .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top: 2px solid #ffab00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 6px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 30px 10px;
    color: #8888aa;
}
.empty-state i { font-size: 28px; opacity: 0.3; display: block; margin-bottom: 8px; }

.params-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}
.params-container::-webkit-scrollbar {
    width: 4px;
}
.params-container::-webkit-scrollbar-thumb {
    background: #2a2a4e;
    border-radius: 4px;
}

.param-item {
    background: rgba(255,255,255,0.03);
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    border: 1px solid rgba(255,255,255,0.05);
    max-width: 100%;
    overflow: hidden;
}
.param-item label {
    font-size: 11px;
    color: #8888aa;
    text-transform: uppercase;
    font-weight: 600;
    display: block;
    margin-bottom: 3px;
}
.param-item .input-wrapper {
    display: flex;
    gap: 6px;
    max-width: 100%;
    flex-wrap: wrap;
}
.param-item input {
    flex: 1;
    min-width: 0;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #2a2a4e;
    background: rgba(255,255,255,0.05);
    color: #d2d2d2;
    font-size: 13px;
    max-width: 100%;
}
.param-item input:focus {
    outline: none;
    border-color: #ffab00;
}
.param-item .btn-aplicar {
    padding: 5px 12px;
    background: #ffab00;
    color: #0d0d0d;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
}
.param-item .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    max-width: 100%;
}
.param-item .tags .tag {
    padding: 2px 8px;
    background: rgba(255,171,0,0.1);
    color: #ffab00;
    border-radius: 10px;
    font-size: 10px;
    cursor: pointer;
    border: 1px solid rgba(255,171,0,0.1);
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
    display: inline-block;
}
.param-item .tags .tag:hover {
    background: rgba(255,171,0,0.25);
}
.param-item .valor-aplicado {
    font-size: 11px;
    color: #68d391;
    margin-top: 3px;
    display: none;
}
.param-item .valor-aplicado.ativo {
    display: block;
}
.param-item .valor-aplicado .remove {
    color: #ff6b6b;
    cursor: pointer;
    margin-left: 6px;
}

.url-result {
    background: #0d0d0d;
    border: 2px solid #ffab00;
    border-radius: 10px;
    padding: 16px;
    margin-top: 10px;
    display: none;
    flex-shrink: 0;
    max-width: 100%;
    overflow-x: auto;
}
.url-result.visible { display: block; }
.url-result .url-text {
    color: #68d391;
    font-family: monospace;
    font-size: 13px;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    hyphens: auto;
    padding: 10px 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
}
.url-result .actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.url-result .actions .btn {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-success { background: #106738; color: #0ff0d8; }
.btn-success:hover { background: #00a844; }
.btn-secondary { background: rgba(255,255,255,0.08); color: #d2d2d2; }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }

.footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #2a2a4e;
    text-align: center;
    color: #8888aa;
    font-size: 12px;
}

@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    .panel {
        min-height: 300px;
        max-height: 400px;
    }
    .url-text { max-height: 150px; font-size: 12px; }
    .url-result { padding: 12px; }
    .url-result .actions { flex-direction: column; }
    .url-result .actions .btn { width: 100%; justify-content: center; }
}
@media (max-width: 600px) {
    .param-item .input-wrapper {
        flex-direction: column;
    }
    .param-item .tags .tag {
        font-size: 9px;
        padding: 2px 6px;
        max-width: 100%;
        word-break: break-all;
    }
    .param-item input {
        font-size: 12px;
        width: 100%;
    }
    .param-item .btn-aplicar {
        width: 100%;
    }
    .param-item {
        padding: 6px 8px;
    }
    .panel {
        padding: 10px;
    }
}
}
