:root {
    /* Noud Hat Palette - Matte Dark */
    --bg-main: #000000;
    --bg-sidebar: #050505;
    --bg-panel: #0a0a0a;
    --border-color: #1a1a1a;
    
    --text-primary: #f5f5f5;
    --text-secondary: #a3a3a3;
    
    --accent-color: #bfea4a;
    --accent-hover: #a8d340;
    
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Layout Dashboard */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.brand-icon {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.brand-text h1 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-btn.active {
    background-color: var(--border-color);
    color: var(--accent-color);
    border: 1px solid #333;
}

.sidebar-footer {
    padding: 1rem 0.5rem 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2.5rem 3rem;
    overflow-y: auto;
    height: 100vh;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
    max-width: 900px;
    margin: 0 auto;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Platform Panel */
.platform-panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

/* Options Bar & Toggles */
.options-bar {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--border-color);
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.slider {
    position: relative;
    width: 36px;
    height: 18px;
    background-color: #333;
    border-radius: 20px;
    transition: 0.2s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: #888;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle-switch input:checked + .slider {
    background-color: var(--accent-color);
}

.toggle-switch input:checked + .slider::before {
    background-color: var(--bg-main);
    transform: translateX(18px);
}

.label-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-primary);
}

.radio-group input[type="radio"] {
    accent-color: var(--accent-color);
    width: 16px;
    height: 16px;
}

/* Dropzone */
.drop-zone {
    border: 1px dashed #444;
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.01);
    transition: all 0.2s ease;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.03);
}

.drop-icon {
    font-size: 2.5rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.drop-zone p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.drop-zone small {
    color: #666;
}

.drop-zone.mini {
    padding: 1.5rem 1rem;
}

.drop-zone.mini .drop-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Previews */
.preview-area, .preview-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.preview-item, .preview-mini {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
    background: #000;
}

.preview-item img, .preview-item video, .preview-mini img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.remove-btn, .btn-remove-mini {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.7);
    color: var(--text-primary);
    border: 1px solid #444;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.remove-btn:hover, .btn-remove-mini:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.video-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0,0,0,0.8);
    font-size: 0.65rem;
    padding: 2px 4px;
    border-radius: 3px;
    color: white;
}

/* Dual Upload Container (Camuflador) */
.dual-upload-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.upload-box {
    background-color: var(--bg-main);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.upload-header {
    margin-bottom: 1rem;
}

.badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    background-color: #333;
    color: #ccc;
}

.upload-header h3 {
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
}

/* Format Adapter Grid */
.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.format-category-title {
    margin: 1.5rem 0 0.8rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-render-mini {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-render-mini img {
    width: 100%;
    height: 100%;
    display: block;
}

.report-box {
    margin-top: 1.5rem;
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.format-card {
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.format-card:hover {
    border-color: #555;
}

.format-card.selected {
    border-color: var(--accent-color);
    background-color: rgba(255,255,255,0.05);
}

.format-icon {
    border: 2px solid var(--text-secondary);
    border-radius: 2px;
}

.format-card.selected .format-icon {
    border-color: var(--accent-color);
}

.format-icon.square { width: 30px; height: 30px; }
.format-icon.vertical { width: 24px; height: 30px; }
.format-icon.stories { width: 17px; height: 30px; }
.format-icon.landscape { width: 30px; height: 16px; }

.format-details {
    display: flex;
    flex-direction: column;
}

.format-details strong { font-size: 0.9rem; }
.format-details span { font-size: 0.75rem; color: var(--text-secondary); }

/* Alert Box */
.alert-box {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning-color);
    color: var(--warning-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

/* Buttons */
.action-bar {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.action-bar.centered {
    justify-content: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--bg-main);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--accent-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background-color: rgba(255,255,255,0.05);
}

.btn-large {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

/* Progress Area */
.progress-area {
    margin-top: 1.5rem;
}

#camuflador-status-text, #otimizador-status-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: #222;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    border: 3px solid #333;
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Text Cloaker Layout */
.text-cloaker-layout {
    display: grid;
    grid-template-columns: 1fr 180px 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

.text-box-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

.text-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.text-header h3 {
    font-size: 1rem;
    font-weight: 500;
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

textarea {
    flex: 1;
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

textarea:focus {
    border-color: var(--accent-color);
}

textarea[readonly] {
    background-color: rgba(255, 255, 255, 0.02);
}

.text-actions-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.8rem;
    padding: 0 0.5rem;
}

.column-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.text-actions-column .btn {
    width: 100%;
    justify-content: center;
    padding: 0.8rem;
}

.text-actions-column .divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem 0;
}

/* Responsive */
@media (max-width: 900px) {
    .text-cloaker-layout {
        grid-template-columns: 1fr;
    }
    
    .text-box-container {
        min-height: 250px;
    }

    .text-actions-column {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 1rem 0;
    }
    
    .text-actions-column .column-title {
        width: 100%;
    }

    .text-actions-column .btn {
        width: auto;
        flex: 1;
        min-width: 120px;
    }
    
    .text-actions-column .divider {
        width: 100%;
        height: 1px;
    }
}

/* CloneShield Layout */
.cs-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.cs-metric-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.cs-metric-card i {
    font-size: 2.5rem;
    color: var(--accent-color);
}

.cs-metric-data h3 {
    font-size: 2rem;
    margin: 0;
    line-height: 1;
}

.cs-metric-data span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cs-table-container {
    overflow-x: auto;
}

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

.cs-table th, .cs-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.cs-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cs-table td {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.cs-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.badge-status {
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-status.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}
.badge-status.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.cs-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    transition: color 0.2s;
}
.cs-action-btn:hover {
    color: var(--accent-color);
}

/* Modals */
.cs-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}
.cs-modal {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%; max-width: 500px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.cs-modal h3 { margin-bottom: 1.5rem; }
.cs-modal .form-group { margin-bottom: 1rem; }
.cs-modal label { display: block; margin-bottom: 0.5rem; color: var(--text-secondary); font-size: 0.9rem;}
.cs-modal input, .cs-modal select {
    width: 100%; padding: 0.8rem; border-radius: var(--radius-sm); border: 1px solid var(--border-color); background: var(--bg-body); color: white;
}
.cs-modal-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 2rem; }

@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
    }
    
    .brand {
        margin-bottom: 1.5rem;
    }
    
    .main-content {
        padding: 1.5rem 1rem;
    }
    
    .dual-upload-container {
        grid-template-columns: 1fr;
    }
}

/* Traffic Control UI */
.tc-container {
    background-color: #1a1a1a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1rem;
}
.tc-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}
.tc-modes {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.tc-mode-card {
    flex: 1;
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.tc-mode-card.active {
    border-color: var(--accent-color);
    background-color: rgba(191, 234, 74, 0.05); /* #bfea4a with 5% opacity */
}
.tc-mode-card i {
    font-size: 1.5rem;
    color: #3b82f6;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}
.tc-mode-card.active i {
    color: var(--accent-color);
}
.tc-mode-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}
.tc-mode-card span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.tc-slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}
.tc-slider {
    -webkit-appearance: none;
    flex: 1;
    height: 6px;
    background: linear-gradient(to right, var(--accent-color) var(--perc, 90%), #333 var(--perc, 90%));
    outline: none;
    border-radius: 3px;
}
.tc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: 2px solid #000;
}
.tc-slider-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    min-width: 40px;
    text-align: right;
}

.tc-interval {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}
.tc-interval input {
    width: 60px;
    padding: 0.4rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    text-align: center;
}

/* Form Elements */
input[type="text"], input[type="number"], input[type="url"], input[type="file"], select, textarea {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    width: 100%;
    transition: border-color 0.2s;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="url"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}
input[type="checkbox"] {
    accent-color: var(--accent-color);
}

.tc-simulation {
    background-color: #111;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1.5rem;
}
.tc-sim-header {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}
.tc-sim-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}
.tc-sim-row:last-child { 
    margin-bottom: 0; 
    margin-top: 1rem; 
    padding-top: 0.8rem; 
    border-top: 1px solid var(--border-color); 
    color: var(--text-primary);
}
.tc-sim-val { font-weight: 600; color: var(--text-primary); }
.tc-sim-val.green { color: var(--accent-color); }
.tc-sim-footer {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

