/* --- CUSTOM CSS PAGE SPECIFIC STYLES --- */

.css-page-main {
    position: relative;
    background: var(--bg-base);
    color: var(--text-main);
    overflow-x: hidden;
}

/* --- HERO --- */
.css-hero {
    position: relative;
    padding: 10rem 0 4rem;
    overflow: hidden;
}

.css-hero-content {
    display: flex;
    flex-direction: column;
    align-items: center; /* Forces the badge/pill to center */
    text-align: center;
}

.css-hero-content h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.hero-lead {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0 auto;
    max-width: 800px;
}

/* Ensure all section headers center their badges */
.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- AUTO-SCOPED SHOWCASE (Re-using & Tweak Workspace styles) --- */
.css-engine-section {
    padding-bottom: 10rem;
}

.showcase-header-split {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    max-width: 1050px;
    margin: 0 auto 3rem;
    gap: 4rem;
}

.showcase-header-left { flex: 1; }
.showcase-header-right { flex: 1.2; }

.showcase-title {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    line-height: 1.1;
    letter-spacing: -1px;
    margin: 0;
}

.showcase-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* Update this block */
.editor-workspace {
    position: relative;
    max-width: 1000px;
    margin: 4rem auto 0; /* Changed: Added 4rem top margin to create breathing room */
    perspective: 1200px;
    transform-style: preserve-3d;
}

.workspace-main-img {
    width: 100%;
    display: block;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 80px rgba(0,0,0,0.8), 0 0 40px rgba(168, 85, 247, 0.15);
}

.floating-panel {
    position: absolute;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px rgba(0,0,0,0.8), 0 0 30px rgba(0,0,0,0.5);
    z-index: 3;
    animation: floatPanel 6s ease-in-out infinite;
    background: #181818; /* Darker grey matching your screenshot */
}

.floating-panel img {
    display: block;
    width: 100%;
    height: auto;
}

@keyframes floatPanel {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* Mobile Centering Overrides */
@media (max-width: 992px) {
    .showcase-header-split { 
        flex-direction: column; 
        align-items: center; /* Center horizontally */
        text-align: center;  /* Center text */
        gap: 1.5rem; 
    }
    
    .browser-text { 
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center; 
    }

    .browser-features li { 
        text-align: left; /* Keep the actual list items readable */
    }
}

/* --- INTERACTIVE PLAYGROUND --- */
.css-playground {
    display: flex;
    max-width: 1000px;
    margin: 0 auto;
    background: #0d1116;
    border: 1px solid #30363d;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    height: 500px;
}

/* Sidebar */
.playground-sidebar {
    width: 300px;
    background: #161b22;
    border-right: 1px solid #30363d;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8b949e;
    border-bottom: 1px solid #30363d;
    display: flex; align-items: center; gap: 8px;
}

.preset-list {
    list-style: none;
    padding: 1rem;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.preset-item {
    display: flex; align-items: center; gap: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    color: #c9d1d9;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.preset-item iconify-icon { font-size: 1.2rem; color: #8b949e; transition: color 0.2s; }

.preset-item:hover {
    background: rgba(255,255,255,0.03);
}

.preset-item.active {
    background: rgba(0, 123, 255, 0.1);
    border-color: rgba(0, 123, 255, 0.3);
    color: #fff;
    box-shadow: inset 4px 0 0 var(--primary);
}
.preset-item.active iconify-icon { color: var(--primary); }

/* Main Preview Area */
.playground-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #050608;
    overflow: hidden;
}

.preview-grid {
    position: absolute; inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 0;
}

.preview-header {
    height: 50px;
    background: rgba(13, 17, 22, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #30363d;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem;
    position: relative; z-index: 2;
    font-family: monospace; font-size: 0.85rem; color: #8b949e;
}

.preview-dots { display: flex; gap: 6px; }
.preview-dots span { width: 10px; height: 10px; border-radius: 50%; background: #30363d; }

.preview-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.preview-footer {
    padding: 1.5rem;
    background: rgba(13, 17, 22, 0.9);
    border-top: 1px solid #30363d;
    position: relative; z-index: 2;
    font-size: 0.9rem;
    color: #8b949e;
    text-align: center;
    transition: opacity 0.2s ease;
    min-height: 70px; /* Prevent jumping */
}

@media (max-width: 768px) {
    .css-playground { flex-direction: column; height: auto; }
    .playground-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #30363d; }
    .preset-list { display: flex; overflow-x: auto; padding: 0.5rem; }
    .preset-item { white-space: nowrap; margin-bottom: 0; margin-right: 0.5rem; }
    .preview-center { min-height: 300px; }
}

/* ========================================= */
/* --- LIVE CSS PRESET DEMO STYLES       --- */
/* ========================================= */

.demo-btn {
    /* Base reset so presets start clean */
    outline: none;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* PRESET 1: Neon Pulse (Electric) */
.demo-btn.preset-neon {
    border: 1px solid #005ce6;
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(0, 123, 255, 0.2) 0%, rgba(0, 92, 230, 0.4) 100%);
    color: #ffffff;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.3), inset 0 0 10px rgba(0, 123, 255, 0.2);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.demo-btn.preset-neon:hover {
    background: linear-gradient(180deg, rgba(0, 123, 255, 0.4) 0%, rgba(0, 92, 230, 0.6) 100%);
    box-shadow: 0 0 25px rgba(0, 123, 255, 0.6), 0 0 40px rgba(0, 123, 255, 0.2), inset 0 0 15px rgba(0, 123, 255, 0.4);
    transform: translateY(-2px);
    border-color: #38bdf8;
}

/* PRESET 2: Cyberpunk Edge */
.demo-btn.preset-cyberpunk {
    border: 2px solid #fce803;
    background: transparent;
    color: #fce803;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 0; /* Brutalist sharp edges */
    box-shadow: 5px 5px 0px rgba(252, 232, 3, 0.2);
    transition: all 0.1s linear;
}
.demo-btn.preset-cyberpunk:hover {
    background: #fce803;
    color: #050608;
    box-shadow: 8px 8px 0px rgba(252, 232, 3, 0.4);
    transform: translate(-3px, -3px);
}

/* PRESET 3: MC Enchanted (Hover Glint) */
.demo-btn.preset-mc-enchant {
    border: 2px solid #6b21a8;
    background: #1e1b4b;
    color: #d8b4fe;
    padding: 14px 36px;
    font-size: 1rem;
    font-weight: 600;
    font-family: monospace; /* Mimic game font */
    border-radius: 2px;
    box-shadow: inset 0 0 15px rgba(107, 33, 168, 0.5), 0 5px 15px rgba(0,0,0,0.5);
    transition: border-color 0.3s, color 0.3s;
}
/* The sweep glint effect */
.demo-btn.preset-mc-enchant::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: skewX(-20deg);
    transition: none;
}
.demo-btn.preset-mc-enchant:hover {
    border-color: #a855f7;
    color: #fff;
    cursor: pointer;
}
.demo-btn.preset-mc-enchant:hover::after {
    animation: mcGlint 0.6s ease-in-out;
}
@keyframes mcGlint {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* PRESET 4: Holographic Sheen (Glassmorphism) */
.demo-btn.preset-glass {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    padding: 14px 36px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}
.demo-btn.preset-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4), 0 0 20px rgba(255,255,255,0.1);
    transform: translateY(-3px);
}

/* --- PRESET BROWSER SHOWCASE --- */
.css-browser-section {
    padding: 6rem 0;
}

.browser-split {
    display: flex;
    align-items: center;
    gap: 5rem;
}

.browser-text { flex: 1; }
.browser-visual { flex: 1.3; }

.browser-text h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.browser-text p {
    font-size: 1.05rem;
    color: #cbd5e1;
    line-height: 1.7;
}

.browser-features {
    list-style: none;
    padding: 0;
}

.browser-features li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.browser-features iconify-icon {
    font-size: 1.6rem;
    color: var(--primary);
    margin-top: 2px;
}

.browser-features strong {
    display: block;
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.browser-features span {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.browser-img-wrapper {
    position: relative;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: var(--bg-surface);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.browser-main-img {
    width: 100%;
    display: block;
    border-radius: 12px;
    position: relative;
    z-index: 2;
}

.browser-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 80%; height: 80%;
    background: var(--primary);
    filter: blur(100px);
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
}

@media (max-width: 992px) {
    .browser-split { flex-direction: column; gap: 3rem; }
    .browser-text { text-align: center; }
    .browser-features li { text-align: left; }
}