:root {
    --bg-dark: #09090b; /* Zinc 950 */
    --panel-bg: rgba(24, 24, 27, 0.4); /* Zinc 900 with transparency */
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-primary: #38bdf8; /* Sky 400 */
    --accent-secondary: #818cf8; /* Indigo 400 */
    --accent-hover: #0284c7; /* Sky 600 */
    --success: #34d399;
    --input-bg: rgba(9, 9, 11, 0.6);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Ambient Background Orbs */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    top: -10%; left: -5%;
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15), transparent 70%);
}

.orb-2 {
    bottom: -20%; right: -10%;
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.12), transparent 70%);
    animation-delay: -5s;
}

.orb-3 {
    top: 40%; left: 60%;
    width: 30vw; height: 30vw;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.08), transparent 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -50px) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 1400px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 90vh;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeInDown 0.8s ease;
}

.logo-wrapper {
    background: linear-gradient(135deg, var(--panel-bg), rgba(255,255,255,0.05));
    border: 1px solid var(--panel-border);
    padding: 1rem 1.5rem;
    border-radius: 20px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-img {
    height: 75px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #e0f2fe, #bae6fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.3rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

header p.copyright-header {
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: none;
    margin-top: 0.5rem;
    opacity: 0.6;
    color: var(--accent-primary);
}

/* Layout */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    flex-grow: 1;
    min-height: 0; /* Important for inner scrolling */
}

.left-panel, .right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
}

.right-panel {
    grid-template-rows: auto 1fr;
}

/* Glass Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.step-card {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.step-card:hover {
    border-color: rgba(255,255,255,0.15);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-badge {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.step-badge.success {
    background: rgba(52, 211, 153, 0.2);
    border-color: var(--success);
    color: var(--success);
}

.card-header h2 {
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: -0.8rem 0 1.5rem 3.2rem;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.2rem;
}

.flex-grow {
    flex-grow: 1;
    margin-bottom: 0;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input, textarea, select {
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15), inset 0 2px 4px rgba(0,0,0,0.2);
    background: rgba(9, 9, 11, 0.8);
}

textarea {
    resize: none;
    height: 100%;
}

.mono-font {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

/* Custom Select */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    appearance: none;
    cursor: pointer;
    padding-right: 3rem;
}

.select-arrow {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Dynamic Grid */
.dynamic-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.4);
    filter: brightness(1.1);
}

.primary-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.primary-btn:hover .btn-icon {
    transform: translateX(4px);
}

.secondary-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-family: inherit;
}

.secondary-btn:hover {
    background: rgba(255,255,255,0.1);
}

.secondary-btn.copied {
    background: rgba(52, 211, 153, 0.15);
    border-color: var(--success);
    color: var(--success);
}

/* Output Area */
.output-card {
    flex-grow: 1;
}

.output-header {
    justify-content: space-between;
    margin-bottom: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.output-textarea {
    background: rgba(0,0,0,0.3);
}

.glow-border {
    position: relative;
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 21px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(56,189,248,0.5), rgba(129,140,248,0.1), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; filter: blur(4px); }
    to { opacity: 1; filter: blur(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Custom Scrollbar for Textareas */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* Responsive */
@media (max-width: 1024px) {
    .split-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .container {
        height: auto;
        padding: 1rem 0;
    }
    
    textarea {
        min-height: 250px;
    }
}


@media screen and (max-width: 640px) {
    body {
        padding: 0.85rem;
        align-items: flex-start;
    }
    .container {
        gap: 1.25rem;
        padding: 0.25rem 0 1rem;
    }
    .logo-wrapper {
        padding: 0.75rem 1.1rem;
        margin-bottom: 1rem;
    }
    .logo-img {
        height: 54px;
    }
    header h1 {
        font-size: 1.5rem;
    }
    header p {
        font-size: 0.85rem;
        letter-spacing: 1px;
    }
    .split-layout,
    .left-panel,
    .right-panel {
        gap: 1rem;
    }
    .step-card {
        padding: 1.15rem;
        border-radius: 16px;
    }
    .card-header {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    .card-header h2 {
        font-size: 1.08rem;
    }
    .output-header {
        flex-wrap: wrap;
        gap: 0.6rem;
    }
    .subtitle {
        margin: -0.4rem 0 1rem 0;
        font-size: 0.85rem;
    }
    .dynamic-form {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    input, textarea, select {
        padding: 0.8rem 0.9rem;
        font-size: 0.95rem;
    }
}

/* 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 .ambient-orb { display: none !important; }
html.embedded-iframe .container { max-width: 100% !important; padding: 0 !important; }
html.embedded-iframe header { display: none !important; }
html.embedded-iframe .glass-panel { border: none !important; box-shadow: none !important; background: transparent !important; }

