/* ============================================
   IMPREXA - 3D T-Shirt Editor
   Simplified Modern Design with Bootstrap 5.3
   ============================================ */

:root {
    /* Colors */
    --primary-color: #6366f1;
    --primary-rgb: 99, 102, 241;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    
    /* Neutral */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --border-color: #e2e8f0;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --navbar-height: 70px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
}

/* Dark Mode */
[data-bs-theme="dark"] {
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --border-color: #334155;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* ============================================
   BASE
   ============================================ */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-base), color var(--transition-base);
}

html {
    scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    padding: 1rem 0;
    background-color: transparent;
    transition: all var(--transition-base);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

[data-bs-theme="dark"] .navbar.scrolled {
    background: rgba(15, 23, 42, 0.9) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
}

.logo-icon {
    font-size: 2rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    color: var(--text-secondary) !important;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Theme Toggle */
.btn-theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.btn-theme-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.theme-icon-light,
.theme-icon-dark {
    position: absolute;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
}

.theme-icon-light {
    color: #f59e0b;
}

.theme-icon-dark {
    color: #6366f1;
}

[data-bs-theme="light"] .theme-icon-dark {
    opacity: 0;
    transform: scale(0);
}

[data-bs-theme="dark"] .theme-icon-light {
    opacity: 0;
    transform: scale(0);
}

[data-bs-theme="light"] .theme-icon-light {
    opacity: 1;
    transform: scale(1);
}

[data-bs-theme="dark"] .theme-icon-dark {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(var(--primary-rgb), 0.03) 0%, 
        rgba(139, 92, 246, 0.03) 100%);
    padding-top: calc(var(--navbar-height) + 2rem);
    min-height: auto;
}

.hero-icons i {
    animation: float 3s ease-in-out infinite;
}

/* ============================================
   PRODUCTS SECTION
   ============================================ */

.products-section {
    background-color: var(--bg-primary);
}

.product-category {
    transition: all var(--transition-base);
    cursor: pointer;
}

.product-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.product-list li {
    font-size: 0.9rem;
}

.hero-title {
    animation: fadeInUp 0.8s ease;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.6;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    font-weight: 600;
    transition: all var(--transition-base);
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

/* ============================================
   3D EDITOR SECTION
   ============================================ */

.editor-section {
    background-color: var(--bg-secondary);
}

#canvas-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] #canvas-container {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#tshirt-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.canvas-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10;
}

[data-bs-theme="dark"] .canvas-loading {
    background: rgba(15, 23, 42, 0.95);
}

.canvas-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

.canvas-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 5;
}

.canvas-controls .btn {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all var(--transition-fast);
}

.canvas-controls .btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.3);
    background: white;
}

.canvas-controls .btn i {
    font-size: 1.2rem;
    color: var(--text-primary);
}

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

.canvas-controls .btn.active i {
    color: white;
}

[data-bs-theme="dark"] .canvas-controls .btn {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .canvas-controls .btn:hover {
    background: var(--bg-secondary);
}

/* ============================================
   EDITOR PANEL
   ============================================ */

.editor-panel {
    position: sticky;
    top: calc(var(--navbar-height) + 1rem);
}

/* Upload Container - Estilo Pacdora */
.upload-container {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 3rem 1.5rem;
    text-align: center;
    transition: all var(--transition-base);
    cursor: pointer;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.02) 0%, rgba(var(--primary-rgb), 0.05) 100%);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-container:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08) 0%, rgba(var(--primary-rgb), 0.12) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.15);
}

.upload-label {
    cursor: pointer;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-container i {
    color: var(--primary-color);
    opacity: 0.8;
    display: block;
    transition: all var(--transition-fast);
}

.upload-container:hover i {
    opacity: 1;
    transform: translateY(-4px);
}

/* Image Preview Container - Estilo mejorado */
.image-preview-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
    padding: 0.5rem;
}

.preview-image-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: all var(--transition-fast);
}

.preview-image-wrapper:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.preview-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.95);
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-fast);
    z-index: 10;
}

.remove-image-btn:hover {
    background: rgb(220, 38, 38);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

/* Product Selector */
/* Color Picker */
.color-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.color-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.color-option:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-md);
}

.color-option.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.3);
    transform: scale(1.05);
}

.color-option.active::after {
    content: '\F26B';
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.1rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8), 0 0 10px rgba(0,0,0,0.5);
    font-weight: bold;
}

/* ============================================
   PROCESS SECTION
   ============================================ */

.process-card {
    padding: 2rem;
    transition: transform var(--transition-base);
}

.process-card:hover {
    transform: translateY(-5px);
}

.process-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* ============================================
   PRICING SECTION
   ============================================ */

.pricing-section {
    background-color: var(--bg-primary);
}

.pricing-card {
    transition: all var(--transition-base);
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.pricing-card-featured {
    border: 2px solid var(--primary-color) !important;
    transform: scale(1.05);
}

.pricing-card-featured:hover {
    transform: scale(1.08) translateY(-10px);
}

.card-ribbon {
    position: absolute;
    top: 1rem;
    right: -0.5rem;
    z-index: 1;
}

.card-ribbon .badge {
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow-md);
}

/* ============================================
   FOOTER
   ============================================ */

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

.social-links {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    justify-content: md-end;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.social-link:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-3px);
}

/* ============================================
   WHATSAPP FLOATING BUTTON
   ============================================ */

.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25d366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: all var(--transition-base);
    animation: pulse-whatsapp 2s infinite;
}

.whatsapp-float:hover {
    background: #128c7e;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

@keyframes pulse-whatsapp {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.7);
    }
}

/* ============================================
   SCROLL TO TOP
   ============================================ */

.scroll-to-top {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    z-index: 998;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 991.98px) {
    .hero-section {
        padding-top: calc(var(--navbar-height) + 1rem);
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .editor-panel {
        position: static;
        margin-top: 1.5rem;
    }
    
    #canvas-container {
        height: 400px;
    }
    
    .navbar-collapse {
        background-color: var(--bg-primary);
        padding: 1rem;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        box-shadow: var(--shadow-md);
    }
    
    .whatsapp-float {
        width: 55px;
        height: 55px;
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .scroll-to-top {
        bottom: 5rem;
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 2rem;
    }
    
    #canvas-container {
        height: 350px;
    }
    
    .color-picker {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.4rem;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 1.75rem;
    }
    
    .scroll-to-top {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* ============================================
   DESIGN CONTROLS - Estilo Simplificado y Compacto
   ============================================ */

#designControls {
    animation: fadeInUp 0.3s ease;
}

#resetDesign {
    transition: all var(--transition-fast);
}

#resetDesign:hover {
    background-color: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Grid de controles - 2 columnas */
.design-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.control-item {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

[data-bs-theme="dark"] .control-item {
    background: rgba(255, 255, 255, 0.03);
}

.control-item:hover {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0%, rgba(var(--primary-rgb), 0.08) 100%);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.1);
}

.control-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.control-header i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.control-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    flex-grow: 1;
}

.control-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    min-width: 45px;
    text-align: center;
}

.control-item .form-range {
    cursor: pointer;
    height: 4px;
    background: linear-gradient(to right, #e2e8f0, var(--primary-color));
    border-radius: 10px;
    margin: 0;
}

.control-item .form-range::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.4);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.control-item .form-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.4);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.control-item .form-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.6);
}

.control-item .form-range::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.6);
}

/* Responsive para móviles */
@media (max-width: 575.98px) {
    .design-controls-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* ============================================
   VISUAL TRANSFORM OVERLAY
   ============================================ */

#transform-overlay {
    width: 100%;
    height: 100%;
    cursor: default;
    user-select: none;
}

#toggleTransformMode {
    transition: all var(--transition-fast);
}

#toggleTransformMode.active {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

#toggleTransformMode.active:hover {
    background-color: #5558e3 !important;
}

/* Transform overlay hint */
.transform-hint {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(99, 102, 241, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 4;
    pointer-events: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   UTILITIES
   ============================================ */

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

/* Selection */
::selection {
    background-color: rgba(var(--primary-rgb), 0.2);
    color: var(--text-primary);
}
