/* ========== WEBPAG STUDIO V6 - MODERN FLUID DESIGN ========== */

:root {
    --bg: #0a0a0b;
    --bg-2: #111113;
    --bg-3: #18181b;
    --bg-4: #1f1f23;
    --text: #fafafa;
    --text-2: #a1a1aa;
    --text-3: #71717a;
    --border: #27272a;
    --border-2: #3f3f46;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --blue: #3b82f6;
    --green: #22c55e;
    --orange: #f97316;
    --red: #ef4444;
    --gradient: linear-gradient(135deg, var(--purple), var(--pink));
    --gradient-2: linear-gradient(135deg, var(--blue), var(--purple));
    --glow: 0 0 40px rgba(139, 92, 246, 0.3);
    --glow-pink: 0 0 40px rgba(236, 72, 153, 0.3);
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 48px rgba(0,0,0,0.5);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* ========== LOADER ========== */
.loader {
    position: fixed; inset: 0; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; transition: opacity 0.6s, visibility 0.6s;
}
.loader.hide { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; }
.loader-logo { position: relative; width: 80px; height: 80px; margin: 0 auto 20px; }
.loader-logo svg { width: 60px; height: 60px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.logo-ring {
    position: absolute; inset: 0; border: 3px solid transparent;
    border-top-color: var(--purple); border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-size: 14px; color: var(--text-2); }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; font-size: 14px; font-weight: 600;
    border-radius: var(--radius); transition: var(--transition);
}
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-xl { padding: 18px 36px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-glow {
    background: var(--gradient); color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}
.btn-glow:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5); }
.btn-white { background: white; color: #111; }
.btn-white:hover { background: #f0f0f0; transform: translateY(-2px); }
.btn-glass {
    background: rgba(255,255,255,0.1); color: white;
    border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(10px);
}
.btn-glass:hover { background: rgba(255,255,255,0.15); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--bg-3); }
.btn-outline { border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--purple); background: rgba(139, 92, 246, 0.1); }
.btn-icon {
    width: 40px; height: 40px; padding: 0;
    background: var(--bg-3); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg-4); color: var(--text); }
.btn-icon:disabled { opacity: 0.4; cursor: not-allowed; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 8px; font-weight: 500; }
.form-input {
    width: 100%; padding: 14px 18px; font-size: 14px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text);
    transition: var(--transition);
}
.form-input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15); }
.form-input::placeholder { color: var(--text-3); }

/* ========== LANDING ========== */
.landing { display: block; min-height: 100vh; }

.landing-bg {
    position: fixed; inset: 0; z-index: 0; overflow: hidden;
}
.bg-gradient { position: absolute; inset: 0; background: radial-gradient(ellipse at top, rgba(139, 92, 246, 0.15), transparent 60%); }
.bg-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: 60px 60px;
}
.bg-glow {
    position: absolute; width: 600px; height: 600px;
    border-radius: 50%; filter: blur(120px); opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}
.glow-1 { background: var(--purple); top: -200px; left: -200px; }
.glow-2 { background: var(--pink); bottom: -200px; right: -200px; animation-delay: -10s; }
.glow-3 { background: var(--blue); top: 50%; left: 50%; transform: translate(-50%, -50%); animation-delay: -5s; opacity: 0.2; }
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Nav */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 48px;
    background: rgba(10, 10, 11, 0.8); backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav-brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 40px; height: 40px; }
.brand-logo.small { width: 32px; height: 32px; }
.brand-logo svg { width: 100%; height: 100%; }
.brand-name { font-size: 20px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; }
.brand-name span { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-links { display: flex; gap: 40px; }
.nav-links a { font-size: 14px; color: var(--text-2); transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; gap: 12px; }

/* Hero */
.hero {
    position: relative; z-index: 1;
    min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
    gap: 80px; align-items: center;
    padding: 140px 48px 80px; max-width: 1400px; margin: 0 auto;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 8px 20px; background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3); border-radius: var(--radius-full);
    font-size: 13px; margin-bottom: 32px;
}
.badge-pulse {
    width: 8px; height: 8px; background: var(--green);
    border-radius: 50%; animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.2); } }
.badge-divider { width: 1px; height: 16px; background: var(--border); }
.hero h1 { margin-bottom: 28px; }
.hero-line { display: block; font-size: clamp(40px, 5vw, 72px); font-weight: 800; line-height: 1.1; letter-spacing: -2px; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-desc { font-size: 18px; color: var(--text-2); margin-bottom: 40px; max-width: 480px; }
.hero-cta { display: flex; gap: 16px; margin-bottom: 60px; }
.hero-stats { display: flex; align-items: center; gap: 32px; }
.stat-item { text-align: center; }
.stat-value { display: block; font-size: 24px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-3); }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

/* Hero Visual */
.hero-visual { position: relative; }
.editor-preview { position: relative; }
.preview-window {
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: floatWindow 6s ease-in-out infinite;
}
@keyframes floatWindow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
.window-bar {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 18px; background: var(--bg-3);
    border-bottom: 1px solid var(--border);
}
.window-dots { display: flex; gap: 8px; }
.window-dots span { width: 12px; height: 12px; border-radius: 50%; }
.window-dots span:nth-child(1) { background: #ef4444; }
.window-dots span:nth-child(2) { background: #f97316; }
.window-dots span:nth-child(3) { background: #22c55e; }
.window-url { flex: 1; text-align: center; font-size: 12px; color: var(--text-3); }
.window-content { height: 320px; background: linear-gradient(135deg, #1a1a2e, #16213e); padding: 24px; }
.floating-element {
    position: absolute; width: 50px; height: 50px;
    background: var(--gradient); border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 18px; box-shadow: var(--glow);
    animation: floatEl 4s ease-in-out infinite;
}
.fe-1 { top: -20px; right: 40px; animation-delay: 0s; }
.fe-2 { bottom: 40px; left: -30px; animation-delay: -1.3s; }
.fe-3 { bottom: -20px; right: -20px; animation-delay: -2.6s; }
@keyframes floatEl {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

/* Sections */
.section-header { text-align: center; margin-bottom: 60px; position: relative; z-index: 1; }
.section-badge {
    display: inline-block; padding: 8px 20px;
    background: rgba(139, 92, 246, 0.1); border-radius: var(--radius-full);
    font-size: 12px; font-weight: 600; color: var(--purple);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px;
}
.section-header h2 { font-size: clamp(32px, 4vw, 48px); font-weight: 800; margin-bottom: 16px; letter-spacing: -1px; }
.section-header p { font-size: 18px; color: var(--text-2); }

/* Features */
.features { padding: 120px 48px; position: relative; z-index: 1; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 1200px; margin: 0 auto; }
.feature-card {
    padding: 32px; background: rgba(255,255,255,0.02);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    transition: var(--transition);
}
.feature-card:hover { border-color: var(--purple); transform: translateY(-4px); background: rgba(139, 92, 246, 0.05); }
.feature-large { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.feature-visual { background: var(--bg-3); border-radius: var(--radius); overflow: hidden; position: relative; min-height: 200px; }
.visual-canvas { position: absolute; inset: 0; }
.mini-element { position: absolute; background: var(--gradient); border-radius: 8px; opacity: 0.7; }
.feature-icon {
    width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
    background: var(--gradient); border-radius: var(--radius);
    font-size: 24px; color: white; margin-bottom: 20px;
}
.feature-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.feature-card p { font-size: 14px; color: var(--text-2); line-height: 1.7; }

/* Templates */
.templates { padding: 120px 48px; position: relative; z-index: 1; }
.templates-showcase {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px; max-width: 1200px; margin: 0 auto;
}

/* Pricing */
.pricing { padding: 120px 48px; position: relative; z-index: 1; }
.pricing-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; }
.pricing-card {
    padding: 40px; background: var(--bg-2);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    position: relative; transition: var(--transition);
}
.pricing-card:hover { border-color: var(--border-2); }
.pricing-card.popular {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    border-color: var(--purple);
}
.popular-tag {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    padding: 6px 20px; background: var(--gradient);
    border-radius: var(--radius-full); font-size: 12px; font-weight: 600; color: white;
}
.pricing-header { text-align: center; margin-bottom: 32px; }
.pricing-header h3 { font-size: 20px; margin-bottom: 12px; }
.pricing-amount { font-size: 48px; font-weight: 800; }
.pricing-amount .period { font-size: 16px; font-weight: 400; color: var(--text-3); }
.pricing-features { list-style: none; margin-bottom: 32px; }
.pricing-features li { padding: 12px 0; font-size: 14px; color: var(--text-2); display: flex; align-items: center; gap: 12px; }
.pricing-features i { color: var(--green); }

/* CTA */
.cta {
    padding: 120px 48px; position: relative; z-index: 1;
    background: var(--gradient); text-align: center;
}
.cta h2 { font-size: clamp(32px, 4vw, 48px); font-weight: 800; margin-bottom: 16px; }
.cta p { font-size: 18px; opacity: 0.9; margin-bottom: 40px; }

/* Footer */
.footer {
    padding: 40px 48px; text-align: center;
    border-top: 1px solid var(--border); position: relative; z-index: 1;
}
.footer p { color: var(--text-3); font-size: 14px; }
.footer i { color: var(--pink); }

/* ========== DASHBOARD ========== */
.dashboard { display: none; height: 100vh; }
.dashboard.active { display: flex; }

.sidebar {
    width: 260px; background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 24px; border-bottom: 1px solid var(--border);
    font-size: 18px; font-weight: 700;
}
.sidebar-menu { flex: 1; padding: 16px; }
.menu-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px; margin-bottom: 6px;
    border-radius: var(--radius); color: var(--text-2);
    font-size: 14px; font-weight: 500; transition: var(--transition);
}
.menu-item:hover { background: var(--bg-3); color: var(--text); }
.menu-item.active { background: rgba(139, 92, 246, 0.15); color: var(--purple); }
.menu-item i { width: 20px; text-align: center; }
.sidebar-upgrade { padding: 16px; }
.upgrade-card {
    padding: 24px; text-align: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid var(--border); border-radius: var(--radius);
}
.upgrade-card i { font-size: 28px; color: var(--purple); margin-bottom: 12px; display: block; }
.upgrade-card h4 { font-size: 15px; margin-bottom: 4px; }
.upgrade-card p { font-size: 12px; color: var(--text-3); margin-bottom: 16px; }
.sidebar-user {
    display: flex; align-items: center; gap: 12px;
    padding: 20px; border-top: 1px solid var(--border);
}
.user-avatar {
    width: 40px; height: 40px; background: var(--gradient);
    border-radius: var(--radius); display: flex;
    align-items: center; justify-content: center;
    font-weight: 600;
}
.user-info strong { display: block; font-size: 14px; }
.user-info span { font-size: 12px; color: var(--text-3); }

.dash-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.dash-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 32px; border-bottom: 1px solid var(--border);
}
.header-search {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; background: var(--bg-3);
    border: 1px solid var(--border); border-radius: var(--radius); width: 320px;
}
.header-search i { color: var(--text-3); }
.header-search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; }
.dash-content { flex: 1; padding: 32px; overflow-y: auto; }
.view { display: none; }
.view.active { display: block; }
.view-header { margin-bottom: 32px; }
.view-header h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.view-header p { color: var(--text-2); }

.projects-grid, .templates-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px;
}
.project-card {
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    cursor: pointer; transition: var(--transition);
}
.project-card:hover { border-color: var(--purple); transform: translateY(-4px); box-shadow: var(--glow); }
.project-thumb {
    aspect-ratio: 16/9; position: relative;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px; color: rgba(255,255,255,0.3);
}
.project-actions {
    position: absolute; top: 12px; right: 12px;
    display: flex; gap: 8px; opacity: 0; transition: opacity 0.2s;
}
.project-card:hover .project-actions { opacity: 1; }
.project-actions button {
    width: 36px; height: 36px; background: rgba(0,0,0,0.8);
    border-radius: 8px; color: white; display: flex;
    align-items: center; justify-content: center;
}
.project-actions button:hover { background: var(--purple); }
.project-actions .del:hover { background: var(--red); }
.project-info { padding: 20px; }
.project-info h3 { font-size: 16px; margin-bottom: 4px; }
.project-info p { font-size: 13px; color: var(--text-3); }
.project-card.new-card {
    border-style: dashed; display: flex; flex-direction: column;
    align-items: center; justify-content: center; min-height: 200px;
}
.project-card.new-card i { font-size: 40px; color: var(--purple); margin-bottom: 12px; }
.project-card.new-card span { color: var(--text-2); }

.template-card {
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    cursor: pointer; transition: var(--transition);
}
.template-card:hover { border-color: var(--purple); transform: translateY(-4px); }
.template-thumb {
    aspect-ratio: 16/9; display: flex;
    align-items: center; justify-content: center;
    font-size: 32px; color: rgba(255,255,255,0.5);
}
.template-info { padding: 20px; }
.template-info h4 { font-size: 16px; margin-bottom: 4px; }
.template-info p { font-size: 13px; color: var(--text-3); }

.settings-form { max-width: 480px; background: var(--bg-2); padding: 32px; border-radius: var(--radius-lg); border: 1px solid var(--border); }

/* ========== EDITOR ========== */
.editor { display: none; flex-direction: column; height: 100vh; overflow: hidden; }
.editor.active { display: flex; }

.editor-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; background: var(--bg-2);
    border-bottom: 1px solid var(--border); height: 64px; flex-shrink: 0;
}
.header-left, .header-center, .header-right { display: flex; align-items: center; gap: 12px; }
.header-left { flex: 1; }
.project-name {
    background: transparent; border: none; outline: none;
    color: var(--text); font-size: 15px; font-weight: 600;
    padding: 10px 14px; border-radius: var(--radius); width: 200px;
}
.project-name:hover, .project-name:focus { background: var(--bg-3); }
.save-status { font-size: 12px; color: var(--green); display: flex; align-items: center; gap: 6px; opacity: 0; transition: opacity 0.3s; }
.save-status.show { opacity: 1; }
.viewport-switch { display: flex; background: var(--bg-3); border-radius: var(--radius); padding: 4px; }
.vp-btn { width: 40px; height: 32px; color: var(--text-3); border-radius: 8px; transition: var(--transition); }
.vp-btn:hover { color: var(--text); }
.vp-btn.active { background: var(--bg-4); color: var(--purple); }
.zoom-control { display: flex; align-items: center; gap: 8px; padding: 4px 12px; background: var(--bg-3); border-radius: var(--radius); }
.zoom-control button { width: 28px; height: 28px; color: var(--text-3); border-radius: 6px; }
.zoom-control button:hover { background: var(--bg-4); color: var(--text); }
.zoom-control span { font-size: 13px; color: var(--text-2); min-width: 50px; text-align: center; }

.editor-body { display: flex; flex: 1; overflow: hidden; }
.editor-body.preview .panel { display: none; }
.editor-body.preview .element-wrapper:hover { outline: none !important; }
.editor-body.preview .element-handles { display: none !important; }

/* Panels */
.panel {
    background: var(--bg-2); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; flex-shrink: 0;
}
.panel-left { width: 280px; }
.panel-right { width: 300px; border-right: none; border-left: 1px solid var(--border); }
.panel-tabs { display: flex; padding: 12px; gap: 6px; border-bottom: 1px solid var(--border); }
.tab-btn {
    flex: 1; height: 40px; background: var(--bg-3);
    border-radius: var(--radius); color: var(--text-3); font-size: 16px;
    transition: var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--purple); color: white; }
.panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; }
.panel-body { flex: 1; overflow-y: auto; padding: 16px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.panel-search {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: var(--bg-3);
    border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px;
}
.panel-search i { color: var(--text-3); font-size: 14px; }
.panel-search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 13px; }

/* Elements */
.el-category { margin-bottom: 12px; }
.el-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--bg-3);
    border-radius: var(--radius); cursor: pointer;
    font-size: 13px; font-weight: 600; color: var(--text-2);
}
.el-header:hover { background: var(--bg-4); color: var(--text); }
.el-header .chevron { transition: transform 0.2s; }
.el-category.open .chevron { transform: rotate(180deg); }
.el-items { display: none; padding-top: 8px; }
.el-category.open .el-items { display: block; }
.el-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; margin-bottom: 4px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); cursor: grab; font-size: 13px;
    transition: var(--transition);
}
.el-item:hover { border-color: var(--purple); background: rgba(139, 92, 246, 0.05); }
.el-item:active { cursor: grabbing; }
.el-item i { color: var(--purple); width: 18px; text-align: center; }

/* Layers */
.layer-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; margin-bottom: 4px;
    background: var(--bg-3); border-radius: var(--radius);
    cursor: pointer; font-size: 13px;
}
.layer-item:hover { background: var(--bg-4); }
.layer-item.active { background: rgba(139, 92, 246, 0.15); color: var(--purple); }
.layer-item i { width: 18px; text-align: center; color: var(--text-3); }

/* Canvas Area */
.canvas-area {
    flex: 1; background: #0d0d0f;
    background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    overflow: hidden; position: relative;
}
.canvas-container { width: 100%; height: 100%; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 40px; }
.canvas-wrapper { transition: all 0.3s; transform-origin: top center; }
.canvas-wrapper.desktop { width: 1200px; }
.canvas-wrapper.tablet { width: 768px; }
.canvas-wrapper.mobile { width: 375px; }
.canvas {
    min-height: 800px; background: #111118;
    border-radius: var(--radius-lg); position: relative;
    box-shadow: 0 0 0 1px var(--border), var(--shadow-lg);
}
.canvas.dragover { box-shadow: 0 0 0 3px var(--purple), var(--glow); }
.empty-canvas {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--text-3);
}
.empty-canvas i { font-size: 64px; margin-bottom: 20px; opacity: 0.3; }
.empty-canvas h3 { font-size: 20px; color: var(--text-2); margin-bottom: 8px; }
.empty-canvas p { font-size: 14px; }

/* Free Position Elements */
.element-wrapper {
    position: absolute; cursor: move;
    transition: box-shadow 0.15s;
}
.element-wrapper:hover { z-index: 100; }
.element-wrapper.selected { z-index: 101; }
.element-wrapper:hover:not(.selected) { outline: 2px solid rgba(139, 92, 246, 0.4); }
.element-wrapper.selected { outline: 2px solid var(--purple); }
.element-content { width: 100%; height: 100%; overflow: hidden; pointer-events: none; }

/* Resize Handles */
.element-handles {
    position: absolute; inset: -6px; display: none;
}
.element-wrapper.selected .element-handles { display: block; }
.resize-handle {
    position: absolute; width: 12px; height: 12px;
    background: var(--purple); border: 2px solid white;
    border-radius: 50%; z-index: 10;
}
.resize-handle.nw { top: 0; left: 0; cursor: nw-resize; }
.resize-handle.ne { top: 0; right: 0; cursor: ne-resize; }
.resize-handle.sw { bottom: 0; left: 0; cursor: sw-resize; }
.resize-handle.se { bottom: 0; right: 0; cursor: se-resize; }
.resize-handle.n { top: 0; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.resize-handle.s { bottom: 0; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.resize-handle.w { top: 50%; left: 0; transform: translateY(-50%); cursor: w-resize; }
.resize-handle.e { top: 50%; right: 0; transform: translateY(-50%); cursor: e-resize; }

/* Element Toolbar */
.element-toolbar {
    position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    display: none; gap: 4px; padding: 6px;
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 8px; box-shadow: var(--shadow);
}
.element-wrapper.selected .element-toolbar { display: flex; }
.element-toolbar button {
    width: 32px; height: 32px; background: var(--bg-3);
    border-radius: 8px; color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
}
.element-toolbar button:hover { background: var(--purple); color: white; }
.element-toolbar .del:hover { background: var(--red); }

/* Properties Panel */
.prop-group { margin-bottom: 20px; }
.prop-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-3); margin-bottom: 10px; }
.prop-row { margin-bottom: 12px; }
.prop-row label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.color-input { display: flex; gap: 8px; align-items: center; }
.color-input input[type="color"] { width: 40px; height: 40px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: none; }
.color-input input[type="text"] { flex: 1; }
.no-selection { padding: 60px 20px; text-align: center; color: var(--text-3); }
.no-selection i { font-size: 48px; margin-bottom: 16px; opacity: 0.3; display: block; }

/* ========== MODALS ========== */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.9); backdrop-filter: blur(10px);
    z-index: 1000; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius-lg); width: 100%; max-width: 500px;
    max-height: 90vh; overflow: hidden;
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal.modal-lg { max-width: 640px; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 20px; font-weight: 700; }
.btn-close { width: 36px; height: 36px; color: var(--text-3); border-radius: var(--radius); }
.btn-close:hover { background: var(--bg-3); color: var(--text); }
.modal-body { padding: 24px; max-height: 60vh; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 20px 24px; border-top: 1px solid var(--border); background: var(--bg-3); }

.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tpl-option {
    padding: 12px; background: var(--bg-3);
    border: 2px solid transparent; border-radius: var(--radius);
    cursor: pointer; text-align: center;
}
.tpl-option:hover { background: var(--bg-4); }
.tpl-option.selected { border-color: var(--purple); background: rgba(139, 92, 246, 0.1); }
.tpl-option-thumb { aspect-ratio: 16/10; border-radius: 8px; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; color: white; font-size: 20px; }
.tpl-option span { font-size: 12px; color: var(--text-2); }

.export-options { display: flex; flex-direction: column; gap: 12px; }
.export-btn {
    display: flex; align-items: center; gap: 16px;
    padding: 20px; background: var(--bg-3);
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 15px; color: var(--text); text-align: left; width: 100%;
}
.export-btn:hover { border-color: var(--purple); background: rgba(139, 92, 246, 0.05); }
.export-btn i { font-size: 20px; color: var(--purple); }

.image-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--bg-3); border-radius: var(--radius); padding: 4px; }
.img-tab { flex: 1; padding: 12px; background: transparent; color: var(--text-2); font-size: 14px; border-radius: 8px; }
.img-tab:hover { color: var(--text); }
.img-tab.active { background: var(--bg-4); color: var(--text); }
.img-pane { display: none; }
.img-pane.active { display: block; }
.upload-area {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 48px; border: 2px dashed var(--border); border-radius: var(--radius);
    cursor: pointer; text-align: center;
}
.upload-area:hover { border-color: var(--purple); background: rgba(139, 92, 246, 0.05); }
.upload-area i { font-size: 48px; color: var(--purple); margin-bottom: 16px; }
.upload-area p { margin-bottom: 4px; }
.upload-area span { font-size: 13px; color: var(--text-3); }
.stock-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stock-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius); cursor: pointer; border: 2px solid transparent; }
.stock-img:hover { border-color: var(--purple); }
.stock-img.selected { border-color: var(--purple); box-shadow: var(--glow); }
#imagePreview { margin-top: 16px; text-align: center; }
#imagePreview img { max-width: 100%; max-height: 200px; border-radius: var(--radius); }

/* ========== TOAST ========== */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 12px; z-index: 2000; }
.toast {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px; background: var(--bg-2);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); min-width: 300px;
    animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
.toast i { font-size: 20px; }
.toast.success i { color: var(--green); }
.toast.error i { color: var(--red); }
.toast.info i { color: var(--blue); }
.toast span { flex: 1; font-size: 14px; }
.toast button { color: var(--text-3); padding: 4px; }
.toast button:hover { color: var(--text); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .hero { grid-template-columns: 1fr; text-align: center; }
    .hero-content { max-width: 600px; margin: 0 auto; }
    .hero-cta { justify-content: center; }
    .hero-stats { justify-content: center; }
    .hero-visual { display: none; }
    .features-grid { grid-template-columns: 1fr 1fr; }
    .feature-large { grid-column: span 2; grid-template-columns: 1fr; }
    .pricing-cards { grid-template-columns: 1fr; max-width: 400px; }
    .nav-links { display: none; }
}
@media (max-width: 768px) {
    .nav { padding: 16px 24px; }
    .hero { padding: 120px 24px 60px; }
    .features, .templates, .pricing { padding: 80px 24px; }
    .features-grid { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .panel { display: none; }
    .template-grid { grid-template-columns: repeat(2, 1fr); }
}

.pricing-details { margin: 32px auto 0; max-width: 900px; }

[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #c4b5fd; outline-offset: 4px; }
.account-dialog, .preview-dialog {
    color: var(--text); background: var(--bg-2); border: 1px solid var(--border);
    border-radius: 16px; padding: 28px; margin: auto;
    width: min(94vw, 620px); max-height: 90dvh; overflow: auto;
}
dialog::backdrop { background: rgba(0, 0, 0, .8); backdrop-filter: blur(4px); }
.account-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.account-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0; }
.account-description, .account-hint { color: var(--text-2); line-height: 1.6; margin: 12px 0; }
.account-hint { font-size: 13px; }
.account-feedback { min-height: 24px; line-height: 1.6; margin: 16px 0; }
.account-actions { display: grid; gap: 12px; margin-top: 20px; }
.account-actions .btn { white-space: normal; }
.account-backup { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; }
.preview-dialog { width: 96vw; height: 92dvh; max-width: 1500px; }
.preview-dialog form { margin-bottom: 12px; }
.preview-dialog iframe { background: white; width: 100%; height: calc(100% - 60px); border: 0; }
.element-content h1, .element-content h2, .element-content p { white-space: pre-line; }
.user-info strong { display: block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.yvaryon-logo { display: block; width: 200px; height: auto; flex-shrink: 0; filter: grayscale(1) invert(1) contrast(1.7); mix-blend-mode: screen; }
.sidebar-brand .yvaryon-logo { width: 190px; }
.footer-brand { width: 170px; margin: 0 auto 20px; }
.loader-logo { width: 240px; height: 100px; display: grid; place-items: start center; }
.loader-logo .yvaryon-logo { width: 220px; }
.loader-spinner { width: 20px; height: 20px; border: 2px solid #444; border-top-color: #f5ead7; border-radius: 50%; animation: spin 1s linear infinite; }
@media (max-width: 600px) { .nav { gap: 12px; padding: 14px 16px; } .nav-brand .yvaryon-logo { width: 132px; } .nav-actions { gap: 6px; } .nav-actions .btn { padding: 10px 12px; font-size: 12px; } }
