:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --bg: #fafafa;
    --bg-card: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

.nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-large {
    padding: 14px 28px;
    font-size: 1.1rem;
    width: 100%;
}

/* Hero */
.hero {
    padding: 60px 0 40px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero .highlight {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
}

/* Generator */
.generator {
    padding: 40px 0 80px;
}

.generator-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 48px;
    align-items: start;
}

.controls {
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

.control-group {
    margin-bottom: 24px;
}

.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.control-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.control-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Template Selector */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.template-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.template-btn:hover {
    border-color: var(--primary-light);
}

.template-btn.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    color: var(--text);
}

.template-btn.pro-template {
    opacity: 0.7;
}

.template-btn.pro-template:not(.unlocked) {
    position: relative;
}

.template-preview {
    width: 100%;
    height: 32px;
    border-radius: 4px;
}

.template-preview.gradient-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.template-preview.gradient-purple {
    background: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
}

.template-preview.gradient-green {
    background: linear-gradient(135deg, #059669 0%, #34d399 100%);
}

.template-preview.dark {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

.template-preview.gradient-sunset {
    background: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
}

.template-preview.gradient-ocean {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
}

/* Size Selector */
.size-selector {
    display: flex;
    gap: 8px;
}

.size-btn {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.size-btn:hover {
    border-color: var(--primary-light);
}

.size-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Actions */
.actions {
    margin-top: 32px;
}

.watermark-notice {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.watermark-notice a {
    color: var(--primary);
    text-decoration: none;
}

.watermark-notice a:hover {
    text-decoration: underline;
}

/* Preview */
.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-wrapper {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
}

#preview-canvas {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.preview-label {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Pricing */
.pricing {
    padding: 80px 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.pricing h2 {
    text-align: center;
    font-size: 2.25rem;
    margin-bottom: 8px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 48px;
}

.pricing-cards {
    display: flex;
    justify-content: center;
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.pricing-card {
    flex: 1;
    background: var(--bg);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    max-width: 320px;
}

.pricing-card.featured {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    position: relative;
    transform: scale(1.02);
}

.pricing-card .badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pricing-card h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.pricing-card .price {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.pricing-card .price-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.pricing-card .features {
    list-style: none;
    margin-bottom: 24px;
}

.pricing-card .features li {
    padding: 8px 0;
    font-size: 0.95rem;
}

.pricing-card .features li.muted {
    color: var(--text-muted);
}

.pricing-card .btn {
    width: 100%;
}

/* Footer */
.footer {
    padding: 32px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 900px) {
    .generator-layout {
        grid-template-columns: 1fr;
    }
    
    .controls {
        position: static;
    }
    
    .hero h1 {
        font-size: 2.25rem;
    }
}

@media (max-width: 600px) {
    .pricing-cards {
        flex-direction: column;
        align-items: center;
    }
    
    .pricing-card.featured {
        transform: none;
    }
    
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav a:not(.btn) {
        display: none;
    }
}

/* Pro Badge */
.pro-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Color Pickers */
.color-pickers {
    display: flex;
    gap: 16px;
}

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

.color-picker-item input[type="color"] {
    width: 48px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.color-picker-item input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-item input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-picker-item span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Logo Upload */
.logo-upload-area {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.logo-upload-area:hover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.03);
}

.logo-upload-area.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.logo-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.logo-upload-placeholder span:first-child {
    font-size: 1.5rem;
}

.logo-preview-container {
    position: relative;
    display: inline-block;
}

.logo-preview-container img {
    max-width: 100px;
    max-height: 60px;
    border-radius: 6px;
}

.remove-logo {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-position-selector {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-position-selector label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.logo-position-selector select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
}

/* Additional template previews */
.template-preview.midnight {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

.template-preview.aurora {
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 50%, #8b5cf6 100%);
}

.template-preview.candy {
    background: linear-gradient(135deg, #f472b6 0%, #c084fc 50%, #60a5fa 100%);
}

.template-preview.custom-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    position: relative;
}

.template-preview.custom-gradient::after {
    content: "🎨";
    position: absolute;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Pro feature locked state */
.pro-feature.locked {
    position: relative;
}

.pro-feature.locked::after {
    content: "🔒 Pro feature";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
}

/* Outline button variant */
.btn-outline {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}
