/* Base variables & reset */
:root {
    --bg-dark: #121212;
    --glass-bg: #1e1e1e;
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-y: auto;
    padding: 1rem;
}

.background-animation {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; overflow: hidden;
}

.glow {
    position: absolute; filter: blur(100px); border-radius: 50%; opacity: 0.3;
    animation: pulse 8s infinite alternate;
}
.glow-1 { width: 500px; height: 500px; background: #10b981; top: -150px; left: -150px; }
.glow-2 { width: 400px; height: 400px; background: #3b82f6; bottom: -100px; right: -100px; animation-delay: -4s; }

@keyframes pulse { 0% { transform: scale(1); opacity: 0.2; } 100% { transform: scale(1.2); opacity: 0.4; } }

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    z-index: 10;
}

header { text-align: center; }
.logo-container { font-size: 1.75rem; margin-bottom: 0.25rem; display: flex; justify-content: center; align-items: center; gap: 0.75rem; }
.text-gradient { background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
header p { color: var(--text-muted); font-size: 0.9rem; }

.global-settings {
    background: rgba(0,0,0,0.15);
    padding: 1rem;
    border-radius: 12px;
}

.setting-group { display: flex; flex-direction: column; gap: 0.5rem; }
.setting-group label { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; }

.custom-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}
.custom-input:focus { border-color: var(--accent); }
.small-input { padding: 0.5rem 0.75rem; font-size: 0.9rem; max-width: 150px; }

/* LEG SECTIONS */
.leg-section {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 1rem;
}
.leg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.5rem;
}
.leg-header h3 { font-size: 1rem; color: var(--text-main); display: flex; align-items: center; gap: 0.5rem;}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (max-width: 700px) {
    .upload-grid { grid-template-columns: repeat(2, 1fr); }
}

.mini-upload {
    background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.mini-upload i { font-size: 1.25rem; color: var(--text-muted); }
.mini-upload span { font-size: 0.75rem; color: var(--text-muted); line-height: 1.2; }

.mini-upload:hover { border-color: var(--accent); background: rgba(16, 185, 129, 0.05); }
.mini-upload.has-file { border-color: var(--success); border-style: solid; background: rgba(16, 185, 129, 0.1); }
.mini-upload.has-file i, .mini-upload.has-file span { color: var(--success); }
.manifest-box { grid-column: span 2; }

/* Actions */
.action-section { display: flex; flex-direction: column; gap: 0.75rem; }
.primary-btn, .secondary-btn {
    width: 100%; padding: 0.75rem; border-radius: 10px; border: none; font-size: 1rem; font-weight: 600;
    cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 0.75rem;
    transition: all 0.3s; text-decoration: none;
}
.primary-btn { background: var(--primary-gradient); color: white; }
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4); }
.secondary-btn { background: rgba(16, 185, 129, 0.15); color: var(--accent); border: 1px solid rgba(16, 185, 129, 0.3); }
.secondary-btn:hover { background: rgba(16, 185, 129, 0.25); }
.hidden { display: none !important; }

/* Loading */
.loading-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(18, 18, 18, 0.8); backdrop-filter: blur(4px); border-radius: 20px;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1rem; z-index: 20;
}
.spinner {
    width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.1);
    border-left-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Copyright */
.copyright {
    text-align: center; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem;
    padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.05); letter-spacing: 0.025em;
}


@media screen and (max-width: 560px) {
    body { padding: 0.65rem; align-items: flex-start; }
    .glass-panel { padding: 1.15rem 1rem; border-radius: 16px; gap: 1rem; }
    header h1 { font-size: 1.25rem; }
    header p { font-size: 0.82rem; }
    .leg-section { padding: 0.85rem; }
    .leg-header { flex-wrap: wrap; gap: 0.5rem; }
    .small-input { max-width: 130px; padding: 0.45rem 0.65rem; font-size: 0.85rem; }
    .mini-upload { padding: 0.85rem 0.4rem; }
}

@media screen and (max-width: 390px) {
    .small-input { max-width: 100%; width: 100%; }
    .upload-grid { grid-template-columns: 1fr; }
    .manifest-box, #recap-box { grid-column: span 1 !important; }
}

/* Harmonize UI when embedded in Dashboard */
html.embedded-iframe, html.embedded-iframe body { background: transparent !important; padding: 0 !important; overflow-y: auto; }
html.embedded-iframe .background-animation { display: none !important; }
html.embedded-iframe .glass-panel { border: none !important; box-shadow: none !important; background: transparent !important; max-width: 100% !important; padding: 0.5rem 1rem !important; }

