/* ==========================================================================
   Watch Face Generator — Samsung Galaxy Watch4
   Estilos principales y diseño responsivo completo
   ========================================================================== */

/* ===== Variables de diseño ===== */
:root {
    /* Paleta de colores */
    --color-bg-deep:       #0a0a14;
    --color-bg-primary:    #0f0f1e;
    --color-bg-card:       #16162a;
    --color-bg-card-hover: #1c1c38;
    --color-bg-glass:      rgba(22, 22, 42, 0.7);

    --color-accent-1:      #7c5cfc;
    --color-accent-2:      #00d4ff;
    --color-accent-3:      #a78bfa;
    --color-success:       #34d399;
    --color-success-hover: #2abb87;
    --color-warning:       #fbbf24;
    --color-danger:        #f87171;

    --color-text-primary:   #e8e8f0;
    --color-text-secondary: #9898b4;
    --color-text-muted:     #5a5a7a;
    --color-border:         rgba(124, 92, 252, 0.16);
    --color-border-active:  rgba(124, 92, 252, 0.6);

    /* Gradientes */
    --gradient-accent: linear-gradient(135deg, var(--color-accent-1), var(--color-accent-2));
    --gradient-card:   linear-gradient(145deg, rgba(124, 92, 252, 0.08), rgba(0, 212, 255, 0.04));
    --gradient-glow:   radial-gradient(ellipse at 50% 0%, rgba(124, 92, 252, 0.18) 0%, transparent 65%);

    /* Tipografía */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Radios */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Sombras */
    --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md:   0 4px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg:   0 8px 48px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 35px rgba(124, 92, 252, 0.28);

    /* Transiciones */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset y base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg-deep);
    color: var(--color-text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--gradient-glow);
    pointer-events: none;
    z-index: 0;
}

/* ===== Partículas decorativas de fondo ===== */
.bg-particles {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.12;
    animation: particleFloat 22s ease-in-out infinite;
}

.particle-1 {
    width: 420px;
    height: 420px;
    background: var(--color-accent-1);
    top: -10%;
    left: -5%;
    animation-duration: 25s;
    filter: blur(90px);
}

.particle-2 {
    width: 340px;
    height: 340px;
    background: var(--color-accent-2);
    bottom: -10%;
    right: -5%;
    animation-duration: 28s;
    animation-delay: -7s;
    filter: blur(85px);
}

.particle-3 {
    width: 250px;
    height: 250px;
    background: var(--color-accent-3);
    top: 50%;
    left: 45%;
    animation-duration: 32s;
    animation-delay: -14s;
    filter: blur(75px);
}

.particle-4 {
    width: 180px;
    height: 180px;
    background: var(--color-success);
    top: 20%;
    right: 15%;
    opacity: 0.06;
    animation-duration: 20s;
    filter: blur(60px);
}

.particle-5 {
    width: 220px;
    height: 220px;
    background: var(--color-accent-1);
    bottom: 25%;
    left: 10%;
    opacity: 0.08;
    animation-duration: 24s;
    animation-delay: -10s;
    filter: blur(70px);
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(25px, -35px) scale(1.06);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* ===== Contenedor principal ===== */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Encabezado ===== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(124, 92, 252, 0.12);
    border: 1px solid var(--color-border);
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(124, 92, 252, 0.15);
}

.app-header h1 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.subtitle {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 2px;
}

.header-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 100px;
    background: rgba(124, 92, 252, 0.12);
    border: 1px solid var(--color-border);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-accent-3);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.info-badge-dim {
    color: var(--color-text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

/* ===== Zona de trabajo (Grid) ===== */
.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    gap: 1.75rem;
    flex: 1;
    align-items: start;
}

/* ===== Panel de vista previa (Izquierda) ===== */
.preview-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 1rem;
}

.preview-frame {
    position: relative;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.preview-frame:hover {
    border-color: var(--color-border-active);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* Marco simulado del reloj Galaxy Watch (bisel circular) */
.preview-visual {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
    border-radius: 50%;
    box-shadow: 
        0 0 0 2px rgba(124, 92, 252, 0.35),
        0 0 0 8px rgba(10, 10, 20, 0.85),
        0 0 30px rgba(0, 0, 0, 0.7);
    background: #000;
    touch-action: none;
    user-select: none;
}

.preview-visual.is-dragging {
    cursor: grabbing;
}

.preview-visual.no-image {
    cursor: default;
}

/* Plantilla superior fija */
.preview-template {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
}

/* Imagen de fondo posicionada y escalada dinámicamente */
.preview-background {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    will-change: transform, width, height, left, top;
    transform-origin: 0 0;
}

/* Marcador cuando no hay imagen */
.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--color-text-muted);
    z-index: 1;
    text-align: center;
    padding: 1.5rem;
    animation: placeholderPulse 3s ease-in-out infinite;
}

.preview-placeholder svg {
    opacity: 0.5;
    color: var(--color-accent-1);
}

.placeholder-main {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.placeholder-sub {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    max-width: 240px;
}

@keyframes placeholderPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

/* Controles flotantes de zoom en la vista previa */
.preview-controls {
    position: absolute;
    top: 0.85rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.55rem;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    animation: fadeSlideDown 0.25s ease-out;
}

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

.ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.ctrl-btn:hover {
    background: var(--color-accent-1);
    color: #fff;
    transform: scale(1.1);
}

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

.zoom-level {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-accent-2);
    min-width: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Indicación de arrastrar */
.drag-hint {
    position: absolute;
    bottom: 0.85rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    background: rgba(10, 10, 20, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    font-size: 0.72rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.4s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.drag-hint svg {
    color: var(--color-accent-2);
    flex-shrink: 0;
}

/* Indicador de dimensiones en esquina */
.dimensions-badge {
    position: absolute;
    bottom: 0.85rem;
    right: 0.85rem;
    z-index: 5;
    padding: 0.25rem 0.55rem;
    background: rgba(10, 10, 20, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* ===== Barra de herramientas de acomodo (Adjust Toolbar) ===== */
.adjust-toolbar {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    animation: fadeSlideUp 0.3s ease-out;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.toolbar-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-right: 0.2rem;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tool-btn:hover {
    background: rgba(124, 92, 252, 0.15);
    color: var(--color-text-primary);
    border-color: var(--color-border);
}

.tool-btn.active {
    background: rgba(124, 92, 252, 0.25);
    color: #fff;
    border-color: var(--color-accent-1);
    box-shadow: 0 0 12px rgba(124, 92, 252, 0.3);
}

/* D-Pad para movimiento preciso */
.dpad-buttons {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.dpad-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.65rem;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.dpad-btn:hover {
    background: var(--color-accent-1);
    color: #fff;
}

.dpad-btn:active {
    background: var(--color-accent-2);
}

/* Slider de zoom */
.toolbar-zoom-slider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zoom-range {
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 5px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    outline: none;
    transition: background var(--transition-fast);
}

.zoom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-accent-2);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
    transition: transform var(--transition-fast);
}

.zoom-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.zoom-slider-val {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-accent-2);
    min-width: 38px;
    font-variant-numeric: tabular-nums;
}

/* Panel de información de la imagen */
.image-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.info-label {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.info-value {
    font-size: 0.75rem;
    color: var(--color-text-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ===== Panel de controles (Derecha) ===== */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Secciones tipo card */
.card-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title svg {
    color: var(--color-accent-2);
}

.section-title h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.template-count {
    font-size: 0.72rem;
    color: var(--color-accent-3);
    background: rgba(124, 92, 252, 0.1);
    padding: 0.2rem 0.55rem;
    border-radius: 100px;
    border: 1px solid rgba(124, 92, 252, 0.2);
}

/* Filtros de plantillas */
.category-filters {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.filter-btn {
    padding: 0.3rem 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.filter-btn.active {
    background: var(--gradient-accent);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(124, 92, 252, 0.3);
}

/* Grid de plantillas */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.template-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.6rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    outline: none;
}

.template-card:hover {
    background: rgba(124, 92, 252, 0.08);
    border-color: rgba(124, 92, 252, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.template-card.active {
    background: rgba(124, 92, 252, 0.15);
    border-color: var(--color-accent-1);
    box-shadow: 0 0 20px rgba(124, 92, 252, 0.35);
}

.template-thumb-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.template-check {
    position: absolute;
    inset: 0;
    background: rgba(124, 92, 252, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transform: scale(0.6);
    transition: all var(--transition-fast);
}

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

.template-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    text-align: center;
    width: 100%;
}

.template-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.template-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    border-radius: 100px;
    font-weight: 500;
}

.badge-dark {
    background: rgba(0, 0, 0, 0.4);
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.2);
}

.badge-white {
    background: rgba(255, 255, 255, 0.1);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

/* ===== Zona de arrastrar y soltar (Dropzone) ===== */
.dropzone {
    border: 2px dashed rgba(124, 92, 252, 0.28);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: rgba(124, 92, 252, 0.02);
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--color-accent-2);
    background: rgba(0, 212, 255, 0.05);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.12);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.dropzone-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(124, 92, 252, 0.1);
    border: 1px solid var(--color-border);
    color: var(--color-accent-2);
    transition: transform var(--transition-base);
}

.dropzone:hover .dropzone-icon {
    transform: translateY(-3px) scale(1.05);
}

.dropzone-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.dropzone-subtext {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.dropzone-formats {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 100px;
    font-size: 0.66rem;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: 0.04em;
    margin-top: 0.2rem;
}

/* ===== Botones de acción ===== */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.8rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-base);
    text-decoration: none;
    width: 100%;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--gradient-accent);
    color: #fff;
    box-shadow: 0 4px 20px rgba(124, 92, 252, 0.35);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 28px rgba(124, 92, 252, 0.5);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 6px 28px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

.download-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.btn-secondary-download {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-secondary-download:hover:not(:disabled) {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--color-text-secondary);
}

.btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.07);
    color: var(--color-text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ===== Guía de ayuda ===== */
.help-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.help-card h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.65rem;
}

.help-card h3 svg {
    color: var(--color-accent-3);
}

.help-card ol {
    padding-left: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.help-card li {
    font-size: 0.74rem;
    color: var(--color-text-secondary);
    line-height: 1.45;
}

.help-card strong {
    color: var(--color-text-primary);
}

/* ===== Pie de página ===== */
.app-footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

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

/* ===== Notificación Toast ===== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    color: #fff;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    max-width: 90vw;
}

.toast-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-success {
    background: linear-gradient(135deg, #059669, #10b981);
    border: 1px solid rgba(52, 211, 153, 0.4);
}

.toast-error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border: 1px solid rgba(248, 113, 113, 0.4);
}

.toast-info {
    background: linear-gradient(135deg, #4f46e5, #7c5cfc);
    border: 1px solid rgba(124, 92, 252, 0.4);
}

/* Animaciones generales */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   RESPONSIVIDAD COMPLETA (Mobile-First / Breakpoints)
   ========================================================================== */

/* Tablets / Laptops medianos (<= 1024px) */
@media (max-width: 1024px) {
    .workspace {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
        gap: 1.25rem;
    }
    .template-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablets pequeñas y teléfonos en horizontal (<= 860px) */
@media (max-width: 860px) {
    .app-container {
        padding: 1.25rem 1rem 1.5rem;
    }

    .app-header {
        margin-bottom: 1.25rem;
    }

    .workspace {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .preview-panel {
        position: static;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    .controls-panel {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

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

/* Teléfonos estándar (<= 600px) */
@media (max-width: 600px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .header-badges {
        width: 100%;
        justify-content: flex-start;
    }

    .preview-frame {
        padding: 0.85rem;
    }

    .template-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .template-thumb-wrapper {
        width: 54px;
        height: 54px;
    }

    .adjust-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .toolbar-group {
        justify-content: space-between;
        width: 100%;
    }

    .toolbar-zoom-slider {
        justify-content: space-between;
    }

    .zoom-range {
        flex: 1;
        width: auto;
    }

    .action-buttons {
        gap: 0.5rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.82rem;
    }
}

/* Teléfonos pequeños (<= 400px) */
@media (max-width: 400px) {
    .app-container {
        padding: 0.85rem 0.65rem 1.25rem;
    }

    .app-header h1 {
        font-size: 1.25rem;
    }

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

    .template-name {
        font-size: 0.65rem;
    }
}
