/* ==========================================================================
   CSSGenerator.com - Modern Design System & Studio Styling
   ========================================================================== */

:root {
    /* Color Palette - Dark Theme (Default) */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-elevated: #30363d;
    --bg-card: rgba(22, 27, 34, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.05);

    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --border-glow: rgba(255, 107, 0, 0.35);

    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --text-inverse: #0d1117;

    /* Accent & Brand Colors */
    --accent-orange: #ff6b00;
    --accent-orange-hover: #ff8533;
    --accent-orange-glow: rgba(255, 107, 0, 0.25);
    --accent-gradient: linear-gradient(135deg, #ff6b00 0%, #ff3b30 50%, #ff8533 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(255, 107, 0, 0.15), rgba(255, 59, 48, 0.05));
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-purple: #bc8cff;
    --accent-pink: #f778ba;
    --accent-yellow: #d29922;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(255, 107, 0, 0.3);

    /* Layout & Geometry */
    --sidebar-width: 290px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', Consolas, monospace;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-primary: #f6f8fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eaeef2;
    --bg-elevated: #d0d7de;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(0, 0, 0, 0.03);

    --border-subtle: rgba(0, 0, 0, 0.1);
    --border-strong: rgba(0, 0, 0, 0.16);
    --border-glow: rgba(255, 107, 0, 0.4);

    --text-primary: #1f2328;
    --text-secondary: #57606a;
    --text-muted: #8c959f;
    --text-inverse: #ffffff;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-orange);
}

/* --------------------------------------------------------------------------
   Header & Top Navigation
   -------------------------------------------------------------------------- */
.app-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 900;
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: var(--shadow-sm);
}

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

.mobile-toggle-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.35rem;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-badge {
    background: var(--accent-gradient);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-glow);
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.brand-title .tld {
    color: var(--accent-orange);
    font-weight: 700;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 0.25rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border-subtle);
    display: none;
}

@media (min-width: 900px) {
    .brand-subtitle { display: inline-block; }
}

/* Search Bar */
.search-container {
    position: relative;
    width: 100%;
    max-width: 380px;
    margin: 0 1rem;
}

.search-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.6rem 1rem 0.6rem 2.4rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-fast);
}
.search-input:focus {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px var(--accent-orange-glow);
    background: var(--bg-secondary);
}
.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}
.search-shortcut {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.theme-toggle-btn, .header-icon-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-fast);
}
.theme-toggle-btn:hover, .header-icon-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
    color: var(--accent-orange);
}

.nav-cta-btn {
    background: var(--accent-gradient);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}
.nav-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* --------------------------------------------------------------------------
   App Layout: Sidebar + Main Workspace
   -------------------------------------------------------------------------- */
.app-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - var(--header-height));
}

/* Sidebar Styles */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition-base);
    z-index: 800;
}

.sidebar-nav {
    padding: 1.25rem 0.85rem;
    flex: 1;
}

.nav-category {
    margin-bottom: 1.25rem;
}

.category-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 0.4rem 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}
.category-title:hover {
    color: var(--text-primary);
}
.category-title .cat-chevron {
    font-size: 0.65rem;
    transition: transform var(--transition-fast);
}
.nav-category.collapsed .cat-chevron {
    transform: rotate(-90deg);
}
.nav-category.collapsed .category-items {
    display: none;
}

.category-items {
    list-style: none;
    margin-top: 0.25rem;
}

.tool-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}
.tool-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateX(3px);
}
.tool-nav-item.active {
    background: var(--accent-gradient-subtle);
    color: var(--accent-orange);
    font-weight: 600;
    border-left: 3px solid var(--accent-orange);
}
.tool-nav-item .nav-icon {
    font-size: 1rem;
    opacity: 0.8;
}
.tool-nav-item .nav-badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-weight: 600;
}
.tool-nav-item.active .nav-badge {
    background: var(--accent-orange);
    color: #ffffff;
}

/* Sidebar Promo Widget */
.sidebar-promo-widget {
    margin: 1rem 0.85rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.12), rgba(255, 59, 48, 0.05));
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}
.promo-badge-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent-orange);
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
    display: block;
}
.promo-headline {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 0.5rem;
}
.promo-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0.85rem;
}
.promo-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-orange);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.promo-link-btn:hover {
    color: var(--accent-orange-hover);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Main Content Area & Studio Canvas
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* Top Ad / Announcement Banner */
.ad-banner-slot {
    width: 100%;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.65rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}
.ad-banner-inner {
    width: 100%;
    max-width: 970px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}
.ad-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* --------------------------------------------------------------------------
   Homepage / Hub View (When no specific generator is active)
   -------------------------------------------------------------------------- */
.hub-view {
    padding: 2.5rem 2rem;
    max-width: 1350px;
    margin: 0 auto;
    width: 100%;
}

.hero-banner {
    text-align: center;
    padding: 3rem 1.5rem 2.5rem;
    position: relative;
    border-radius: var(--radius-lg);
    background: radial-gradient(circle at 50% 0%, rgba(255, 107, 0, 0.15) 0%, transparent 70%), var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
}

.hero-pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent-gradient-subtle);
    border: 1px solid var(--border-glow);
    color: var(--accent-orange);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.hero-h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.15;
    margin-bottom: 1rem;
    color: var(--text-primary);
}
.hero-h1 .gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 750px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.quick-filter-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}
.filter-pill {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.filter-pill:hover, .filter-pill.active {
    background: var(--accent-orange);
    color: #ffffff;
    border-color: var(--accent-orange);
    transform: translateY(-1px);
}

/* Tool Grid Section */
.tools-grid-section {
    margin-bottom: 3.5rem;
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.section-badge-count {
    font-size: 0.75rem;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
}

.tools-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.studio-tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.studio-tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base), opacity var(--transition-base);
}

.studio-tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-orange);
    box-shadow: var(--shadow-md), 0 0 15px var(--accent-orange-glow);
}
.studio-tool-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.tool-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: transform var(--transition-fast);
}
.studio-tool-card:hover .tool-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    background: var(--accent-gradient-subtle);
    border-color: var(--accent-orange);
}

.tool-category-badge {
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}
.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 1.25rem;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-orange);
}
.card-arrow {
    transition: transform var(--transition-fast);
}
.studio-tool-card:hover .card-arrow {
    transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Interactive Studio Workspace (When a Tool is Active)
   -------------------------------------------------------------------------- */
.studio-view {
    display: none; /* activated when a tool is selected */
    flex-direction: column;
    height: 100%;
}

.studio-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.studio-title-block {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.studio-tool-icon {
    font-size: 1.75rem;
    background: var(--accent-gradient-subtle);
    border: 1px solid var(--border-glow);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.studio-tool-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
}
.studio-tool-tagline {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.studio-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.preset-selector-dropdown {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.studio-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.5rem 0.95rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-fast);
}
.studio-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
}
.studio-btn.primary {
    background: var(--accent-gradient);
    border: none;
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}
.studio-btn.primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

/* Studio Main Workspace: Split Grid (Controls + Live Canvas + Output) */
.studio-workspace-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    min-height: 600px;
    flex: 1;
}

@media (max-width: 1100px) {
    .studio-workspace-grid {
        grid-template-columns: 1fr;
    }
}

/* Left Panel: Form Controls */
.studio-controls-panel {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - var(--header-height) - 75px);
}

.controls-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent-orange);
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-subtle);
}

.control-field {
    margin-bottom: 1.25rem;
}

.control-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}
.control-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}
.control-value-display {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: var(--bg-tertiary);
    color: var(--accent-orange);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

/* Custom Range Slider */
.studio-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    outline: none;
    transition: background var(--transition-fast);
}
.studio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-orange);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-orange-glow);
    transition: transform var(--transition-fast);
}
.studio-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Studio Select / Input */
.studio-select, .studio-text-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition-fast);
}
.studio-select:focus, .studio-text-input:focus {
    border-color: var(--accent-orange);
}

/* Color Picker Input */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.studio-color-input {
    -webkit-appearance: none;
    border: 1px solid var(--border-subtle);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    padding: 0;
}
.studio-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}
.studio-color-input::-webkit-color-swatch {
    border: none;
    border-radius: var(--radius-sm);
}

/* Button Group / Segmented Control */
.segmented-control {
    display: flex;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 3px;
}
.segment-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}
.segment-btn:hover {
    color: var(--text-primary);
}
.segment-btn.active {
    background: var(--bg-secondary);
    color: var(--accent-orange);
    box-shadow: var(--shadow-sm);
}

/* Right Panel: Live Canvas + Code Output */
.studio-stage-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow-y: auto;
}

/* Stage Toolbar (Canvas Background, Element Mode, Zoom) */
.stage-toolbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.65rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.stage-canvas-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.canvas-bg-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-subtle);
    cursor: pointer;
    transition: transform var(--transition-fast);
}
.canvas-bg-btn:hover, .canvas-bg-btn.active {
    border-color: var(--accent-orange);
    transform: scale(1.15);
}
.canvas-bg-dark { background: #0d1117; }
.canvas-bg-light { background: #f6f8fa; }
.canvas-bg-grid { background: radial-gradient(circle, #30363d 10%, transparent 11%) 0 0/15px 15px, #161b22; }
.canvas-bg-mesh { background: linear-gradient(135deg, #1f1c2c, #928dab); }

/* The Live Interactive Canvas */
.interactive-canvas-viewport {
    flex: 1;
    min-height: 380px;
    padding: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Canvas Decorative Floating Elements for Glassmorphism & Backdrop Previews */
.canvas-backdrop-decorations {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: none; /* Shown for backdrop-filter / glassmorphism tools */
}
.decor-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.65;
}
.decor-orb-1 {
    width: 250px;
    height: 250px;
    background: #ff6b00;
    top: 10%;
    left: 15%;
}
.decor-orb-2 {
    width: 200px;
    height: 200px;
    background: #58a6ff;
    bottom: 15%;
    right: 15%;
}
.decor-orb-3 {
    width: 180px;
    height: 180px;
    background: #bc8cff;
    top: 30%;
    right: 35%;
}

/* Target Preview Containers */
.target-preview-wrapper {
    position: relative;
    z-index: 2;
    max-width: 100%;
}

/* 1. Generic Interactive Box / Card */
.preview-box-element {
    background: var(--accent-orange);
    color: #ffffff;
    padding: 2rem 3rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    min-width: 220px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-fast);
}

/* 2. Flexbox / Grid Interactive Container */
.preview-layout-container {
    width: 100%;
    min-width: 480px;
    max-width: 720px;
    min-height: 280px;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    position: relative;
}

.preview-layout-item {
    background: linear-gradient(135deg, var(--accent-orange), #e65100);
    color: #ffffff;
    padding: 1.25rem 1.75rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}
.preview-layout-item:nth-child(2) { background: linear-gradient(135deg, #58a6ff, #1f6feb); }
.preview-layout-item:nth-child(3) { background: linear-gradient(135deg, #3fb950, #238636); }
.preview-layout-item:nth-child(4) { background: linear-gradient(135deg, #bc8cff, #8957e5); }
.preview-layout-item:nth-child(5) { background: linear-gradient(135deg, #f778ba, #bf3989); }
.preview-layout-item:nth-child(6) { background: linear-gradient(135deg, #d29922, #9e6a03); }

/* 3. Typography Preview Container */
.preview-typography-container {
    max-width: 650px;
    text-align: left;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}
.preview-typo-headline {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}
.preview-typo-subheadline {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.preview-typo-body {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* 4. Multi-Column Newspaper Article Layout */
.preview-columns-container {
    max-width: 720px;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* 5. Glassmorphism Card Preview */
.preview-glass-card {
    width: 320px;
    padding: 2rem;
    border-radius: var(--radius-lg);
    color: #ffffff;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.glass-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.glass-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b00, #bc8cff);
}

/* --------------------------------------------------------------------------
   Code Output & Export Panel
   -------------------------------------------------------------------------- */
.studio-output-panel {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
}

.output-header-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.code-tabs-list {
    display: flex;
    gap: 0.25rem;
}
.code-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.code-tab-btn:hover {
    color: var(--text-primary);
}
.code-tab-btn.active {
    background: var(--bg-secondary);
    color: var(--accent-orange);
}

.copy-code-btn {
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.95rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}
.copy-code-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.code-display-area {
    padding: 1.25rem 1.5rem;
    background: #090d13;
    max-height: 220px;
    overflow-y: auto;
}
.code-snippet {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e6edf3;
    white-space: pre-wrap;
    word-break: break-word;
}
.code-snippet .css-selector { color: var(--accent-pink); font-weight: 600; }
.code-snippet .css-prop { color: var(--accent-blue); }
.code-snippet .css-val { color: var(--accent-green); }
.code-snippet .css-punct { color: #8b949e; }
.code-snippet .css-comment { color: #6e7681; font-style: italic; }

/* --------------------------------------------------------------------------
   Educational Section ("CSS Explained")
   -------------------------------------------------------------------------- */
.studio-educational-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: 2rem 2.5rem;
}

.edu-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}
.edu-badge {
    background: var(--accent-gradient-subtle);
    color: var(--accent-orange);
    border: 1px solid var(--border-glow);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}
.edu-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.edu-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

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

.edu-main-explanation p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1rem;
}

.edu-properties-list {
    margin: 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.edu-prop-item {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-orange);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.edu-prop-name {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.edu-prop-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.edu-sidebar-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}
.browser-compat-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.browser-badges-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.browser-badge {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.35rem;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.browser-badge .browser-icon { font-size: 1.1rem; display: block; margin-bottom: 0.2rem; }
.browser-badge.supported { color: var(--accent-green); border-color: rgba(63, 185, 80, 0.3); }

/* In-Content Web Service Spotlight */
.service-spotlight-card {
    margin-top: 1.25rem;
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.15), rgba(88, 166, 255, 0.05));
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}
.spotlight-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}
.spotlight-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 0.85rem;
}
.spotlight-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent-orange);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition-fast);
}
.spotlight-cta:hover {
    background: var(--accent-orange-hover);
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.app-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: 3rem 2rem 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 800px) {
    .footer-inner {
        grid-template-columns: 1fr;
    }
}

.footer-brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.65rem;
}
.footer-tagline {
    max-width: 420px;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.footer-heading {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-links-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.footer-links-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.footer-links-list a:hover {
    color: var(--accent-orange);
}

.footer-bottom-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-elevated);
    color: #ffffff;
    border: 1px solid var(--accent-green);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-base);
}
.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Mobile Responsive Rules
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .mobile-toggle-btn {
        display: block;
    }
    .app-sidebar {
        position: fixed;
        left: 0;
        top: var(--header-height);
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .search-container {
        max-width: 200px;
    }
    .search-shortcut {
        display: none;
    }
    .hero-banner {
        padding: 2rem 1rem;
    }
    .studio-workspace-grid {
        grid-template-columns: 1fr;
    }
    .interactive-canvas-viewport {
        padding: 1.5rem 1rem;
    }
    .preview-layout-container {
        min-width: 100%;
    }
}
