/**
 * Achievement Unlocked Generator - Premium Layout
 * DigitalPrank.com
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Brand Colors */
    --primary-purple: #7c3aed;
    --primary-purple-dark: #5b21b6;
    --primary-purple-light: #8b5cf6;
    --etsy-purple: #6621a5;
    --premium-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --premium-purple: #667eea;
    --premium-purple-dark: #764ba2;
    
    /* Background Colors */
    --bg-dark: #0f0f1a;
    --bg-darker: #0a0a12;
    --bg-panel: #151520;
    --bg-card: #1a1a28;
    --bg-input: #12121c;
    --bg-hover: #1f1f30;
    
    /* Text Colors */
    --text-white: #ffffff;
    --text-gray: #a0a0a0;
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-dim: rgba(255, 255, 255, 0.3);
    
    /* Border Colors */
    --border-color: #2a2a3a;
    --border-light: #3a3a4a;
    --border-active: #7c3aed;
    
    /* Status Colors */
    --success-color: #4CAF50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --gold-color: #FFD700;
    
    /* Spacing */
    --panel-width: 320px;
    --section-gap: 20px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ========================================
   Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
    line-height: 1.5;
}

/* ========================================
   Etsy Banner
   ======================================== */
#etsy-banner {
    background: var(--etsy-purple);
    color: var(--text-white);
    padding: 12px 0;
    text-align: center;
}

#etsy-banner .banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

#etsy-banner .banner-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
}

#etsy-banner .input-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

#etsy-code-input {
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    font-size: 13px;
    text-transform: uppercase;
    width: 160px;
    text-align: center;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    transition: var(--transition-fast);
}

#etsy-code-input:focus {
    outline: none;
    border-color: var(--text-white);
    background: rgba(255, 255, 255, 0.15);
}

#etsy-code-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#etsy-validate-btn {
    padding: 8px 20px;
    background: var(--text-white);
    color: var(--etsy-purple);
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

#etsy-validate-btn:hover {
    transform: scale(1.02);
}

.etsy-skip-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition-fast);
}

.etsy-skip-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#etsy-message {
    margin-top: 8px;
    font-size: 12px;
    min-height: 18px;
}

#etsy-message .error { color: #ffcdd2; }
#etsy-message .success { color: #c8e6c9; }

#etsy-active-mode {
    display: none;
}

#etsy-active-mode p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.etsy-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.etsy-clear-btn {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    color: var(--text-white);
    cursor: pointer;
    font-size: 12px;
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-dark) 100%);
    padding: 30px 0 25px;
    color: var(--text-white);
    text-align: center;
}

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

.hero-container h1 {
    font-family: 'Fraunces', serif;
    font-size: 2rem;
    margin-bottom: 6px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* ========================================
   Main Layout
   ======================================== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.editor-layout {
    display: grid;
    grid-template-columns: var(--panel-width) 1fr;
    gap: 24px;
    min-height: calc(100vh - 280px);
}

/* ========================================
   Left Panel - Editor Controls
   ======================================== */
.editor-panel {
    display: flex;
    flex-direction: column;
    gap: var(--section-gap);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.editor-panel::-webkit-scrollbar {
    width: 6px;
}

.editor-panel::-webkit-scrollbar-track {
    background: transparent;
}

.editor-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.editor-panel::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Panel Sections */
.panel-section {
    background: var(--bg-panel);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.section-header {
    margin-bottom: 12px;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-purple);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

/* ========================================
   Style Selector Section
   ======================================== */
.style-category-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.style-cat-tab {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-gray);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.style-cat-tab:hover {
    border-color: var(--border-light);
    color: var(--text-white);
}

.style-cat-tab.active {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: var(--text-white);
}

/* Style Grid */
.style-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.style-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-fast);
}

.style-card:hover {
    border-color: var(--primary-purple);
    transform: translateY(-2px);
}

.style-card.active {
    border-color: var(--primary-purple);
    background: rgba(16, 124, 16, 0.15);
}

.style-card.premium {
    border-color: rgba(255, 215, 0, 0.3);
}

.style-card.premium:hover {
    border-color: var(--gold-color);
}

.style-card.locked {
    opacity: 0.6;
}

.style-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    opacity: 0.8;
}

.style-card .premium-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    color: var(--gold-color);
}

.style-card-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.style-card-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-white);
    text-align: center;
    margin-bottom: 6px;
}

.style-card-swatch {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

/* ========================================
   Quick Templates Section
   ======================================== */
.template-category-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 10px;
    scrollbar-width: none;
}

.template-category-pills::-webkit-scrollbar {
    display: none;
}

.template-cat-pill {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-gray);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.template-cat-pill:hover {
    border-color: var(--border-light);
    color: var(--text-white);
}

.template-cat-pill.active {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: var(--text-white);
}

/* Template Carousel */
.template-carousel-wrapper {
    overflow: hidden;
    margin: 0 -8px;
    padding: 0 8px;
}

.template-carousel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.template-carousel::-webkit-scrollbar {
    display: none;
}

.template-card {
    flex: 0 0 140px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    scroll-snap-align: start;
    transition: var(--transition-fast);
}

.template-card:hover {
    border-color: var(--primary-purple);
    transform: scale(1.02);
}

.template-card-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.template-card-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-card-desc {
    font-size: 9px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   Customize Section
   ======================================== */
.form-group {
    margin-bottom: 14px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-white);
    font-size: 13px;
    transition: var(--transition-fast);
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-purple);
    background: var(--bg-card);
}

/* Input with Counter */
.input-with-counter {
    position: relative;
}

.input-with-counter input {
    padding-right: 50px;
}

.char-counter {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--text-muted);
}

/* Points Quick Select */
.points-quick-select {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.points-btn {
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-gray);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.points-btn:hover {
    border-color: var(--border-light);
    color: var(--text-white);
}

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

.points-custom-input {
    margin-top: 6px;
}

/* Icon Picker */
.icon-picker-row {
    display: flex;
    gap: 8px;
}

.icon-input {
    width: 60px !important;
    text-align: center;
    font-size: 20px !important;
}

.btn-browse-icons {
    flex: 1;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-gray);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-browse-icons:hover {
    border-color: var(--primary-purple);
    color: var(--text-white);
}

/* Trophy Level Options */
.trophy-level-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.trophy-option {
    display: block;
    cursor: pointer;
}

.trophy-option input {
    display: none;
}

.trophy-badge {
    display: block;
    padding: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.trophy-option input:checked + .trophy-badge {
    border-color: var(--primary-purple);
    background: rgba(16, 124, 16, 0.15);
}

.trophy-badge.bronze { color: #CD7F32; }
.trophy-badge.silver { color: #C0C0C0; }
.trophy-badge.gold { color: #FFD700; }
.trophy-badge.platinum { color: #E5E4E2; }

/* ========================================
   Sound & Animation Section
   ======================================== */
.sound-toggle-group .toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    transition: var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-gray);
    border-radius: 50%;
    transition: var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: var(--text-white);
}

.sound-select {
    flex: 1;
}

.animation-select-row {
    display: flex;
    gap: 8px;
}

.animation-select-row select {
    flex: 1;
}

.btn-preview-anim {
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-white);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.btn-preview-anim:hover {
    border-color: var(--primary-purple);
    background: var(--bg-hover);
}

.btn-preview-anim .play-icon {
    font-size: 10px;
    color: var(--primary-purple);
}

/* ========================================
   Download Section
   ======================================== */
.download-section {
    background: linear-gradient(180deg, var(--bg-panel) 0%, rgba(102, 126, 234, 0.1) 100%);
}

.btn-download-primary {
    width: 100%;
    padding: 14px 20px;
    background: var(--premium-gradient);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-white);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition-fast);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-download-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-download-primary.free {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-dark) 100%);
    box-shadow: 0 4px 15px rgba(16, 124, 16, 0.3);
}

.btn-download-primary .btn-price {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 12px;
}

.download-secondary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.btn-download-secondary {
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-white);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
}

.btn-download-secondary:hover {
    border-color: var(--premium-purple);
    background: var(--bg-hover);
}

.btn-download-secondary .btn-icon {
    font-size: 18px;
}

.btn-download-secondary .btn-price {
    font-size: 10px;
    color: var(--text-muted);
}

.btn-download-bundle {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 2px solid var(--premium-purple);
    border-radius: var(--border-radius);
    color: var(--text-white);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    position: relative;
    transition: var(--transition-fast);
}

.btn-download-bundle:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
}

.btn-download-bundle .bundle-label {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px;
    background: var(--gold-color);
    color: #000;
    font-size: 9px;
    font-weight: 700;
    border-radius: 3px;
    text-transform: uppercase;
}

.btn-download-bundle .btn-price {
    margin-left: 8px;
    opacity: 0.8;
}

.watermark-note {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin: 12px 0 6px;
}

.btn-download-free {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-gray);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-download-free:hover {
    border-color: var(--border-light);
    color: var(--text-white);
}

.etsy-note {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

.etsy-note.active {
    color: var(--success-color);
    font-weight: 600;
}
/* ========================================
   Right Panel - Preview Area
   ======================================== */
.preview-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 20px;
    align-self: start;
}

.preview-area {
    background: var(--bg-panel);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.preview-background {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 default */
    border-radius: var(--border-radius);
    overflow: hidden;
    /* Checkerboard transparency pattern */
    background-image: 
        linear-gradient(45deg, #1a1a28 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a28 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1a28 75%),
        linear-gradient(-45deg, transparent 75%, #1a1a28 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #12121c;
}

.preview-background[data-ratio="1:1"] {
    padding-top: 100%;
}

.preview-background[data-ratio="9:16"] {
    padding-top: 177.78%;
    max-height: 500px;
}

.preview-background[data-ratio="16:9"] {
    padding-top: 56.25%;
}

.preview-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Achievement Preview Card - Base */
#achievement-preview {
    width: 100%;
    max-width: 420px;
    transform-origin: center;
}

/* ========================================
   Aspect Ratio Toggles
   ======================================== */
.aspect-ratio-section {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.aspect-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.aspect-ratio-toggles {
    display: flex;
    gap: 6px;
}

.aspect-btn {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-gray);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.aspect-btn:hover {
    border-color: var(--border-light);
    color: var(--text-white);
}

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

.aspect-btn .aspect-icon {
    font-size: 14px;
}

/* ========================================
   Play Animation Button
   ======================================== */
.btn-play-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-panel);
    border: 2px solid var(--primary-purple);
    border-radius: var(--border-radius);
    color: var(--primary-purple);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    margin: 0 auto;
}

.btn-play-animation:hover {
    background: var(--primary-purple);
    color: var(--text-white);
}

.btn-play-animation .play-icon {
    font-size: 12px;
}

/* ========================================
   Social Share Section
   ======================================== */
.social-share-section {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.share-btn {
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-gray);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.share-btn:hover {
    border-color: var(--border-light);
    color: var(--text-white);
    background: var(--bg-hover);
}

.share-btn .share-icon {
    font-size: 14px;
}

/* ========================================
   Mobile Bottom Bar
   ======================================== */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.mobile-download-btn {
    width: 100%;
    padding: 14px;
    background: var(--premium-gradient);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-white);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mobile-download-btn .mobile-price {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 12px;
}

/* ========================================
   Icon Picker Modal
   ======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-panel);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-gray);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-white);
}

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    max-height: calc(80vh - 70px);
}

/* Icon Categories in Modal */
.icon-categories {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.icon-cat-btn {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-gray);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.icon-cat-btn:hover {
    border-color: var(--border-light);
    color: var(--text-white);
}

.icon-cat-btn.active {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: var(--text-white);
}

/* Icon Grid in Modal */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.icon-grid-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.icon-grid-item:hover {
    border-color: var(--primary-purple);
    transform: scale(1.1);
    background: var(--bg-hover);
}

/* ========================================
   Achievement Base Styles
   ======================================== */
.achievement {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 8px;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: var(--transition-normal);
}

.achievement .ach-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.achievement .ach-content {
    flex: 1;
    min-width: 0;
}

.achievement .ach-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 2px;
}

.achievement .ach-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.achievement .ach-desc {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.achievement .ach-points {
    font-size: 13px;
    font-weight: 700;
}

/* ========================================
   Achievement Style: Xbox (Default)
   ======================================== */
.achievement.xbox {
    background: linear-gradient(135deg, #107C10 0%, #0e5c0e 100%);
    color: #ffffff;
}

.achievement.xbox .ach-icon {
    background: rgba(255, 255, 255, 0.15);
}

.achievement.xbox .ach-points {
    color: #7FFF00;
}

/* ========================================
   Achievement Style: PlayStation
   ======================================== */
.achievement.playstation {
    background: linear-gradient(135deg, #003087 0%, #00246B 100%);
    color: #ffffff;
}

.achievement.playstation .ach-icon {
    background: rgba(255, 255, 255, 0.1);
}

.achievement.playstation .ach-points {
    color: #FFD700;
}

/* Trophy Level Variations */
.achievement.playstation.trophy-bronze .ach-points { color: #CD7F32; }
.achievement.playstation.trophy-silver .ach-points { color: #C0C0C0; }
.achievement.playstation.trophy-gold .ach-points { color: #FFD700; }
.achievement.playstation.trophy-platinum .ach-points { color: #E5E4E2; }

/* ========================================
   Achievement Style: Steam
   ======================================== */
.achievement.steam {
    background: linear-gradient(135deg, #1b2838 0%, #171a21 100%);
    color: #c6d4df;
    border: 1px solid #2a475e;
}

.achievement.steam .ach-icon {
    background: #2a475e;
}

.achievement.steam .ach-points {
    color: #66c0f4;
}

/* ========================================
   Achievement Style: Nintendo
   ======================================== */
.achievement.nintendo {
    background: linear-gradient(135deg, #E60012 0%, #c0000f 100%);
    color: #ffffff;
}

.achievement.nintendo .ach-icon {
    background: rgba(255, 255, 255, 0.2);
}

.achievement.nintendo .ach-points {
    color: #fff;
}

/* ========================================
   Achievement Style: Discord
   ======================================== */
.achievement.discord {
    background: linear-gradient(135deg, #5865F2 0%, #4752c4 100%);
    color: #ffffff;
    border-radius: 12px;
}

.achievement.discord .ach-icon {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

.achievement.discord .ach-points {
    color: #00d26a;
}

/* ========================================
   Achievement Style: Retro 8-bit
   ======================================== */
.achievement.retro-8bit {
    background: #000;
    color: #33ff33;
    border: 4px solid #33ff33;
    font-family: 'Press Start 2P', monospace;
    image-rendering: pixelated;
}

.achievement.retro-8bit .ach-icon {
    background: #111;
    border: 2px solid #33ff33;
    border-radius: 0;
}

.achievement.retro-8bit .ach-title {
    font-size: 8px;
    letter-spacing: 0;
}

.achievement.retro-8bit .ach-name {
    font-size: 12px;
}

.achievement.retro-8bit .ach-desc {
    font-size: 8px;
}

.achievement.retro-8bit .ach-points {
    color: #ffff00;
    font-size: 10px;
}

/* ========================================
   Achievement Style: Arcade
   ======================================== */
.achievement.arcade {
    background: linear-gradient(180deg, #2d0059 0%, #1a0033 100%);
    color: #ff00ff;
    border: 3px solid #ff00ff;
    font-family: 'Bangers', cursive;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.5), inset 0 0 20px rgba(255, 0, 255, 0.1);
}

.achievement.arcade .ach-icon {
    background: #1a0033;
    border: 2px solid #00ffff;
    box-shadow: 0 0 10px #00ffff;
}

.achievement.arcade .ach-name {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

.achievement.arcade .ach-points {
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00;
}

/* ========================================
   Achievement Style: Neon Cyberpunk
   ======================================== */
.achievement.neon-cyberpunk {
    background: linear-gradient(135deg, #0d0221 0%, #150734 100%);
    color: #00fff9;
    border: 2px solid #ff00ff;
    font-family: 'Orbitron', sans-serif;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.3), 0 0 60px rgba(0, 255, 249, 0.2);
}

.achievement.neon-cyberpunk .ach-icon {
    background: transparent;
    border: 2px solid #00fff9;
    box-shadow: 0 0 15px #00fff9;
}

.achievement.neon-cyberpunk .ach-title {
    color: #ff00ff;
}

.achievement.neon-cyberpunk .ach-name {
    text-shadow: 0 0 10px #00fff9, 0 0 20px #00fff9;
}

.achievement.neon-cyberpunk .ach-points {
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
}

/* ========================================
   Achievement Style: Gold Luxury
   ======================================== */
.achievement.gold-luxury {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    color: #FFD700;
    border: 3px solid;
    border-image: linear-gradient(135deg, #FFD700, #FFA500, #FFD700) 1;
    font-family: 'Playfair Display', serif;
}

.achievement.gold-luxury .ach-icon {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a1a;
}

.achievement.gold-luxury .ach-name {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.achievement.gold-luxury .ach-points {
    color: #FFA500;
}

/* ========================================
   Achievement Style: Minimalist Dark
   ======================================== */
.achievement.minimalist-dark {
    background: #1a1a1a;
    color: #ffffff;
    border: 1px solid #333;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
}

.achievement.minimalist-dark .ach-icon {
    background: #333;
    border-radius: 4px;
}

.achievement.minimalist-dark .ach-points {
    color: #888;
}

/* ========================================
   Achievement Style: Minimalist Light
   ======================================== */
.achievement.minimalist-light {
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
}

.achievement.minimalist-light .ach-icon {
    background: #f5f5f5;
    border-radius: 4px;
}

.achievement.minimalist-light .ach-points {
    color: #666;
}

/* ========================================
   Achievement Style: Twitch
   ======================================== */
.achievement.twitch {
    background: linear-gradient(135deg, #9146FF 0%, #772ce8 100%);
    color: #ffffff;
    border-radius: 8px;
}

.achievement.twitch .ach-icon {
    background: rgba(255, 255, 255, 0.15);
}

.achievement.twitch .ach-points {
    color: #00ffb3;
}

/* ========================================
   Achievement Style: YouTube
   ======================================== */
.achievement.youtube {
    background: linear-gradient(135deg, #FF0000 0%, #cc0000 100%);
    color: #ffffff;
    border-radius: 8px;
}

.achievement.youtube .ach-icon {
    background: rgba(255, 255, 255, 0.2);
}

.achievement.youtube .ach-points {
    color: #fff;
}

/* ========================================
   Achievement Style: TikTok
   ======================================== */
.achievement.tiktok {
    background: linear-gradient(135deg, #010101 0%, #161823 100%);
    color: #ffffff;
    border-radius: 12px;
}

.achievement.tiktok .ach-icon {
    background: linear-gradient(135deg, #25F4EE, #FE2C55);
}

.achievement.tiktok .ach-name {
    background: linear-gradient(90deg, #25F4EE, #FE2C55);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.achievement.tiktok .ach-points {
    color: #25F4EE;
}

/* ========================================
   Achievement Style: Reddit
   ======================================== */
.achievement.reddit {
    background: linear-gradient(135deg, #FF4500 0%, #cc3700 100%);
    color: #ffffff;
    border-radius: 8px;
}

.achievement.reddit .ach-icon {
    background: #fff;
    color: #FF4500;
}

.achievement.reddit .ach-points {
    color: #ffcc00;
}

/* ========================================
   Achievement Style: Comic Book
   ======================================== */
.achievement.comic-book {
    background: linear-gradient(135deg, #ffeb3b 0%, #ffc107 100%);
    color: #000;
    border: 4px solid #000;
    font-family: 'Bangers', cursive;
    box-shadow: 6px 6px 0 #000;
}

.achievement.comic-book .ach-icon {
    background: #fff;
    border: 3px solid #000;
}

.achievement.comic-book .ach-name {
    text-transform: uppercase;
    letter-spacing: 2px;
}

.achievement.comic-book .ach-points {
    color: #f44336;
}

/* ========================================
   Achievement Style: Kawaii
   ======================================== */
.achievement.kawaii {
    background: linear-gradient(135deg, #FFB6C1 0%, #FF69B4 100%);
    color: #fff;
    border: 3px solid #fff;
    border-radius: 20px;
    font-family: 'Quicksand', sans-serif;
}

.achievement.kawaii .ach-icon {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.achievement.kawaii .ach-points {
    color: #fff;
}

/* ========================================
   Achievement Style: Dark Souls
   ======================================== */
.achievement.dark-souls {
    background: linear-gradient(135deg, #1a1410 0%, #0d0a08 100%);
    color: #d4a33e;
    border: 2px solid #d4a33e;
    font-family: 'Cinzel', serif;
}

.achievement.dark-souls .ach-icon {
    background: transparent;
    border: 2px solid #d4a33e;
}

.achievement.dark-souls .ach-title {
    text-transform: uppercase;
    letter-spacing: 3px;
}

.achievement.dark-souls .ach-name {
    color: #fff;
}

.achievement.dark-souls .ach-points {
    color: #d4a33e;
}

/* ========================================
   Achievement Style: PC Master Race
   ======================================== */
.achievement.pc-master {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6600 100%);
    color: #fff;
    border: 2px solid #fff;
}

.achievement.pc-master .ach-icon {
    background: rgba(0, 0, 0, 0.3);
}

.achievement.pc-master .ach-points {
    color: #fff;
}

/* ========================================
   Achievement Style: Dramatic
   ======================================== */
.achievement.dramatic {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e94560;
    border: none;
    font-family: 'Bebas Neue', sans-serif;
    box-shadow: 0 10px 40px rgba(233, 69, 96, 0.3);
}

.achievement.dramatic .ach-icon {
    background: #e94560;
    color: #fff;
}

.achievement.dramatic .ach-title {
    letter-spacing: 4px;
}

.achievement.dramatic .ach-name {
    font-size: 24px;
    color: #fff;
}

.achievement.dramatic .ach-points {
    color: #e94560;
}

/* ========================================
   Animations - Keyframes
   ======================================== */
@keyframes slide-in {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes pop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes bounce {
    0% { transform: translateY(-100%); opacity: 0; }
    50% { transform: translateY(10px); }
    70% { transform: translateY(-5px); }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes fade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 3px); }
    40% { transform: translate(-3px, -3px); }
    60% { transform: translate(3px, 3px); }
    80% { transform: translate(3px, -3px); }
    100% { transform: translate(0); }
}

@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        box-shadow: 
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 30px currentColor;
        opacity: 1;
    }
    20%, 24%, 55% {
        box-shadow: none;
        opacity: 0.8;
    }
}

@keyframes pixel-flash {
    0% { filter: brightness(1); }
    50% { filter: brightness(2) saturate(1.5); }
    100% { filter: brightness(1); }
}

@keyframes gold-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes rgb-border {
    0% { border-color: #ff0000; }
    33% { border-color: #00ff00; }
    66% { border-color: #0000ff; }
    100% { border-color: #ff0000; }
}

@keyframes crt-flicker {
    0% { opacity: 0.95; }
    50% { opacity: 1; }
    100% { opacity: 0.95; }
}

/* Animation Classes */
.animate-slide-in { animation: slide-in 0.5s ease-out forwards; }
.animate-pop { animation: pop 0.4s ease-out forwards; }
.animate-bounce { animation: bounce 0.6s ease-out forwards; }
.animate-fade { animation: fade 0.4s ease-out forwards; }
.animate-glitch { animation: glitch 0.3s ease-in-out 3; }
.animate-neon-flicker { animation: neon-flicker 1.5s ease-in-out; }
.animate-pixel-flash { animation: pixel-flash 0.3s ease-out 2; }
.animate-gold-shimmer { 
    background-size: 200% 100%;
    animation: gold-shimmer 2s linear infinite;
}

/* ========================================
   Responsive Design - Tablet
   ======================================== */
@media (max-width: 1024px) {
    .editor-layout {
        grid-template-columns: 280px 1fr;
        gap: 16px;
    }
    
    .main-container {
        padding: 16px;
    }
    
    .hero-container h1 {
        font-size: 1.75rem;
    }
}

/* ========================================
   Responsive Design - Mobile
   ======================================== */
@media (max-width: 768px) {
    :root {
        --section-gap: 12px;
    }
    
    .editor-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Preview at top on mobile */
    .preview-panel {
        order: -1;
        position: relative;
        top: 0;
    }
    
    .preview-area {
        padding: 12px;
    }
    
    .preview-background {
        padding-top: 56.25%;
    }
    
    .preview-background[data-ratio="9:16"] {
        padding-top: 100%;
        max-height: none;
    }
    
    /* Editor panel full width */
    .editor-panel {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
    
    .panel-section {
        padding: 14px;
    }
    
    /* Style grid single column on small screens */
    .style-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Template cards smaller */
    .template-card {
        flex: 0 0 120px;
    }
    
    /* Hide desktop download section */
    .download-section {
        display: none;
    }
    
    /* Show mobile bottom bar */
    .mobile-bottom-bar {
        display: block;
    }
    
    /* Add padding for fixed bottom bar */
    body {
        padding-bottom: 80px;
    }
    
    /* Hero adjustments */
    .hero-section {
        padding: 20px 0;
    }
    
    .hero-container h1 {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.875rem;
    }
    
    /* Etsy banner stacked */
    #etsy-banner .input-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    #etsy-code-input {
        width: 100%;
    }
    
    /* Social share smaller */
    .social-share-section {
        flex-wrap: wrap;
    }
    
    .share-btn {
        flex: 1;
        min-width: 90px;
        padding: 8px 12px;
        font-size: 11px;
    }
    
    /* Aspect ratio toggles */
    .aspect-ratio-section {
        flex-direction: column;
        gap: 8px;
    }
    
    /* Icon modal full screen on mobile */
    .modal-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .icon-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ========================================
   Responsive Design - Small Mobile
   ======================================== */
@media (max-width: 480px) {
    .main-container {
        padding: 12px;
    }
    
    .style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .template-card {
        flex: 0 0 100px;
    }
    
    .points-quick-select {
        gap: 4px;
    }
    
    .points-btn {
        padding: 5px 8px;
        font-size: 9px;
    }
    
    .icon-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .trophy-level-options {
        grid-template-columns: 1fr 1fr;
    }
    
    .trophy-badge {
        font-size: 10px;
        padding: 6px;
    }
}

/* ========================================
   Accordion Styles for Mobile
   ======================================== */
@media (max-width: 768px) {
    .panel-section {
        border-radius: var(--border-radius);
    }
    
    .section-header {
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 0;
    }
    
    .section-header::after {
        content: '▼';
        font-size: 10px;
        color: var(--text-muted);
        transition: var(--transition-fast);
    }
    
    .panel-section.collapsed .section-header::after {
        transform: rotate(-90deg);
    }
    
    .panel-section.collapsed > *:not(.section-header) {
        display: none;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.hidden { display: none !important; }
.visible { display: block !important; }
.flex { display: flex !important; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-white);
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 6px;
}
