/**
 * Neon WooCommerce Editor v6.2 - iOS QUALITY
 * Canvas: 1920x1080 HD
 * Touch Targets: 56px (iOS superior standard)
 * Design: Apple-inspired premium experience
 */

@import url('https://fonts.googleapis.com/css2?family=Monoton&family=Bungee+Shade&family=Nabla&family=Rubik+Glitch&family=Orbitron:wght@700&family=Press+Start+2P&family=Audiowide&family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================
   iOS DESIGN SYSTEM
============================================ */
:root {
    /* iOS Colors */
    --ios-bg-primary: #000000;
    --ios-bg-secondary: #1c1c1e;
    --ios-bg-tertiary: #2c2c2e;
    --ios-bg-elevated: rgba(28, 28, 30, 0.95);
    
    /* Glass */
    --ios-glass: rgba(28, 28, 30, 0.72);
    --ios-glass-light: rgba(60, 60, 67, 0.18);
    
    /* Neon Colors */
    --neon-green: #00ff88;
    --neon-blue: #00ddff;
    --neon-purple: #b966ff;
    --neon-pink: #ff0088;
    --neon-yellow: #ffff00;
    
    /* Text */
    --ios-text-primary: #ffffff;
    --ios-text-secondary: rgba(235, 235, 245, 0.6);
    --ios-text-tertiary: rgba(235, 235, 245, 0.3);
    
    /* Borders & Separators */
    --ios-separator: rgba(84, 84, 88, 0.65);
    --ios-separator-opaque: rgba(56, 56, 58, 0.95);
    
    /* iOS 8pt Grid Spacing */
    --spacing-1: 8px;
    --spacing-2: 16px;
    --spacing-3: 24px;
    --spacing-4: 32px;
    --spacing-5: 40px;
    --spacing-6: 48px;
    --spacing-7: 56px;
    
    /* iOS Border Radius */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    
    /* iOS Animations - Spring curves */
    --spring-quick: cubic-bezier(0.5, 1.8, 0.3, 1);
    --spring-smooth: cubic-bezier(0.4, 0.0, 0.2, 1);
    --spring-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* iOS Touch Targets */
    --touch-mobile: 56px;
    --touch-desktop: 48px;
    
    /* iOS Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
    --shadow-xl: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}

/* ============================================
   RESET & BASE - iOS Style
============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.neon-ios-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Display', sans-serif;
    background: var(--ios-bg-primary);
    color: var(--ios-text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TOP STATS BAR - iOS Cards
============================================ */
.ios-stats-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2);
    background: var(--ios-glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid var(--ios-separator);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-3);
    background: var(--ios-glass-light);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    border: 0.5px solid var(--ios-separator);
    transition: transform 200ms var(--spring-smooth);
}

.stat-card:active {
    transform: scale(0.95);
}

.stat-emoji {
    font-size: 24px;
    line-height: 1;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--ios-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--neon-green);
    letter-spacing: -0.4px;
}

.stat-max {
    font-size: 15px;
    color: var(--ios-text-tertiary);
}

.price-card .stat-value {
    color: var(--neon-yellow);
    font-size: 19px;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
}

/* ============================================
   CANVAS CONTAINER - 1920x1080 HD
============================================ */
.canvas-container {
    flex: 1;
    position: relative;
    overflow: auto;
    background: var(--ios-bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-4);
    -webkit-overflow-scrolling: touch;
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
}

#neonCanvas {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    cursor: move;
    transition: transform 300ms var(--spring-smooth);
}

#neonCanvas:hover {
    transform: scale(1.005);
}

#neonCanvas:active {
    cursor: grabbing;
    transform: scale(1);
}

.drag-indicator {
    position: absolute;
    bottom: var(--spacing-3);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
    padding: var(--spacing-2) var(--spacing-3);
    background: var(--ios-glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-radius: var(--radius-xl);
    border: 0.5px solid var(--ios-separator);
    color: var(--ios-text-secondary);
    font-size: 13px;
    font-weight: 600;
    opacity: 0.8;
    transition: opacity 400ms var(--spring-smooth);
    pointer-events: none;
    box-shadow: var(--shadow-md);
}

.drag-indicator.hidden {
    opacity: 0;
}

.drag-indicator svg {
    width: 16px;
    height: 16px;
    color: var(--neon-green);
}

/* ============================================
   TEXT INPUT - iOS LARGE STYLE
============================================ */
.ios-text-input-section {
    padding: var(--spacing-3) var(--spacing-2);
    background: var(--ios-glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--ios-separator);
    border-bottom: 0.5px solid var(--ios-separator);
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 100;
}

.text-input-wrapper {
    width: 100%;
    max-width: 900px;
}

.ios-text-input {
    width: 100%;
    min-height: var(--touch-mobile);
    background: var(--ios-glass-light);
    border: 1px solid var(--ios-separator);
    border-radius: var(--radius-md);
    padding: var(--spacing-2) var(--spacing-3);
    font-size: 20px;
    font-weight: 500;
    color: var(--ios-text-primary);
    text-align: center;
    transition: all 300ms var(--spring-smooth);
    outline: none;
    font-family: inherit;
    letter-spacing: -0.2px;
}

.ios-text-input:hover {
    background: rgba(60, 60, 67, 0.25);
    border-color: rgba(0, 255, 136, 0.3);
}

.ios-text-input:focus {
    background: rgba(60, 60, 67, 0.3);
    border-color: var(--neon-green);
    box-shadow: 
        0 0 0 4px rgba(0, 255, 136, 0.1),
        0 4px 20px rgba(0, 255, 136, 0.15);
    transform: scale(1.01);
}

.ios-text-input::placeholder {
    color: var(--ios-text-tertiary);
    font-weight: 400;
}

/* ============================================
   BOTTOM TOOLBAR - iOS STYLE
============================================ */
.ios-toolbar {
    background: var(--ios-glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--ios-separator);
    padding: var(--spacing-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-2);
    position: relative;
    z-index: 90;
}

.toolbar-section {
    display: flex;
    gap: var(--spacing-1);
    flex-wrap: wrap;
}

.primary-section {
    flex: 1;
}

.actions-section {
    flex-shrink: 0;
}

/* ============================================
   iOS BUTTONS - LARGE TOUCH TARGETS
============================================ */
.ios-btn {
    min-width: var(--touch-desktop);
    min-height: var(--touch-desktop);
    background: var(--ios-glass-light);
    border: 0.5px solid var(--ios-separator);
    border-radius: var(--radius-md);
    padding: var(--spacing-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 250ms var(--spring-smooth);
    color: var(--ios-text-primary);
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ios-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 600ms, height 600ms;
}

.ios-btn:active::before {
    width: 300px;
    height: 300px;
}

.ios-btn:hover {
    background: rgba(60, 60, 67, 0.3);
    border-color: var(--neon-green);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-md);
}

.ios-btn:active {
    transform: scale(0.95);
}

.ios-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
    transition: transform 200ms var(--spring-bounce);
}

.ios-btn:hover svg {
    transform: scale(1.1);
}

.ios-btn span {
    white-space: nowrap;
    letter-spacing: 0.3px;
}

/* iOS Button Types */
.ios-btn.primary {
    background: var(--neon-green);
    border-color: var(--neon-green);
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.ios-btn.primary:hover {
    background: var(--neon-blue);
    border-color: var(--neon-blue);
    box-shadow: 0 0 25px rgba(0, 221, 255, 0.5);
}

.ios-btn.toggle-btn.active {
    background: var(--neon-green);
    border-color: var(--neon-green);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

/* ============================================
   iOS PANELS - SLIDE UP
============================================ */
.ios-panel-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
}

.ios-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 80vh;
    background: var(--ios-bg-elevated);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    transform: translateY(100%);
    transition: transform 400ms var(--spring-smooth);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.ios-panel.active {
    transform: translateY(0);
}

.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms var(--spring-smooth);
}

.panel-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Panel Header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-3);
    border-bottom: 0.5px solid var(--ios-separator);
}

.panel-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ios-text-primary);
    letter-spacing: -0.5px;
    margin: 0;
}

.panel-close {
    min-width: 32px;
    min-height: 32px;
    background: var(--ios-glass-light);
    border: 0.5px solid var(--ios-separator);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 200ms var(--spring-smooth);
    color: var(--ios-text-secondary);
    font-family: inherit;
}

.panel-close:hover {
    background: var(--neon-pink);
    border-color: var(--neon-pink);
    color: #000;
    transform: rotate(90deg);
}

.panel-close:active {
    transform: scale(0.9) rotate(90deg);
}

/* Panel Body */
.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-3);
    -webkit-overflow-scrolling: touch;
}

/* iOS Grid */
.ios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: var(--spacing-2);
}

.bg-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* ============================================
   iOS CARDS - TOUCH OPTIMIZED
============================================ */
.ios-card {
    min-height: 100px;
    background: var(--ios-glass-light);
    border: 1px solid var(--ios-separator);
    border-radius: var(--radius-md);
    padding: var(--spacing-2);
    cursor: pointer;
    transition: all 250ms var(--spring-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.ios-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 255, 136, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 300ms var(--spring-smooth);
}

.ios-card:hover {
    background: rgba(60, 60, 67, 0.3);
    border-color: var(--neon-green);
    transform: translateY(-4px) scale(1.03);
    box-shadow: var(--shadow-md);
}

.ios-card:hover::after {
    opacity: 1;
}

.ios-card:active {
    transform: scale(0.95);
}

.ios-card.active {
    background: rgba(0, 255, 136, 0.15);
    border-color: var(--neon-green);
    border-width: 2px;
    box-shadow: 
        0 0 0 4px rgba(0, 255, 136, 0.1),
        var(--shadow-lg);
}

.card-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ios-text-secondary);
    text-align: center;
    letter-spacing: 0.2px;
}

.ios-card.active .card-label {
    color: var(--neon-green);
}

/* Font Cards */
.font-preview {
    font-size: 36px;
    color: var(--neon-green);
    text-shadow: 0 0 15px var(--neon-green);
    line-height: 1;
}

/* Color Cards */
.color-swatch {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--ios-separator);
    transition: all 200ms var(--spring-bounce);
}

.ios-card:hover .color-swatch {
    transform: scale(1.1) rotate(5deg);
}

.ios-card.active .color-swatch {
    border-width: 3px;
    border-color: var(--neon-green);
    box-shadow: 0 0 15px currentColor;
}

/* Background Cards */
.bg-preview {
    width: 100%;
    height: 70px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--ios-separator);
}

/* Color Picker Section */
.color-picker-section {
    margin-top: var(--spacing-3);
    padding: var(--spacing-3);
    background: var(--ios-glass-light);
    border-radius: var(--radius-md);
    border: 0.5px solid var(--ios-separator);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.picker-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--ios-text-primary);
}

.ios-color-input {
    width: 80px;
    height: 48px;
    border: 2px solid var(--ios-separator);
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    transition: all 200ms var(--spring-smooth);
}

.ios-color-input:hover {
    border-color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    transform: scale(1.05);
}

/* ============================================
   SIZE LIST - iOS STYLE
============================================ */
.size-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.ios-size-card {
    min-height: 80px;
    background: var(--ios-glass-light);
    border: 1px solid var(--ios-separator);
    border-radius: var(--radius-md);
    padding: var(--spacing-3);
    cursor: pointer;
    transition: all 250ms var(--spring-smooth);
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    font-family: inherit;
    position: relative;
}

.ios-size-card:hover {
    background: rgba(60, 60, 67, 0.3);
    border-color: var(--neon-green);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.ios-size-card:active {
    transform: scale(0.98);
}

.ios-size-card.active {
    background: rgba(0, 255, 136, 0.15);
    border-color: var(--neon-green);
    border-width: 2px;
    box-shadow: var(--shadow-lg);
}

.size-info {
    flex: 1;
}

.size-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--ios-text-primary);
    letter-spacing: -0.4px;
    margin-bottom: 4px;
}

.size-desc {
    font-size: 13px;
    color: var(--ios-text-secondary);
}

.size-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
    letter-spacing: -0.5px;
}

.size-check {
    width: 32px;
    height: 32px;
    background: var(--neon-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 300ms var(--spring-bounce);
}

.ios-size-card.active .size-check {
    opacity: 1;
    transform: scale(1);
}

.size-check svg {
    color: #000;
}

/* ============================================
   LOADING - iOS STYLE
============================================ */
.ios-loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--spacing-3);
}

.ios-loading.visible {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 255, 136, 0.2);
    border-top-color: var(--neon-green);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ios-loading p {
    font-size: 17px;
    font-weight: 600;
    color: var(--ios-text-primary);
}

/* ============================================
   RESPONSIVE - iOS BREAKPOINTS
============================================ */

/* Large Desktop */
@media (min-width: 1440px) {
    .ios-toolbar {
        max-width: 1600px;
        margin: 0 auto;
    }
    
    .ios-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .ios-toolbar {
        flex-wrap: wrap;
    }
    
    .toolbar-section {
        flex: 1 1 100%;
        justify-content: center;
    }
}

/* Mobile - LARGE TOUCH TARGETS */
@media (max-width: 767px) {
    /* Stats Bar */
    .ios-stats-bar {
        flex-wrap: wrap;
        gap: var(--spacing-1);
    }
    
    .stat-card {
        flex: 1 1 calc(50% - var(--spacing-1));
        min-width: 140px;
    }
    
    /* Text Input */
    .ios-text-input {
        font-size: 16px; /* Prevent iOS zoom */
        min-height: var(--touch-mobile);
    }
    
    /* Toolbar */
    .ios-toolbar {
        flex-direction: column;
        padding: var(--spacing-2);
        gap: var(--spacing-2);
    }
    
    .toolbar-section {
        width: 100%;
        justify-content: center;
    }
    
    .primary-section {
        order: 1;
    }
    
    .actions-section {
        order: 2;
    }
    
    /* iOS Buttons - MOBILE SIZE */
    .ios-btn {
        min-width: var(--touch-mobile);
        min-height: var(--touch-mobile);
        flex: 1;
    }
    
    .ios-btn span {
        font-size: 10px;
    }
    
    /* Panels */
    .ios-panel {
        max-height: 85vh;
    }
    
    .ios-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: var(--spacing-1);
    }
    
    .bg-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
    
    /* Canvas */
    .canvas-container {
        padding: var(--spacing-2);
    }
}

/* Extra Small Mobile */
@media (max-width: 374px) {
    .stat-card {
        flex: 1 1 100%;
    }
    
    .ios-btn {
        min-width: 48px;
        min-height: 48px;
    }
    
    .ios-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* ============================================
   ACCESSIBILITY & POLISH
============================================ */

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--neon-green);
    outline-offset: 2px;
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support (already dark) */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* Print */
@media print {
    .ios-toolbar,
    .ios-panel-container,
    .ios-stats-bar,
    .ios-text-input-section {
        display: none !important;
    }
}
