/* SVG Pattern Maker — Creative Studio Theme */

:root {
    --primary: #FF6B9D;
    --primary-light: #FF8DB5;
    --primary-dark: #C44569;
    --accent: #C44569;
    --bg-base: #1A1A2E;
    --bg-surface: #24243E;
    --bg-elevated: #30304D;
    --bg-glass: rgba(36, 36, 62, 0.65);
    --text-primary: #F0E6F6;
    --text-secondary: #B8A0C8;
    --text-muted: #6C5B7B;
    --border: rgba(184, 160, 200, 0.1);
    --border-active: rgba(255, 107, 157, 0.4);
    --success: #6FCF97;
    --radius: 12px;
    --radius-sm: 8px;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 50% 40% at 25% 20%, rgba(255, 107, 157, 0.06), transparent), radial-gradient(ellipse 40% 30% at 75% 80%, rgba(196, 69, 105, 0.04), transparent);
    pointer-events: none;
}

.app {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    padding: 20px 0 14px;
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.15);
}

h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Main & Layout */
.main {
    flex: 1;
    padding: 24px 0;
}

.layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    align-items: start;
}

/* Sidebar */
.sidebar {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 20px;
    max-height: 90vh;
    overflow-y: auto;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.pattern-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 16px;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pattern-btn:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
}

.pattern-btn.active {
    border-color: var(--primary);
    background: rgba(255, 107, 157, 0.12);
    color: var(--primary-light);
}

.pattern-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: 2px solid var(--border);
    border-radius: 6px;
}

.hex-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 8px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    outline: none;
}

.hex-input:focus {
    border-color: var(--border-active);
}

.range-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="range"] {
    -webkit-appearance: none;
    flex: 1;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary-light);
    border-radius: 50%;
    cursor: pointer;
}

.range-value {
    font-size: 0.68rem;
    color: var(--primary-light);
    font-weight: 600;
    min-width: 36px;
    text-align: right;
}

/* Preview */
.preview-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-area {
    width: 100%;
    height: 360px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    background-color: #1A1A2E;
}

.export-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    box-shadow: 0 0 14px rgba(255, 107, 157, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 0 22px rgba(255, 107, 157, 0.35);
    transform: translateY(-1px);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-accent {
    background: rgba(196, 69, 105, 0.15);
    color: var(--primary-light);
    border-color: rgba(255, 107, 157, 0.25);
}

.btn-accent:hover {
    background: rgba(196, 69, 105, 0.25);
}

/* Code */
.code-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.code-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 14px;
}

.tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 10px 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
}

.code-block {
    padding: 14px;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--primary-light);
    line-height: 1.7;
    max-height: 200px;
    overflow: auto;
    white-space: pre-wrap;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-elevated);
    color: var(--success);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid rgba(111, 207, 151, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: all 300ms ease;
    pointer-events: none;
    z-index: 100;
}

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

/* Footer */
.footer {
    padding: 14px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer p {
    font-size: 0.72rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        max-height: none;
    }

    .preview-area {
        height: 260px;
    }
}

@media (max-width: 480px) {
    .app {
        padding: 0 12px;
    }

    .pattern-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(184, 160, 200, 0.2);
    border-radius: 3px;
}

::selection {
    background: rgba(255, 107, 157, 0.3);
    color: white;
}