:root {
    --bg-deep: #0a0b10;
    --bg-surface: rgba(20, 22, 32, 0.7);
    --accent-cyan: #00f2ff;
    --accent-violet: #bc13fe;
    --text-main: #e2e8f0;
    --text-dim: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    --primary-gradient: linear-gradient(135deg, #00f2ff 0%, #bc13fe 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; font-weight: 700; }

.glow-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(0, 242, 255, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(188, 19, 254, 0.05) 0%, transparent 40%);
}

.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 5%; position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(10px); background: rgba(10, 11, 16, 0.8);
    border-bottom: 1px solid var(--glass-border);
}

.nav-logo { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; letter-spacing: -1px; }
.nav-logo span { color: var(--accent-cyan); }

.back-link { color: var(--accent-cyan) !important; font-weight: 600; }

.studio-section { padding: 60px 5% 100px; background: rgba(0,0,0,0.2); }
.studio-header { text-align: center; margin-bottom: 50px; }
.studio-header h2 { font-size: 3rem; color: white; }

.studio-container {
    max-width: 1100px; margin: 0 auto; background: var(--bg-surface);
    border: 1px solid var(--glass-border); border-radius: 32px; overflow: hidden;
    backdrop-filter: blur(20px);
}

.studio-tabs { display: flex; background: rgba(0,0,0,0.3); border-bottom: 1px solid var(--glass-border); }

.tab-btn {
    flex: 1; padding: 20px; border: none; background: none; cursor: pointer;
    color: var(--text-dim); font-weight: 600; transition: all 0.3s; font-family: 'Inter', sans-serif;
}
.tab-btn.active { color: white; background: rgba(255,255,255,0.05); box-shadow: inset 0 -3px 0 var(--accent-cyan); }

.studio-main { padding: 40px; }

.tool-workspace { display: grid; grid-template-columns: 1fr 350px; gap: 30px; align-items: start; }
.tool-controls { display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 15px; }
.tool-controls .action-area { justify-content: flex-start; margin-bottom: 0; flex-shrink: 0; }
.tool-controls .upload-container { max-width: 400px; margin-bottom: 0; flex-shrink: 0; }
.tool-controls .upload-container .drop-zone { padding: 20px; }
.tool-controls .input-group { width: 100%; margin-bottom: 0; }

.log-container { position: relative; }

.log-area {
    background: #000; color: #00ffcc; padding: 20px; border-radius: 12px;
    font-family: 'Courier New', monospace; font-size: 0.8rem; height: 450px;
    overflow-y: auto; margin-bottom: 0; border: 1px solid var(--glass-border);
}

.loader {
    position: absolute; top: 15px; right: 15px; width: 20px; height: 20px;
    border: 2px solid rgba(0, 242, 255, 0.3); border-top: 2px solid var(--accent-cyan);
    border-radius: 50%; animation: spin 1s linear infinite;
}
.loader.hidden { display: none; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.5s ease; }

.tool-intro { margin-bottom: 30px; border-left: 4px solid var(--accent-cyan); padding-left: 20px; }
.tool-intro h3 { font-size: 1.8rem; margin-bottom: 5px; }
.tool-intro p { color: var(--text-dim); }
.highlight { color: var(--accent-cyan); font-weight: 600; }

.input-group { margin-bottom: 25px; display: flex; flex-direction: column; gap: 10px; }
.input-group label { font-size: 0.9rem; color: var(--text-dim); }

input[type="text"], input[type="number"] {
    background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
    padding: 12px; border-radius: 8px; color: white; font-family: 'Inter', sans-serif;
}

.upload-container { margin-bottom: 30px; }

.drop-zone {
    border: 1px solid var(--glass-border); border-radius: 12px; padding: 20px 30px;
    text-align: center; background: var(--bg-surface); backdrop-filter: blur(10px);
    transition: all 0.3s ease; cursor: pointer; position: relative; overflow: hidden;
}

.drop-zone::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.2), rgba(188, 19, 254, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none; opacity: 0; transition: opacity 0.3s ease;
}
.drop-zone:hover::before, .drop-zone.drag-over::before { opacity: 1; }
.drop-zone:hover { border-color: transparent; }
.drop-zone.drag-over {
    border-color: transparent; background: rgba(0, 242, 255, 0.08);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.15);
}

.file-label {
    color: var(--text-dim); font-weight: 400; display: flex; align-items: center;
    justify-content: center; gap: 10px; font-size: 0.85rem; letter-spacing: 0.3px;
}
.file-label::before {
    content: '↑'; display: inline-block; font-size: 1.2rem;
    color: var(--accent-cyan); transition: transform 0.3s ease;
}
.drop-zone:hover .file-label::before { transform: translateY(-3px); }
.drop-zone.drag-over .file-label::before { transform: translateY(-5px) scale(1.2); }

input[type="file"] { display: none; }

.file-list { margin-top: 15px; display: flex; flex-direction: column; gap: 8px; }
.file-item {
    background: var(--bg-surface); padding: 8px 15px; border-radius: 8px;
    font-size: 0.85rem; border: 1px solid var(--glass-border); color: var(--text-main);
}

.action-area { display: flex; justify-content: center; margin-bottom: 40px; }

.studio-btn {
    background: var(--primary-gradient); color: white; border: none;
    padding: 15px 40px; border-radius: 12px; font-weight: 600;
    cursor: pointer; transition: transform 0.3s, box-shadow 0.3s;
}
.studio-btn:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(0, 242, 255, 0.3); }

.results-area {
    display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; margin-top: 20px;
}

.download-card {
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
    padding: 15px 25px; border-radius: 12px; display: flex; align-items: center;
    gap: 15px; transition: background 0.3s;
}
.download-card:hover { background: rgba(255,255,255,0.1); }
.download-card a { color: var(--accent-cyan); text-decoration: none; font-weight: 600; }

.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fadeIn 0.4s ease; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 30px; }
.next-btn, .back-btn { padding: 12px 25px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.next-btn { background: var(--primary-gradient); color: white; border: none; }
.back-btn { background: transparent; color: var(--text-dim); border: 1px solid var(--glass-border); }
.upload-group { margin-bottom: 20px; }
.upload-group label { display: block; font-size: 0.9rem; color: var(--text-dim); margin-bottom: 8px; }
.upload-group .drop-zone.small { padding: 15px; }

footer {
    padding: 60px 5%; border-top: 1px solid var(--glass-border);
    text-align: center; background: rgba(0,0,0,0.4);
}
.footer-logo { font-family: 'Playfair Display', serif; font-size: 1.2rem; margin-bottom: 10px; }
.footer-logo span { color: var(--accent-cyan); }
.footer-content p { color: var(--text-dim); font-size: 0.8rem; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 768px) {
    .tool-workspace { grid-template-columns: 1fr; }
    .studio-tabs { flex-wrap: wrap; }
    .tab-btn { padding: 10px; font-size: 0.8rem; }
    .log-area { height: 300px; }
}