/* Dev/Design Glassmorphism Theme */
:root {
    --bg-dark: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --primary: #ec4899;
    /* Pink */
    --accent: #3b82f6;
    /* Blue */
    --gradient: linear-gradient(135deg, var(--primary), var(--accent));

    --panel-bg: rgba(15, 23, 42, 0.85);
    --panel-border: rgba(255, 255, 255, 0.1);

    --success: #10b981;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
}

/* Back Link */
.back-home-link {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    transition: all 0.3s;
    z-index: 100;
}

.back-home-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Background & Mesh Gradient */
.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -2;
    overflow: hidden;
    background: #000;
}

.color-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.8;
    animation: drift 20s ease-in-out infinite alternate;
}

.orb-1 {
    width: 50vw;
    height: 50vw;
    background: #c026d3;
    top: -10%;
    left: -10%;
}

.orb-2 {
    width: 60vw;
    height: 60vw;
    background: #2563eb;
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 40vw;
    height: 40vw;
    background: #e11d48;
    top: 40%;
    left: 30%;
    animation-delay: -10s;
}

.orb-4 {
    width: 45vw;
    height: 45vw;
    background: #0ea5e9;
    bottom: 10%;
    left: -10%;
    animation-delay: -15s;
}

@keyframes drift {
    0% {
        transform: scale(1) translate(0, 0);
    }

    33% {
        transform: scale(1.1) translate(10%, -10%);
    }

    66% {
        transform: scale(0.9) translate(-5%, 15%);
    }

    100% {
        transform: scale(1.2) translate(15%, 5%);
    }
}

.grid-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -1;
}

/* Layout */
.layout-wrapper {
    width: 100%;
    max-width: 1200px;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 10;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    padding: 1.5rem 2rem;
    border-radius: 24px;
    align-self: flex-start;
}

.app-header .logo {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.4);
}

.header-text h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.highlight {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Main Content Grid */
.main-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Left: Preview Area */
.preview-section {
    position: relative;
    border-radius: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

/* The element being styled dynamically by JS */
.glass-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: 20px;
    /* initial styles will be injected by JS */
}

.card-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.card-content p {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.dummy-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.dummy-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 99px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.dummy-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Right: Controls & Code Panel */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    overflow: hidden;
}

.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.controls-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Input Styles */
.input-group {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.input-group label {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.val-display {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    min-width: 55px;
    text-align: center;
}

.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    background-image: linear-gradient(var(--accent), var(--accent));
    background-size: 50% 100%;
    background-repeat: no-repeat;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    border: 3px solid var(--accent);
}

/* Color Options */
.color-group label {
    margin-bottom: 0.5rem;
    display: block;
}

.color-options {
    display: flex;
    gap: 0.75rem;
}

.color-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: white;
    transform: scale(1.1);
}

/* Code Output Area */
.code-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.code-body {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    height: 100%;
    overflow-x: auto;
}

pre {
    margin: 0;
}

code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #a5b4fc;
}

/* SEO Footer */
.seo-footer {
    text-align: center;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-weight: 500;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}