/* --- RDD CARD CONTAINER --- */
.rdd-card {
    width: 100%;
    max-width: 1100px;
    min-height: 650px; /* Use min-height for flexibility */
    background: rgba(12, 12, 14, 0.75); /* Slightly darker for contrast */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    display: flex;
    overflow: hidden; /* Keeps children contained */
    box-shadow: 0 40px 100px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.05);
    animation: introFade 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    margin: 20px;
    flex-shrink: 0;
    position: relative; /* Context for overlays */
}

@keyframes introFade { from { opacity: 0; transform: scale(0.98) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* --- SIDEBAR --- */
.rdd-sidebar {
    width: 320px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid var(--border);
    padding: 35px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    flex-shrink: 0;
}

.rdd-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 5px;
}

.rdd-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

/* Control Groups */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-val {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    background: rgba(0, 240, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.control-desc {
    font-size: 0.7rem;
    color: #555;
    line-height: 1.4;
}

/* Switches & Sliders */
.switch { position: relative; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: #333; transition: .3s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(16px); }

input[type="range"] {
    -webkit-appearance: none; width: 100%; height: 4px; background: #333; border-radius: 2px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 16px; height: 16px; background: var(--text-main); border-radius: 50%; cursor: pointer; transition: 0.2s; border: 2px solid var(--bg);
}
input[type="range"]:hover::-webkit-slider-thumb { background: var(--accent); transform: scale(1.2); box-shadow: 0 0 10px var(--accent-glow); }

/* Buttons */
.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.comp-btn {
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    padding: 10px; border-radius: 8px; color: var(--text-muted);
    font-size: 0.7rem; font-weight: 700; transition: 0.2s; cursor: pointer;
}
.comp-btn:hover { background: rgba(255,255,255,0.08); color: white; }
.comp-btn.active {
    background: rgba(0, 240, 255, 0.1); border-color: var(--accent); color: var(--accent);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

/* Custom Text Input */
input[type="text"] {
    background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border);
    color: white; padding: 12px 15px; border-radius: 8px;
    font-family: var(--font-mono); font-size: 0.8rem; width: 100%;
    transition: 0.3s;
}
input[type="text"]:focus {
    border-color: var(--accent); background: rgba(0,0,0,0.5);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* --- MAIN CONTENT --- */
.rdd-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    min-width: 400px;
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.01) 0%, transparent 100%);
}

.section-tag {
    font-size: 0.7rem; font-weight: 800; color: #555;
    text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
}
.section-tag::after { content:''; height: 1px; flex: 1; background: var(--border); }

/* Platform Grid */
.platform-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 30px; }
.platform-btn {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    display: flex; align-items: center; gap: 15px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative; overflow: hidden;
    cursor: pointer;
}
.platform-btn:hover { background: rgba(255,255,255,0.05); transform: translateY(-3px); border-color: rgba(255,255,255,0.2); }
.platform-btn.active {
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.08), transparent);
    border-color: var(--accent);
}
/* Left accent line for active state */
.platform-btn.active::before {
    content:''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--accent); box-shadow: 0 0 15px var(--accent);
}

.plat-icon { font-size: 1.8rem; color: #555; transition: 0.3s; }
.platform-btn.active .plat-icon { color: var(--accent); filter: drop-shadow(0 0 5px var(--accent)); }

/* Inputs Row */
.input-row { display: flex; gap: 20px; margin-bottom: auto; }
.input-group { flex: 1; display: flex; flex-direction: column; gap: 8px; position: relative; }
.input-label { font-size: 0.7rem; font-weight: 700; color: #777; text-transform: uppercase; letter-spacing: 1px; }

.scan-btn {
    position: absolute; right: 5px; top: 29px; width: 34px; height: 34px;
    background: rgba(255,255,255,0.05); border: 1px solid transparent;
    border-radius: 6px; color: var(--accent); display: flex; align-items: center; justify-content: center;
    transition: 0.2s; cursor: pointer;
}
.scan-btn:hover { background: rgba(0, 240, 255, 0.1); border-color: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }

/* Download Button */
.dl-btn {
    margin-top: 40px;
    width: 100%;
    padding: 20px;
    background: var(--text-main);
    color: #000;
    border: none;
    border-radius: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    display: flex; justify-content: space-between; align-items: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative; overflow: hidden;
    cursor: pointer;
}
.dl-btn::after {
    content:''; position: absolute; inset:0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: translateX(-100%) skewX(-20deg);
    transition: 0.5s;
}
.dl-btn:hover { transform: scale(1.02); box-shadow: 0 0 40px rgba(255,255,255,0.15); }
.dl-btn:hover::after { transform: translateX(100%) skewX(-20deg); }
.dl-btn i { transition: 0.3s; }
.dl-btn:hover i { transform: translateX(5px); }

/* --- EXECUTION OVERLAY --- */
.exec-view {
    position: absolute; inset: 0;
    background: var(--bg);
    z-index: 20;
    display: none; /* Toggled via JS */
    flex-direction: column;
    animation: fadeIn 0.4s ease;
}
.exec-view.active { display: flex; }

.exec-head {
    height: 70px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 30px;
    background: rgba(255,255,255,0.01);
}

.exec-body { display: flex; flex: 1; }

.viz-col {
    width: 380px;
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: radial-gradient(circle at top, rgba(0, 240, 255, 0.03), transparent 60%);
    padding: 20px;
}

/* Progress Ring */
.ring-container { width: 200px; height: 200px; position: relative; margin-bottom: 30px; }
.ring-svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 6; }
.ring-val {
    fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round;
    stroke-dasharray: 628; stroke-dashoffset: 628; /* 2 * PI * 100 */
    transition: stroke-dashoffset 0.2s ease-out;
    filter: drop-shadow(0 0 8px var(--accent));
}
.ring-stats { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.big-num { font-size: 3rem; font-weight: 700; font-family: var(--font-display); line-height: 1; }
.sub-text { font-size: 0.8rem; color: var(--accent); font-weight: 600; letter-spacing: 2px; margin-top: 5px; text-shadow: 0 0 10px rgba(0,240,255,0.4); }

.term-col {
    flex: 1;
    display: flex; flex-direction: column;
    background: #050505;
    font-family: var(--font-mono);
}
.term-head { padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 0.7rem; color: #666; text-transform: uppercase; background: rgba(255,255,255,0.02); }
.term-logs {
    flex: 1; padding: 20px; overflow-y: auto; font-size: 0.75rem; color: #aaa;
    display: flex; flex-direction: column; gap: 6px;
}
.term-logs::-webkit-scrollbar { width: 4px; }
.term-logs::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.log-item { padding-left: 10px; border-left: 2px solid #222; animation: slideIn 0.2s; opacity: 0.7; transition: 0.2s; }
.log-item:last-child { opacity: 1; border-color: var(--accent); background: linear-gradient(90deg, rgba(0,240,255,0.05), transparent); }
.log-ts { color: #444; margin-right: 10px; font-size: 0.65rem; }
.log-info { color: #ccc; }
.log-warn { color: #fcd34d; }
.log-err { color: #fca5a5; }
.log-ok { color: #4ade80; }

/* --- SUCCESS MODAL --- */
.success-modal {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    z-index: 100;
    display: none; /* JS toggles */
    flex-direction: column; align-items: center; justify-content: center;
    animation: fadeIn 0.5s;
}
.success-modal.visible { display: flex; }

.success-card {
    background: #0a0a0a;
    border: 1px solid var(--border);
    padding: 50px;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 0 80px rgba(0, 240, 255, 0.1);
    transform: scale(0.95);
    animation: popUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes popUp { to { transform: scale(1); } }

.check-anim {
    width: 80px; height: 80px; border: 2px solid var(--success); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--success); font-size: 2.5rem; margin: 0 auto 25px;
    box-shadow: 0 0 30px rgba(0, 255, 157, 0.15);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(-10px); opacity: 0; } to { transform: translateX(0); opacity: 0.7; } }

/* Responsive */
@media (max-width: 900px) {
    .rdd-card { flex-direction: column; height: auto; min-height: 800px; }
    .rdd-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; padding: 20px; }
    .control-group { flex: 1; min-width: 200px; }
    .exec-body { flex-direction: column; height: auto; }
    .viz-col { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 30px; }
    .term-col { height: 300px; }
}