:root {
    --duino-radius: 12px;
    --duino-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
    --duino-gap-sm: .375rem;
    --duino-gap: .5rem;
    --duino-gap-lg: .75rem;

    --duino-color-bg: #ffffff;
    --duino-color-fg: #13151a;
    --duino-color-muted: #6b7280;

    /* Colores inspirados en Arduino - Teal/Turquesa */
    --duino-brand-50: #f0fdfa;
    --duino-brand-100: #ccfbf1;
    --duino-brand-200: #99f6e4;
    --duino-brand-300: #5eead4;
    --duino-brand-400: #2dd4bf;
    --duino-brand-500: #14b8a6;
    --duino-brand-600: #0d9488;
    --duino-brand-700: #008184;
    --duino-brand-800: #005c5f;
    --duino-brand-900: #134e4a;

    --duino-danger-500: #ef4444;
    --duino-border: #e5e7eb;
    --duino-ring: #5eead4;
}.duino-senderContainer {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    border: 1px solid var(--duino-border);
    border-radius: var(--duino-radius);
    padding: 8px;
}

.duino-senderContainer:focus-visible {
    outline: 2px solid var(--duino-ring);
    outline-offset: 2px;
}

.duino-senderContainer:hover {
    border-color: var(--duino-brand-500);
}

.duino-senderContainer:active {
    border-color: var(--duino-brand-500);
}

.duino-senderContainer .duino-senderButton {
    border: none;
    background: none;
    cursor: pointer;
    width: 32px;
    height: 32px;

    img {
        width: 100%;
        height: 100%;
    }
}

.duino-senderContainer .duino-sender {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--duino-color-fg);
}/* Contenedor principal (BEM) */
.duino-message {
    position: fixed;
    z-index: 1100;
    pointer-events: none;
    display: flex;
    gap: var(--duino-gap);
    flex-direction: column;
    padding: var(--duino-gap);
}

/* Placement modifiers */
.duino-message--top-right {
    top: 8px;
    right: 8px;
    align-items: flex-end;
}

.duino-message--top-left {
    top: 8px;
    left: 8px;
    align-items: flex-start;
}

.duino-message--bottom-right {
    bottom: 8px;
    right: 8px;
    align-items: flex-end;
}

.duino-message--bottom-left {
    bottom: 8px;
    left: 8px;
    align-items: flex-start;
}

/* Item */
.duino-message__item {
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--duino-gap);
    min-width: 240px;
    max-width: 420px;
    padding: .6rem .75rem;
    border: 1px solid var(--duino-border);
    border-radius: var(--duino-radius);
    background: var(--duino-color-bg);
    color: var(--duino-color-fg);
    box-shadow:
        0 10px 20px rgba(0, 0, 0, .10),
        0 6px 6px rgba(0, 0, 0, .05);
    animation: duino-msg-in 140ms ease-out;
}

/* Icono simple */
.duino-message__icon {
    font-weight: 700;
    width: 1.25rem;
    text-align: center;
}

/* Contenido */
.duino-message__content {
    font-family: var(--duino-font);
    font-size: .95rem;
    line-height: 1.35;
}

/* Cerrar */
.duino-message__close {
    appearance: none;
    border: 1px solid var(--duino-border);
    background: #fff;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
}

.duino-message__close:hover {
    box-shadow: 0 0 0 3px var(--duino-brand-100);
}

/* Variantes Arduino (teal) + estados */
.duino-message__item--info {
    border-left: 4px solid var(--duino-brand-500);
}

.duino-message__item--success {
    border-left: 4px solid var(--duino-brand-600);
    background: linear-gradient(180deg, var(--duino-brand-50), transparent);
}

.duino-message__item--warning {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(180deg, #fffbeb, transparent);
}

.duino-message__item--error {
    border-left: 4px solid var(--duino-danger-500);
    background: linear-gradient(180deg, #fef2f2, transparent);
}

.duino-message__item--loading {
    border-left: 4px solid var(--duino-brand-400);
}

/* Animaciones */
@keyframes duino-msg-in {
    from {
        transform: translateY(-4px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}/* Import tokens */
@import "../../styles/tokens.css";

/* ===== DUINO COLLAPSE - BEM METHODOLOGY ===== */

/* Block: duino-collapse */
.duino-collapse {
    font-family: var(--duino-font);
    color: var(--duino-color-fg);
    background: var(--duino-color-bg);
}

/* ===== VARIANTS ===== */

/* Default variant */
.duino-collapse--default {
    border: 1px solid var(--duino-border);
    border-radius: var(--duino-radius);
    overflow: hidden;
}

.duino-collapse--default .duino-collapse__panel:not(:last-child) {
    border-bottom: 1px solid var(--duino-border);
}

/* Ghost variant */
.duino-collapse--ghost {
    background: transparent;
}

.duino-collapse--ghost .duino-collapse__panel {
    border: none;
    margin-bottom: var(--duino-gap-sm);
    border-radius: var(--duino-radius);
    overflow: hidden;
}

.duino-collapse--ghost .duino-collapse__header {
    background: var(--duino-brand-50);
    border: 1px solid var(--duino-brand-200);
}

.duino-collapse--ghost .duino-collapse__content {
    border: 1px solid var(--duino-brand-200);
    border-top: none;
}

/* Bordered variant */
.duino-collapse--bordered {
    border: 2px solid var(--duino-brand-200);
    border-radius: var(--duino-radius);
}

.duino-collapse--bordered .duino-collapse__panel:not(:last-child) {
    border-bottom: 2px solid var(--duino-brand-200);
}

.duino-collapse--bordered .duino-collapse__header {
    background: linear-gradient(135deg, var(--duino-brand-50), var(--duino-brand-100));
}

/* ===== SIZES ===== */

/* Small */
.duino-collapse--sm .duino-collapse__header {
    padding: 8px 12px;
    font-size: 13px;
}

.duino-collapse--sm .duino-collapse__body {
    padding: 8px 12px;
    font-size: 13px;
}

.duino-collapse--sm .duino-collapse__arrow {
    width: 12px;
    height: 12px;
}

/* Medium (default) */
.duino-collapse--md .duino-collapse__header {
    padding: 12px 16px;
    font-size: 14px;
}

.duino-collapse--md .duino-collapse__body {
    padding: 12px 16px;
    font-size: 14px;
}

.duino-collapse--md .duino-collapse__arrow {
    width: 14px;
    height: 14px;
}

/* Large */
.duino-collapse--lg .duino-collapse__header {
    padding: 16px 20px;
    font-size: 15px;
}

.duino-collapse--lg .duino-collapse__body {
    padding: 16px 20px;
    font-size: 15px;
}

.duino-collapse--lg .duino-collapse__arrow {
    width: 16px;
    height: 16px;
}

/* ===== ELEMENTS ===== */

/* Panel */
.duino-collapse__panel {
    background: var(--duino-color-bg);
    transition: all 0.2s ease;
}

.duino-collapse__panel--active {
    /* Estilos para panel activo */
}

.duino-collapse__panel--disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.duino-collapse__panel--animating {
    /* Estilos durante animación */
}

/* Header */
.duino-collapse__header {
    display: flex;
    align-items: center;
    gap: var(--duino-gap-sm);
    background: var(--duino-color-bg);
    border: none;
    width: 100%;
    text-align: left;
    transition: all 0.2s ease;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
}

.duino-collapse__header--clickable {
    cursor: pointer;
}

.duino-collapse__header--clickable:hover:not(.duino-collapse__panel--disabled .duino-collapse__header) {
    background: var(--duino-brand-50);
}

.duino-collapse__header--clickable:focus-visible {
    outline: 2px solid var(--duino-ring);
    outline-offset: -2px;
}

.duino-collapse__panel--active .duino-collapse__header {
    background: var(--duino-brand-100);
    color: var(--duino-brand-700);
    font-weight: 600;
}

/* Header content */
.duino-collapse__header-content {
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
}

/* Extra content */
.duino-collapse__extra {
    margin-left: auto;
    color: var(--duino-color-muted);
    font-size: 0.9em;
}

/* Icon */
.duino-collapse__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--duino-color-muted);
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
}

.duino-collapse__icon:hover {
    background: var(--duino-brand-100);
    color: var(--duino-brand-600);
}

.duino-collapse__icon--start {
    order: -1;
}

.duino-collapse__icon--end {
    order: 1;
}

/* Arrow */
.duino-collapse__arrow {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.duino-collapse__panel--active .duino-collapse__arrow {
    transform: rotate(180deg);
}

/* Content */
.duino-collapse__content {
    overflow: hidden;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--duino-color-bg);
}

.duino-collapse__body {
    padding: 12px 16px;
    border-top: 1px solid var(--duino-border);
    color: var(--duino-color-fg);
    line-height: 1.6;
}

.duino-collapse--ghost .duino-collapse__body {
    border-top: none;
    background: var(--duino-color-bg);
}

/* ===== ACCORDION MODE ===== */

.duino-collapse--accordion .duino-collapse__panel {
    /* Estilos específicos para modo acordeón */
}

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

@media (max-width: 640px) {
    .duino-collapse--lg .duino-collapse__header {
        padding: 14px 16px;
        font-size: 14px;
    }

    .duino-collapse--lg .duino-collapse__body {
        padding: 14px 16px;
        font-size: 14px;
    }

    .duino-collapse--md .duino-collapse__header {
        padding: 10px 14px;
        font-size: 13px;
    }

    .duino-collapse--md .duino-collapse__body {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    .duino-collapse__content {
        transition: none;
    }

    .duino-collapse__arrow {
        transition: none;
    }

    .duino-collapse__header {
        transition: none;
    }

    .duino-collapse__icon {
        transition: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .duino-collapse--default {
        border-width: 2px;
    }

    .duino-collapse__panel:not(:last-child) {
        border-bottom-width: 2px;
    }

    .duino-collapse__body {
        border-top-width: 2px;
    }
}

/* Focus styles */
.duino-collapse__header:focus-visible {
    outline: 2px solid var(--duino-ring);
    outline-offset: -2px;
}

.duino-collapse__icon:focus-visible {
    outline: 2px solid var(--duino-ring);
    outline-offset: 1px;
}

/* ===== CONTENT STYLES ===== */

/* Rich content support */
.duino-collapse__body h1,
.duino-collapse__body h2,
.duino-collapse__body h3,
.duino-collapse__body h4,
.duino-collapse__body h5,
.duino-collapse__body h6 {
    margin: 0 0 12px 0;
    font-weight: 600;
    line-height: 1.3;
    color: var(--duino-brand-700);
}

.duino-collapse__body p {
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.duino-collapse__body p:last-child {
    margin-bottom: 0;
}

.duino-collapse__body ul,
.duino-collapse__body ol {
    margin: 0 0 12px 0;
    padding-left: 20px;
}

.duino-collapse__body li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.duino-collapse__body a {
    color: var(--duino-brand-500);
    text-decoration: none;
}

.duino-collapse__body a:hover {
    color: var(--duino-brand-600);
    text-decoration: underline;
}

.duino-collapse__body code {
    background: var(--duino-brand-50);
    color: var(--duino-brand-700);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.duino-collapse__body pre {
    background: var(--duino-brand-50);
    color: var(--duino-brand-700);
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid var(--duino-brand-200);
}

.duino-collapse__body blockquote {
    margin: 12px 0;
    padding: 12px 16px;
    border-left: 4px solid var(--duino-brand-300);
    background: var(--duino-brand-50);
    border-radius: 0 6px 6px 0;
    font-style: italic;
}

.duino-collapse__body hr {
    border: none;
    border-top: 1px solid var(--duino-border);
    margin: 16px 0;
}

/* Interactive content */
.duino-collapse__body .duino-btn {
    margin: 4px 4px 4px 0;
}

/* Images */
.duino-collapse__body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 8px 0;
}

/* Tables */
.duino-collapse__body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.9em;
}

.duino-collapse__body th,
.duino-collapse__body td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--duino-border);
}

.duino-collapse__body th {
    font-weight: 600;
    background: var(--duino-brand-50);
    color: var(--duino-brand-700);
}

/* ===== PRINT STYLES ===== */

@media print {
    .duino-collapse__content {
        height: auto !important;
        overflow: visible !important;
    }

    .duino-collapse__panel {
        page-break-inside: avoid;
    }

    .duino-collapse__arrow {
        display: none;
    }
}/* Import tokens */
@import "../../styles/tokens.css";

/* ===== DUINO SPIN - BEM METHODOLOGY ===== */

/* Block: duino-spin */
.duino-spin {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--duino-gap-sm);
  color: var(--duino-brand-500);
}

/* ===== SIZES ===== */

/* Extra Small */
.duino-spin--xs {
  font-size: 12px;
}

.duino-spin--xs .duino-spin__svg {
  width: 12px;
  height: 12px;
}

/* Small */
.duino-spin--sm {
  font-size: 14px;
}

.duino-spin--sm .duino-spin__svg {
  width: 16px;
  height: 16px;
}

/* Medium (default) */
.duino-spin--md {
  font-size: 16px;
}

.duino-spin--md .duino-spin__svg {
  width: 24px;
  height: 24px;
}

/* Large */
.duino-spin--lg {
  font-size: 18px;
}

.duino-spin--lg .duino-spin__svg {
  width: 32px;
  height: 32px;
}

/* Extra Large */
.duino-spin--xl {
  font-size: 20px;
}

.duino-spin--xl .duino-spin__svg {
  width: 48px;
  height: 48px;
}

/* ===== SPINNER TYPES ===== */

/* Circle Spinner (Default) */
.duino-spin__svg {
  animation: duino-spin-rotate 1s linear infinite;
}

.duino-spin__circle {
  stroke: currentColor;
  stroke-dasharray: 50;
  stroke-dashoffset: 25;
  stroke-linecap: round;
  animation: duino-spin-dash 1.5s ease-in-out infinite;
}

@keyframes duino-spin-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes duino-spin-dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

/* Dots Spinner */
.duino-spin__dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.duino-spin__dots--xs { gap: 2px; }
.duino-spin__dots--sm { gap: 3px; }
.duino-spin__dots--md { gap: 4px; }
.duino-spin__dots--lg { gap: 5px; }
.duino-spin__dots--xl { gap: 6px; }

.duino-spin__dot {
  background: currentColor;
  border-radius: 50%;
  animation: duino-spin-dots 1.4s ease-in-out infinite both;
}

.duino-spin__dots--xs .duino-spin__dot { width: 3px; height: 3px; }
.duino-spin__dots--sm .duino-spin__dot { width: 4px; height: 4px; }
.duino-spin__dots--md .duino-spin__dot { width: 6px; height: 6px; }
.duino-spin__dots--lg .duino-spin__dot { width: 8px; height: 8px; }
.duino-spin__dots--xl .duino-spin__dot { width: 10px; height: 10px; }

.duino-spin__dot--1 { animation-delay: -0.32s; }
.duino-spin__dot--2 { animation-delay: -0.16s; }
.duino-spin__dot--3 { animation-delay: 0s; }

@keyframes duino-spin-dots {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Pulse Spinner */
.duino-spin__pulse {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.duino-spin__pulse--xs { width: 12px; height: 12px; }
.duino-spin__pulse--sm { width: 16px; height: 16px; }
.duino-spin__pulse--md { width: 24px; height: 24px; }
.duino-spin__pulse--lg { width: 32px; height: 32px; }
.duino-spin__pulse--xl { width: 48px; height: 48px; }

.duino-spin__pulse-ring {
  position: absolute;
  border: 2px solid currentColor;
  border-radius: 50%;
  animation: duino-spin-pulse 2s ease-in-out infinite;
}

.duino-spin__pulse-ring--1 {
  width: 100%;
  height: 100%;
  animation-delay: 0s;
}

.duino-spin__pulse-ring--2 {
  width: 80%;
  height: 80%;
  animation-delay: -0.4s;
}

.duino-spin__pulse-ring--3 {
  width: 60%;
  height: 60%;
  animation-delay: -0.8s;
}

@keyframes duino-spin-pulse {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* Bars Spinner */
.duino-spin__bars {
  display: flex;
  gap: 2px;
  align-items: center;
}

.duino-spin__bars--xs { gap: 1px; }
.duino-spin__bars--sm { gap: 1.5px; }
.duino-spin__bars--md { gap: 2px; }
.duino-spin__bars--lg { gap: 3px; }
.duino-spin__bars--xl { gap: 4px; }

.duino-spin__bar {
  background: currentColor;
  animation: duino-spin-bars 1s ease-in-out infinite;
}

.duino-spin__bars--xs .duino-spin__bar { width: 2px; height: 8px; }
.duino-spin__bars--sm .duino-spin__bar { width: 2px; height: 12px; }
.duino-spin__bars--md .duino-spin__bar { width: 3px; height: 16px; }
.duino-spin__bars--lg .duino-spin__bar { width: 4px; height: 20px; }
.duino-spin__bars--xl .duino-spin__bar { width: 5px; height: 28px; }

.duino-spin__bar--1 { animation-delay: -0.4s; }
.duino-spin__bar--2 { animation-delay: -0.3s; }
.duino-spin__bar--3 { animation-delay: -0.2s; }
.duino-spin__bar--4 { animation-delay: -0.1s; }
.duino-spin__bar--5 { animation-delay: 0s; }

@keyframes duino-spin-bars {
  0%, 40%, 100% {
    transform: scaleY(0.4);
    opacity: 0.7;
  }
  20% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* Ring Spinner */
.duino-spin__ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.duino-spin__ring--xs { width: 12px; height: 12px; }
.duino-spin__ring--sm { width: 16px; height: 16px; }
.duino-spin__ring--md { width: 24px; height: 24px; }
.duino-spin__ring--lg { width: 32px; height: 32px; }
.duino-spin__ring--xl { width: 48px; height: 48px; }

.duino-spin__ring-segment {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  border-radius: 50%;
  animation: duino-spin-ring 1.2s linear infinite;
}

.duino-spin__ring-segment--1 {
  border-top-color: currentColor;
  animation-delay: 0s;
}

.duino-spin__ring-segment--2 {
  border-right-color: currentColor;
  animation-delay: -0.3s;
}

.duino-spin__ring-segment--3 {
  border-bottom-color: currentColor;
  animation-delay: -0.6s;
}

.duino-spin__ring-segment--4 {
  border-left-color: currentColor;
  animation-delay: -0.9s;
}

@keyframes duino-spin-ring {
  0% {
    transform: rotate(0deg);
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    transform: rotate(360deg);
    opacity: 1;
  }
}

/* Wave Spinner */
.duino-spin__wave {
  display: flex;
  gap: 2px;
  align-items: end;
}

.duino-spin__wave--xs { gap: 1px; }
.duino-spin__wave--sm { gap: 1.5px; }
.duino-spin__wave--md { gap: 2px; }
.duino-spin__wave--lg { gap: 3px; }
.duino-spin__wave--xl { gap: 4px; }

.duino-spin__wave-bar {
  background: currentColor;
  border-radius: 1px;
  animation: duino-spin-wave 1.2s ease-in-out infinite;
}

.duino-spin__wave--xs .duino-spin__wave-bar { width: 2px; height: 6px; }
.duino-spin__wave--sm .duino-spin__wave-bar { width: 2px; height: 10px; }
.duino-spin__wave--md .duino-spin__wave-bar { width: 3px; height: 14px; }
.duino-spin__wave--lg .duino-spin__wave-bar { width: 4px; height: 18px; }
.duino-spin__wave--xl .duino-spin__wave-bar { width: 5px; height: 24px; }

.duino-spin__wave-bar--1 { animation-delay: -0.4s; }
.duino-spin__wave-bar--2 { animation-delay: -0.3s; }
.duino-spin__wave-bar--3 { animation-delay: -0.2s; }
.duino-spin__wave-bar--4 { animation-delay: -0.1s; }
.duino-spin__wave-bar--5 { animation-delay: 0s; }

@keyframes duino-spin-wave {
  0%, 40%, 100% {
    transform: scaleY(0.4);
  }
  20% {
    transform: scaleY(1);
  }
}

/* ===== ELEMENTS ===== */

/* Tip text */
.duino-spin__tip {
  color: var(--duino-color-muted);
  font-size: 0.9em;
  font-weight: 500;
  text-align: center;
  margin-top: var(--duino-gap-sm);
  line-height: 1.4;
}

/* ===== WRAPPER STYLES ===== */

/* Wrapper for content with spinner overlay */
.duino-spin-wrapper {
  position: relative;
  display: block;
}

.duino-spin-wrapper--spinning {
  /* Estilos cuando está cargando */
}

/* Overlay */
.duino-spin-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(1px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
}

/* Content states */
.duino-spin-content {
  transition: filter 0.2s ease;
}

.duino-spin-content--blurred {
  filter: blur(0.5px);
  opacity: 0.7;
  pointer-events: none;
  transition: all 0.2s ease;
}

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

@media (max-width: 640px) {
  .duino-spin--xl .duino-spin__svg {
    width: 40px;
    height: 40px;
  }
  
  .duino-spin--lg .duino-spin__svg {
    width: 28px;
    height: 28px;
  }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
  .duino-spin__svg,
  .duino-spin__dot,
  .duino-spin__pulse-ring,
  .duino-spin__bar,
  .duino-spin__ring-segment,
  .duino-spin__wave-bar {
    animation: none;
  }
  
  .duino-spin__circle {
    animation: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
  
  /* Mostrar indicador estático para usuarios con motion reducido */
  .duino-spin__svg .duino-spin__circle {
    stroke-dasharray: 25, 25;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .duino-spin {
    color: var(--duino-color-fg);
  }
  
  .duino-spin-overlay {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: none;
  }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .duino-spin-overlay {
    background: rgba(31, 41, 55, 0.8);
  }
}

/* ===== CONTEXTUAL STYLES ===== */

/* En botones */
.duino-btn .duino-spin {
  margin: 0;
}

.duino-btn .duino-spin__tip {
  display: none;
}

/* En inputs */
.duino-input .duino-spin {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

/* En cards */
.duino-card .duino-spin-overlay {
  border-radius: var(--duino-radius);
}

/* ===== PRINT STYLES ===== */

@media print {
  .duino-spin,
  .duino-spin-overlay {
    display: none !important;
  }
  
  .duino-spin-content--blurred {
    filter: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}
/* Import tokens */
@import "../../styles/tokens.css";

/* ===== DUINO IMAGE - BEM METHODOLOGY ===== */

/* Block: duino-image */
.duino-image {
    position: relative;
    display: inline-block;
    overflow: hidden;
    background: var(--duino-brand-50);
    transition: all 0.2s ease;
}

/* ===== SHAPES ===== */

.duino-image--square {
    border-radius: 0;
}

.duino-image--rounded {
    border-radius: var(--duino-radius);
}

.duino-image--circle {
    border-radius: 50%;
    aspect-ratio: 1;
}

/* ===== MODIFIERS ===== */

.duino-image--bordered {
    border: 2px solid var(--duino-border);
}

.duino-image--shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.duino-image--preview {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.duino-image--preview:hover {
    transform: scale(1.02);
}

/* ===== FIT TYPES ===== */

.duino-image--fill .duino-image__img {
    object-fit: fill;
}

.duino-image--contain .duino-image__img {
    object-fit: contain;
}

.duino-image--cover .duino-image__img {
    object-fit: cover;
}

.duino-image--none .duino-image__img {
    object-fit: none;
}

.duino-image--scale-down .duino-image__img {
    object-fit: scale-down;
}

/* ===== ELEMENTS ===== */

/* Image element */
.duino-image__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.duino-image__img--loading {
    opacity: 0;
}

.duino-image__img--loaded {
    opacity: 1;
}

.duino-image__img--error {
    opacity: 0;
}

/* Loading state */
.duino-image__loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--duino-brand-50);
}

/* Error state */
.duino-image__error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--duino-brand-50);
    color: var(--duino-color-muted);
    gap: var(--duino-gap-sm);
}

.duino-image__error-icon {
    width: 24px;
    height: 24px;
    opacity: 0.5;
}

.duino-image__error-text {
    font-size: 12px;
    text-align: center;
}

/* Placeholder */
.duino-image__placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--duino-brand-50);
    color: var(--duino-color-muted);
}

.duino-image__placeholder-icon {
    width: 32px;
    height: 32px;
    opacity: 0.3;
}

/* Preview overlay */
.duino-image__preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.duino-image--preview:hover .duino-image__preview-overlay {
    opacity: 1;
}

.duino-image__preview-icon {
    width: 24px;
    height: 24px;
    color: white;
}

/* Caption */
.duino-image__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.4;
}

/* ===== PREVIEW MODAL ===== */

.duino-image__preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    cursor: pointer;
    animation: duino-image-modal-in 0.2s ease-out;
}

@keyframes duino-image-modal-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.duino-image__preview-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    cursor: default;
}

.duino-image__preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--duino-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.duino-image__preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--duino-color-fg);
    transition: background-color 0.2s ease;
}

.duino-image__preview-close:hover {
    background: white;
}

.duino-image__preview-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    color: white;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
}

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

@media (max-width: 640px) {
    .duino-image__preview-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .duino-image__preview-close {
        top: -35px;
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .duino-image__preview-caption {
        bottom: -35px;
        font-size: 13px;
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {

    .duino-image,
    .duino-image__img,
    .duino-image__preview-overlay {
        transition: none;
    }

    .duino-image__preview-modal {
        animation: none;
    }

    .duino-image--preview:hover {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .duino-image--bordered {
        border-width: 3px;
    }

    .duino-image__preview-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
}

/* Print styles */
@media print {
    .duino-image__preview-modal {
        display: none !important;
    }

    .duino-image__preview-overlay {
        display: none;
    }
}/* Import tokens */
@import "../../styles/tokens.css";

/* ===== DUINO POPOVER - BEM METHODOLOGY ===== */

/* Block: duino-popover */
.duino-popover {
    position: absolute;
    z-index: 1050;
    font-family: var(--duino-font);
    font-size: 14px;
    line-height: 1.5;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: auto;
}

/* ===== ELEMENTS ===== */

/* Content wrapper */
.duino-popover__content {
    position: relative;
    background: var(--duino-color-bg);
    border: 1px solid var(--duino-border);
    border-radius: var(--duino-radius);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.1),
        0 4px 6px rgba(0, 0, 0, 0.05);
    max-width: 300px;
    word-wrap: break-word;
    animation: duino-popover-in 0.15s ease-out;
}

@keyframes duino-popover-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-2px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Inner content */
.duino-popover__inner {
    padding: 12px 16px;
}

/* Title */
.duino-popover__title {
    font-weight: 600;
    color: var(--duino-color-fg);
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.duino-popover__title:only-child {
    margin-bottom: 0;
}

/* Body */
.duino-popover__body {
    color: var(--duino-color-fg);
    font-size: 13px;
    line-height: 1.5;
}

/* Arrow */
.duino-popover__arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--duino-color-bg);
    border: 1px solid var(--duino-border);
    transform: rotate(45deg);
    z-index: -1;
}

/* Hover bridge - área invisible para mantener hover */
.duino-popover__hover-bridge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -2;
}

/* ===== PLACEMENT MODIFIERS ===== */

/* Top placements */
.duino-popover__content--top,
.duino-popover__content--top-start,
.duino-popover__content--top-end {
    margin-bottom: 8px;
}

.duino-popover__content--top .duino-popover__arrow,
.duino-popover__content--top-start .duino-popover__arrow,
.duino-popover__content--top-end .duino-popover__arrow {
    bottom: -9px;
    border-top: none;
    border-left: none;
}

.duino-popover__content--top .duino-popover__arrow {
    left: 50%;
    margin-left: -8px;
}

.duino-popover__content--top-start .duino-popover__arrow {
    left: 16px;
}

.duino-popover__content--top-end .duino-popover__arrow {
    right: 16px;
}

/* Bottom placements */
.duino-popover__content--bottom,
.duino-popover__content--bottom-start,
.duino-popover__content--bottom-end {
    margin-top: 8px;
}

.duino-popover__content--bottom .duino-popover__arrow,
.duino-popover__content--bottom-start .duino-popover__arrow,
.duino-popover__content--bottom-end .duino-popover__arrow {
    top: -9px;
    border-bottom: none;
    border-right: none;
}

.duino-popover__content--bottom .duino-popover__arrow {
    left: 50%;
    margin-left: -8px;
}

.duino-popover__content--bottom-start .duino-popover__arrow {
    left: 16px;
}

.duino-popover__content--bottom-end .duino-popover__arrow {
    right: 16px;
}

/* Left placements */
.duino-popover__content--left,
.duino-popover__content--left-start,
.duino-popover__content--left-end {
    margin-right: 8px;
}

.duino-popover__content--left .duino-popover__arrow,
.duino-popover__content--left-start .duino-popover__arrow,
.duino-popover__content--left-end .duino-popover__arrow {
    right: -9px;
    border-left: none;
    border-bottom: none;
}

.duino-popover__content--left .duino-popover__arrow {
    top: 50%;
    margin-top: -8px;
}

.duino-popover__content--left-start .duino-popover__arrow {
    top: 16px;
}

.duino-popover__content--left-end .duino-popover__arrow {
    bottom: 16px;
}

/* Right placements */
.duino-popover__content--right,
.duino-popover__content--right-start,
.duino-popover__content--right-end {
    margin-left: 8px;
}

.duino-popover__content--right .duino-popover__arrow,
.duino-popover__content--right-start .duino-popover__arrow,
.duino-popover__content--right-end .duino-popover__arrow {
    left: -9px;
    border-right: none;
    border-top: none;
}

.duino-popover__content--right .duino-popover__arrow {
    top: 50%;
    margin-top: -8px;
}

.duino-popover__content--right-start .duino-popover__arrow {
    top: 16px;
}

.duino-popover__content--right-end .duino-popover__arrow {
    bottom: 16px;
}

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

@media (max-width: 640px) {
    .duino-popover__content {
        max-width: 280px;
        font-size: 13px;
    }

    .duino-popover__inner {
        padding: 10px 12px;
    }

    .duino-popover__title {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .duino-popover__body {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .duino-popover__content {
        max-width: calc(100vw - 32px);
        margin: 0 16px;
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    .duino-popover {
        transition: none;
    }

    .duino-popover__content {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .duino-popover__content {
        border-width: 2px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }

    .duino-popover__arrow {
        border-width: 2px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .duino-popover__content {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }

    .duino-popover__arrow {
        background: #1f2937;
        border-color: #374151;
    }

    .duino-popover__title {
        color: #f9fafb;
    }

    .duino-popover__body {
        color: #d1d5db;
    }
}

/* ===== SPECIAL CONTENT STYLES ===== */

/* Rich content support */
.duino-popover__body h1,
.duino-popover__body h2,
.duino-popover__body h3,
.duino-popover__body h4,
.duino-popover__body h5,
.duino-popover__body h6 {
    margin: 0 0 8px 0;
    font-weight: 600;
    line-height: 1.3;
}

.duino-popover__body p {
    margin: 0 0 8px 0;
}

.duino-popover__body p:last-child {
    margin-bottom: 0;
}

.duino-popover__body ul,
.duino-popover__body ol {
    margin: 0 0 8px 0;
    padding-left: 16px;
}

.duino-popover__body li {
    margin-bottom: 2px;
}

.duino-popover__body a {
    color: var(--duino-brand-500);
    text-decoration: none;
}

.duino-popover__body a:hover {
    color: var(--duino-brand-600);
    text-decoration: underline;
}

.duino-popover__body code {
    background: var(--duino-brand-50);
    color: var(--duino-brand-700);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.duino-popover__body pre {
    background: var(--duino-brand-50);
    color: var(--duino-brand-700);
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    overflow-x: auto;
    margin: 8px 0;
}

.duino-popover__body hr {
    border: none;
    border-top: 1px solid var(--duino-border);
    margin: 12px 0;
}

/* Interactive content */
.duino-popover__body button {
    margin: 4px 4px 4px 0;
}

.duino-popover__body .duino-btn {
    font-size: 12px;
    padding: 4px 8px;
    min-height: 24px;
}

/* Images */
.duino-popover__body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 4px 0;
}

/* Tables */
.duino-popover__body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin: 8px 0;
}

.duino-popover__body th,
.duino-popover__body td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid var(--duino-border);
}

.duino-popover__body th {
    font-weight: 600;
    background: var(--duino-brand-50);
}

/* ===== PRINT STYLES ===== */

@media print {
    .duino-popover {
        display: none !important;
    }
}/* Import tokens */
@import "../../styles/tokens.css";

/* ===== DUINO BUTTON - BEM METHODOLOGY ===== */

/* Block: duino-btn */
.duino-btn {
    /* Reset y base */
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--duino-gap-sm);

    /* Tipografía */
    font-family: var(--duino-font);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;

    /* Layout */
    border-radius: var(--duino-radius);
    border: 1px solid transparent;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;

    /* Transiciones suaves */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Enfoque */
    outline: none;
}

.duino-btn:focus-visible {
    outline: 2px solid var(--duino-ring);
    outline-offset: 2px;
}

/* ===== VARIANTS (Modifiers) ===== */

/* Primary - Estilo principal de Arduino */
.duino-btn--primary {
    background: linear-gradient(135deg, var(--duino-brand-500), var(--duino-brand-600));
    color: white;
    border-color: var(--duino-brand-600);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.duino-btn--primary:hover:not(.duino-btn--disabled) {
    background: linear-gradient(135deg, var(--duino-brand-600), var(--duino-brand-700));
    border-color: var(--duino-brand-700);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
    transform: translateY(-1px);
}

.duino-btn--primary:active:not(.duino-btn--disabled) {
    background: linear-gradient(135deg, var(--duino-brand-700), var(--duino-brand-800));
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Secondary - Outline style */
.duino-btn--secondary {
    background: var(--duino-color-bg);
    color: var(--duino-brand-600);
    border-color: var(--duino-brand-300);
}

.duino-btn--secondary:hover:not(.duino-btn--disabled) {
    background: var(--duino-brand-50);
    border-color: var(--duino-brand-400);
    color: var(--duino-brand-700);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.15);
}

.duino-btn--secondary:active:not(.duino-btn--disabled) {
    background: var(--duino-brand-100);
    border-color: var(--duino-brand-500);
}

/* Ghost - Minimal style */
.duino-btn--ghost {
    background: transparent;
    color: var(--duino-brand-600);
    border-color: transparent;
}

.duino-btn--ghost:hover:not(.duino-btn--disabled) {
    background: var(--duino-brand-50);
    color: var(--duino-brand-700);
}

.duino-btn--ghost:active:not(.duino-btn--disabled) {
    background: var(--duino-brand-100);
}

/* Text - Solo texto */
.duino-btn--text {
    background: transparent;
    color: var(--duino-brand-600);
    border-color: transparent;
    padding-left: 0;
    padding-right: 0;
}

.duino-btn--text:hover:not(.duino-btn--disabled) {
    color: var(--duino-brand-700);
    background: transparent;
}

.duino-btn--text:active:not(.duino-btn--disabled) {
    color: var(--duino-brand-800);
}

/* Danger - Para acciones destructivas */
.duino-btn--danger {
    background: linear-gradient(135deg, var(--duino-danger-500), #dc2626);
    color: white;
    border-color: #dc2626;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.duino-btn--danger:hover:not(.duino-btn--disabled) {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-color: #b91c1c;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.duino-btn--danger:active:not(.duino-btn--disabled) {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(0);
}

/* ===== SIZES ===== */

.duino-btn--sm {
    padding: 6px 12px;
    font-size: 13px;
    min-height: 28px;
}

.duino-btn--md {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 36px;
}

.duino-btn--lg {
    padding: 12px 24px;
    font-size: 16px;
    min-height: 44px;
}

/* ===== SHAPES ===== */

.duino-btn--round {
    border-radius: 50px;
}

.duino-btn--circle {
    border-radius: 50%;
    width: auto;
    aspect-ratio: 1;
    padding: 8px;
}

.duino-btn--circle.duino-btn--sm {
    padding: 6px;
    min-height: 28px;
    width: 28px;
}

.duino-btn--circle.duino-btn--lg {
    padding: 12px;
    min-height: 44px;
    width: 44px;
}

/* ===== STATES ===== */

/* Block - Ancho completo */
.duino-btn--block {
    width: 100%;
    display: flex;
}

/* Loading */
.duino-btn--loading {
    cursor: wait;
    pointer-events: none;
}

.duino-btn--loading .duino-btn__text {
    opacity: 0.7;
}

/* Disabled */
.duino-btn--disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none !important;
}

.duino-btn--disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Icon only */
.duino-btn--icon-only {
    padding-left: 8px;
    padding-right: 8px;
}

.duino-btn--icon-only.duino-btn--sm {
    padding: 6px;
}

.duino-btn--icon-only.duino-btn--lg {
    padding: 12px;
}

/* ===== ELEMENTS ===== */

/* Loading spinner */
.duino-btn__loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.duino-btn__spinner {
    width: 14px;
    height: 14px;
    animation: duino-spin 1s linear infinite;
}

.duino-btn--sm .duino-btn__spinner {
    width: 12px;
    height: 12px;
}

.duino-btn--lg .duino-btn__spinner {
    width: 16px;
    height: 16px;
}

.duino-btn__spinner-circle {
    stroke: currentColor;
    stroke-dasharray: 50;
    stroke-dashoffset: 25;
    stroke-linecap: round;
    animation: duino-spin-dash 1.5s ease-in-out infinite;
}

/* Icon */
.duino-btn__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.duino-btn__icon svg {
    width: 1em;
    height: 1em;
}

/* Text */
.duino-btn__text {
    display: flex;
    align-items: center;
}

/* ===== ANIMATIONS ===== */

@keyframes duino-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes duino-spin-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

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

@media (max-width: 640px) {
    .duino-btn--lg {
        padding: 10px 20px;
        font-size: 15px;
        min-height: 40px;
    }

    .duino-btn--md {
        padding: 7px 14px;
        font-size: 13px;
        min-height: 34px;
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    .duino-btn {
        transition: none;
    }

    .duino-btn__spinner {
        animation: none;
    }

    .duino-btn__spinner-circle {
        animation: none;
        stroke-dasharray: none;
        stroke-dashoffset: 0;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .duino-btn {
        border-width: 2px;
    }

    .duino-btn:focus-visible {
        outline-width: 3px;
    }
}/* Import tokens */
@import "../../styles/tokens.css";

/* ===== DUINO TABLE - BEM METHODOLOGY ===== */

/* Block: duino-table-wrapper */
.duino-table-wrapper {
    font-family: var(--duino-font);
    color: var(--duino-color-fg);
    background: var(--duino-color-bg);
}

/* Block: duino-table-container */
.duino-table-container {
    border-radius: var(--duino-radius);
    overflow: hidden;
    border: 1px solid var(--duino-border);
    background: var(--duino-color-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Block: duino-table */
.duino-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: var(--duino-color-bg);
}

/* ===== VARIANTS ===== */

/* Striped variant */
.duino-table--striped .duino-table__body .duino-table__row:nth-child(even) {
    background: color-mix(in srgb, var(--duino-brand-50) 50%, transparent);
}

/* Bordered variant */
.duino-table--bordered .duino-table__cell {
    border-right: 1px solid var(--duino-border);
}

.duino-table--bordered .duino-table__cell:last-child {
    border-right: none;
}

/* Minimal variant */
.duino-table--minimal {
    border: none;
    box-shadow: none;
}

.duino-table--minimal .duino-table-container {
    border: none;
    box-shadow: none;
}

.duino-table--minimal .duino-table__head .duino-table__cell {
    border-bottom: 2px solid var(--duino-brand-200);
}

/* Hoverable */
.duino-table--hoverable .duino-table__body .duino-table__row:hover {
    background: var(--duino-brand-50);
    transition: background-color 0.15s ease;
}

/* Sticky header */
.duino-table--sticky .duino-table__head {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--duino-color-bg);
}

/* Loading state */
.duino-table--loading {
    position: relative;
}

/* ===== SIZES ===== */

/* Small */
.duino-table--sm .duino-table__cell {
    padding: 6px 8px;
    font-size: 13px;
}

/* Medium (default) */
.duino-table--md .duino-table__cell {
    padding: 12px 16px;
    font-size: 14px;
}

/* Large */
.duino-table--lg .duino-table__cell {
    padding: 16px 20px;
    font-size: 15px;
}

/* ===== ELEMENTS ===== */

/* Table head */
.duino-table__head {
    background: linear-gradient(135deg, var(--duino-brand-50), var(--duino-brand-100));
    border-bottom: 2px solid var(--duino-brand-200);
}

.duino-table__head .duino-table__cell {
    font-weight: 600;
    color: var(--duino-brand-700);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: none;
}

/* Table body */
.duino-table__body .duino-table__row {
    border-bottom: 1px solid var(--duino-border);
    transition: all 0.15s ease;
}

.duino-table__body .duino-table__row:last-child {
    border-bottom: none;
}

/* Selected row */
.duino-table__row--selected {
    background: var(--duino-brand-100) !important;
    border-color: var(--duino-brand-300);
}

/* Table cell */
.duino-table__cell {
    padding: 12px 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--duino-border);
    word-wrap: break-word;
    line-height: 1.5;
}

/* Header content with sort */
.duino-table__header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.duino-table__header-content:hover {
    color: var(--duino-brand-600);
}

/* Sort icon */
.duino-table__sort-icon {
    margin-left: 4px;
    opacity: 0.5;
    font-size: 12px;
    transition: opacity 0.15s ease;
}

.duino-table__header-content:hover .duino-table__sort-icon {
    opacity: 1;
}

/* Selection cell */
.duino-table__cell--selection {
    width: 40px;
    padding: 8px 12px;
    text-align: center;
}

/* Checkbox */
.duino-table__checkbox {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 2px solid var(--duino-brand-300);
    cursor: pointer;
    accent-color: var(--duino-brand-500);
}

.duino-table__checkbox:checked {
    background: var(--duino-brand-500);
    border-color: var(--duino-brand-500);
}

.duino-table__checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading cell */
.duino-table__cell--loading {
    text-align: center;
    padding: 40px 20px;
}

.duino-table__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--duino-color-muted);
}

/* Spinner */
.duino-table__spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--duino-border);
    border-top: 2px solid var(--duino-brand-500);
    border-radius: 50%;
    animation: duino-table-spin 1s linear infinite;
}

@keyframes duino-table-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Empty state */
.duino-table__cell--empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--duino-color-muted);
    font-style: italic;
}

.duino-table__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    font-size: 16px;
}

/* ===== PAGINATION ===== */

.duino-table__pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--duino-border);
    background: var(--duino-brand-25, #fafafa);
    font-size: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.duino-table__pagination-info {
    color: var(--duino-color-muted);
    font-size: 13px;
}

.duino-table__pagination-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.duino-table__page-size-selector {
    padding: 4px 8px;
    border: 1px solid var(--duino-border);
    border-radius: calc(var(--duino-radius) / 2);
    background: var(--duino-color-bg);
    font-size: 13px;
    cursor: pointer;
}

.duino-table__page-size-selector:focus {
    outline: 2px solid var(--duino-ring);
    outline-offset: 1px;
}

.duino-table__pagination-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.duino-table__pagination-current {
    padding: 0 12px;
    font-weight: 500;
    color: var(--duino-brand-600);
    font-size: 13px;
}

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

@media (max-width: 768px) {
    .duino-table-container {
        overflow-x: auto;
    }

    .duino-table {
        min-width: 600px;
    }

    .duino-table__pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .duino-table__pagination-controls {
        justify-content: space-between;
    }

    .duino-table--sm .duino-table__cell {
        padding: 4px 6px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .duino-table {
        min-width: 500px;
    }

    .duino-table__cell {
        padding: 8px 10px;
        font-size: 13px;
    }

    .duino-table__pagination {
        padding: 12px 16px;
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    .duino-table__spinner {
        animation: none;
    }

    .duino-table__body .duino-table__row,
    .duino-table__header-content,
    .duino-table__sort-icon {
        transition: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .duino-table-container {
        border-width: 2px;
    }

    .duino-table__cell {
        border-bottom-width: 2px;
    }

    .duino-table__head {
        border-bottom-width: 3px;
    }
}

/* Focus styles */
.duino-table__checkbox:focus-visible {
    outline: 2px solid var(--duino-ring);
    outline-offset: 2px;
}

.duino-table__header-content:focus-visible {
    outline: 2px solid var(--duino-ring);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print styles */
@media print {
    .duino-table__pagination {
        display: none;
    }

    .duino-table-container {
        border: 1px solid #000;
        box-shadow: none;
    }

    .duino-table__body .duino-table__row:hover {
        background: transparent !important;
    }
}/* Import tokens */
@import "../../styles/tokens.css";

/* ===== DUINO SELECT - BEM METHODOLOGY ===== */

/* Block: duino-select */
.duino-select {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 100%;
    font-family: var(--duino-font);
    color: var(--duino-color-fg);
    cursor: pointer;
    outline: none;
}

.duino-select--disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.duino-select--disabled * {
    cursor: not-allowed !important;
}

/* ===== VARIANTS ===== */

/* Default variant - estilos ya definidos en selector base */

/* Filled variant */
.duino-select--filled .duino-select__selector {
    border: 1px solid transparent;
    background: var(--duino-brand-50);
}

.duino-select--filled .duino-select__selector:hover:not(.duino-select--disabled .duino-select__selector) {
    background: var(--duino-brand-100);
}

.duino-select--filled:focus .duino-select__selector,
.duino-select--filled.duino-select--open .duino-select__selector {
    background: var(--duino-color-bg);
    border-color: var(--duino-brand-400);
}

/* Borderless variant */
.duino-select--borderless .duino-select__selector {
    border: 1px solid transparent;
    background: transparent;
    padding-left: 0;
    padding-right: 0;
}

.duino-select--borderless .duino-select__selector:hover:not(.duino-select--disabled .duino-select__selector) {
    background: var(--duino-brand-50);
}

.duino-select--borderless:focus .duino-select__selector,
.duino-select--borderless.duino-select--open .duino-select__selector {
    background: var(--duino-brand-50);
    border-color: transparent;
    box-shadow: none;
}

/* ===== SIZES ===== */

/* Small */
.duino-select--sm .duino-select__selector {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 13px;
}

.duino-select--sm .duino-select__arrow {
    width: 12px;
    height: 12px;
}

/* Medium (default) - ya definido en selector base */
.duino-select--md .duino-select__selector {
    font-size: 14px;
}

.duino-select--md .duino-select__arrow {
    width: 14px;
    height: 14px;
}

/* Large */
.duino-select--lg .duino-select__selector {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 15px;
}

.duino-select--lg .duino-select__arrow {
    width: 16px;
    height: 16px;
}

/* ===== STATES ===== */

/* Focus state */
.duino-select:focus .duino-select__selector,
.duino-select--open .duino-select__selector {
    border-color: var(--duino-brand-400);
    box-shadow: 0 0 0 3px var(--duino-ring);
}

/* Error state */
.duino-select--error .duino-select__selector {
    border-color: var(--duino-danger-500);
}

.duino-select--error:focus .duino-select__selector,
.duino-select--error.duino-select--open .duino-select__selector {
    border-color: var(--duino-danger-500);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--duino-danger-500) 20%, transparent);
}

/* Success state */
.duino-select--success .duino-select__selector {
    border-color: var(--duino-brand-500);
}

/* Loading state */
.duino-select--loading {
    cursor: wait;
}

/* Open state */
.duino-select--open .duino-select__arrow {
    transform: rotate(180deg);
}

/* ===== ELEMENTS ===== */

/* Selector */
.duino-select__selector {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--duino-border);
    border-radius: var(--duino-radius);
    background: var(--duino-color-bg);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-sizing: border-box;
}

.duino-select__selector:hover:not(.duino-select--disabled .duino-select__selector) {
    border-color: var(--duino-brand-300);
}

/* Placeholder */
.duino-select__placeholder {
    color: var(--duino-color-muted);
    flex: 1;
    -webkit-user-select: none;
    user-select: none;
}

/* Single value */
.duino-select__single-value {
    display: flex;
    align-items: center;
    gap: var(--duino-gap-sm);
    flex: 1;
    -webkit-user-select: none;
    user-select: none;
}

/* Tags container */
.duino-select__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

/* Tag */
.duino-select__tag {
    display: inline-flex;
    align-items: center;
    background: var(--duino-brand-100);
    color: var(--duino-brand-700);
    padding: 4px 8px;
    border-radius: calc(var(--duino-radius) / 2);
    font-size: 12px;
    font-weight: 500;
    max-width: 150px;
    border: 1px solid var(--duino-brand-200);
    gap: 4px;
}

.duino-select__tag--more {
    background: var(--duino-color-muted);
    color: white;
    border-color: var(--duino-color-muted);
}

.duino-select__tag-content {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.duino-select__tag-close {
    appearance: none;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
    opacity: 0.7;
}

.duino-select__tag-close:hover {
    background: rgba(0, 0, 0, 0.15);
    opacity: 1;
    transform: scale(1.1);
}

/* Actions container */
.duino-select__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: var(--duino-gap-sm);
}

/* Clear button */
.duino-select__clear {
    appearance: none;
    background: none;
    border: none;
    color: var(--duino-color-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.duino-select__clear:hover {
    background: var(--duino-border);
    color: var(--duino-color-fg);
}

/* Loading icon */
.duino-select__loading-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.duino-select__spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--duino-border);
    border-top: 2px solid var(--duino-brand-500);
    border-radius: 50%;
    animation: duino-select-spin 1s linear infinite;
}

@keyframes duino-select-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Arrow */
.duino-select__arrow {
    color: var(--duino-color-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* ===== DROPDOWN ===== */

.duino-select__dropdown {
    background: var(--duino-color-bg);
    border: 1px solid var(--duino-brand-200);
    border-radius: var(--duino-radius);
    box-shadow:
        0 10px 25px rgba(20, 184, 166, 0.1),
        0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    animation: duino-select-dropdown-in 0.15s ease-out;
    min-width: 200px;
}

@keyframes duino-select-dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Search */
.duino-select__search {
    padding: 8px;
    border-bottom: 1px solid var(--duino-border);
}

.duino-select__search-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--duino-border);
    border-radius: calc(var(--duino-radius) / 2);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}

.duino-select__search-input:focus {
    border-color: var(--duino-brand-400);
    box-shadow: 0 0 0 2px var(--duino-ring);
}

/* Options container */
.duino-select__options {
    max-height: inherit;
    overflow-y: auto;
}

/* Option */
.duino-select__option {
    display: flex;
    align-items: flex-start;
    gap: var(--duino-gap-sm);
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid transparent;
    position: relative;
}

.duino-select__option:hover:not(.duino-select__option--disabled) {
    background: var(--duino-brand-50);
}

.duino-select__option--focused:not(.duino-select__option--disabled) {
    background: var(--duino-brand-100);
    border-left: 3px solid var(--duino-brand-400);
    padding-left: 9px;
}

.duino-select__option--selected {
    background: var(--duino-brand-500);
    color: white;
    font-weight: 500;
}

.duino-select__option--selected:hover {
    background: var(--duino-brand-600);
}

.duino-select__option--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Checkbox in option */
.duino-select__checkbox {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 2px solid var(--duino-brand-300);
    cursor: pointer;
    accent-color: var(--duino-brand-500);
    margin-top: 1px;
}

/* Option icon */
.duino-select__option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Option content */
.duino-select__option-content {
    flex: 1;
    min-width: 0;
}

.duino-select__option-label {
    display: block;
    font-weight: 500;
    line-height: 1.4;
}

.duino-select__option-description {
    display: block;
    font-size: 12px;
    color: var(--duino-color-muted);
    margin-top: 2px;
    line-height: 1.3;
}

.duino-select__option--selected .duino-select__option-description {
    color: rgba(255, 255, 255, 0.8);
}

/* Group */
.duino-select__group {
    border-bottom: 1px solid var(--duino-border);
}

.duino-select__group:last-child {
    border-bottom: none;
}

.duino-select__group-title {
    padding: 10px 12px 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--duino-brand-600);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: linear-gradient(135deg, var(--duino-brand-50), var(--duino-brand-100));
    border-bottom: 1px solid var(--duino-brand-200);
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Empty state */
.duino-select__empty {
    padding: 20px 12px;
    text-align: center;
    color: var(--duino-color-muted);
    font-style: italic;
}

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

@media (max-width: 640px) {
    .duino-select__dropdown {
        max-width: 100vw;
        margin: 0 8px;
    }

    .duino-select__option {
        padding: 12px;
    }

    .duino-select__tag {
        max-width: 120px;
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {

    .duino-select__selector,
    .duino-select__option,
    .duino-select__arrow,
    .duino-select__spinner {
        transition: none;
        animation: none;
    }

    .duino-select__dropdown {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .duino-select__selector {
        border-width: 2px;
    }

    .duino-select__option--selected {
        border: 2px solid currentColor;
    }
}

/* Focus styles for keyboard navigation */
.duino-select:focus-visible {
    outline: 2px solid var(--duino-ring);
    outline-offset: 2px;
}

.duino-select__clear:focus-visible,
.duino-select__tag-close:focus-visible {
    outline: 2px solid var(--duino-ring);
    outline-offset: 1px;
}

/* Print styles */
@media print {
    .duino-select__dropdown {
        display: none;
    }

    .duino-select__selector {
        border-color: #000;
    }
}/* Estado del body cuando hay modal abierto */
.is-modal-open {
    overflow: hidden;
}

/* Bloque principal */
.duino-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 160ms ease;
}

.duino-modal--open {
    pointer-events: auto;
    opacity: 1;
}

/* Fondo */
.duino-modal__mask {
    position: absolute;
    inset: 0;
    background: rgba(19, 21, 26, 0.45);
    backdrop-filter: saturate(120%) blur(2px);
}

/* Contenedor del diálogo */
.duino-modal__container {
    position: relative;
    box-sizing: border-box;
    margin: 48px auto;
    max-width: 90vw;
    background: var(--duino-color-bg);
    color: var(--duino-color-fg);
    border: 1px solid var(--duino-border);
    border-radius: var(--duino-radius);
    box-shadow:
        0 10px 20px rgba(0, 0, 0, .12),
        0 6px 6px rgba(0, 0, 0, .08);
    outline: none;

    /* Sutil borde superior con el color de marca (Arduino-ish) */
    border-top: 4px solid var(--ximo-brand-600, var(--duino-brand-600));
    /* fallback por si alguien renombra variables */
}

/* Centrado vertical opcional */
.duino-modal--centered .duino-modal__container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    /* anula margen superior cuando centrado */
}

/* Header */
.duino-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--duino-gap);
    padding: calc(var(--duino-gap-lg) + 2px) var(--duino-gap-lg);
    border-bottom: 1px solid var(--duino-border);
    background:
        linear-gradient(180deg, var(--duino-brand-50), transparent 60%);
    border-top-left-radius: var(--duino-radius);
    border-top-right-radius: var(--duino-radius);
}

.duino-modal__title {
    margin: 0;
    font-family: var(--duino-font);
    font-weight: 600;
    font-size: 1rem;
    color: var(--duino-brand-800);
}

/* Botón cerrar estilo Arduino */
.duino-modal__close {
    appearance: none;
    border: 1px solid var(--duino-border);
    background: #fff;
    font-size: 1.125rem;
    line-height: 1;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: box-shadow 120ms ease, transform 80ms ease;
}

.duino-modal__close:hover {
    box-shadow: 0 0 0 3px var(--duino-brand-100);
}

.duino-modal__close:active {
    transform: translateY(1px);
}

/* Body */
.duino-modal__body {
    padding: var(--duino-gap-lg);
    font-family: var(--duino-font);
    color: var(--duino-color-fg);
}

/* Footer */
.duino-modal__footer {
    display: flex;
    gap: var(--duino-gap);
    justify-content: flex-end;
    padding: var(--duino-gap-lg);
    border-top: 1px solid var(--duino-border);
    background: #fafafa;
    border-bottom-left-radius: var(--duino-radius);
    border-bottom-right-radius: var(--duino-radius);
}

/* Botones base reusables (Arduino look) */
.duino-btn {
    font-family: var(--duino-font);
    border-radius: 10px;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--duino-border);
    background: #fff;
    cursor: pointer;
    transition: box-shadow 120ms ease, transform 80ms ease, background 120ms ease;
}

.duino-btn:hover {
    box-shadow: 0 0 0 3px var(--duino-brand-100);
}

.duino-btn:active {
    transform: translateY(1px);
}

.duino-btn--primary {
    background: var(--duino-brand-600);
    color: #fff;
    border-color: var(--duino-brand-600);
}

.duino-btn--primary:hover {
    box-shadow: 0 0 0 3px var(--duino-brand-200);
}

.duino-btn--ghost {
    background: #fff;
    color: var(--duino-brand-800);
    border-color: var(--duino-border);
}

/* Animación de entrada (sutil “pop”) */
.duino-modal--open .duino-modal__container {
    animation: duino-modal-pop 160ms ease;
}

@keyframes duino-modal-pop {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Si no está centrado, ajustar animación de entrada sin translate -50% */
.duino-modal--open:not(.duino-modal--centered) .duino-modal__container {
    animation: duino-modal-pop-top 160ms ease;
}

@keyframes duino-modal-pop-top {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive: limitar ancho en pantallas pequeñas */
@media (max-width: 520px) {
    .duino-modal__container {
        width: calc(100vw - 24px) !important;
    }
}/* Import tokens */
@import "../../styles/tokens.css";

/* ===== DUINO UPLOAD - BEM METHODOLOGY ===== */

/* Block: duino-upload */
.duino-upload {
    font-family: var(--duino-font);
    color: var(--duino-color-fg);
}

.duino-upload--disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.duino-upload--disabled * {
    cursor: not-allowed !important;
}

/* ===== UPLOAD TYPES ===== */

/* Select type (default) */
.duino-upload--select {
    display: inline-block;
}

/* Drag type */
.duino-upload--drag {
    display: block;
}

.duino-upload__dragger {
    border: 2px dashed var(--duino-border);
    border-radius: var(--duino-radius);
    background: var(--duino-color-bg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.duino-upload__dragger:hover:not(.duino-upload--disabled .duino-upload__dragger) {
    border-color: var(--duino-brand-300);
    background: var(--duino-brand-50);
}

.duino-upload--drag-over .duino-upload__dragger {
    border-color: var(--duino-brand-400);
    background: var(--duino-brand-100);
    transform: scale(1.02);
}

.duino-upload__dragger-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--duino-gap);
}

.duino-upload__dragger-icon {
    width: 48px;
    height: 48px;
    color: var(--duino-brand-400);
    margin-bottom: var(--duino-gap-sm);
}

.duino-upload__dragger-text {
    color: var(--duino-color-fg);
}

.duino-upload__dragger-hint {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 500;
}

.duino-upload__dragger-description {
    margin: 0;
    font-size: 14px;
    color: var(--duino-color-muted);
}

/* Avatar type */
.duino-upload--avatar {
    display: inline-block;
}

.duino-upload__avatar {
    width: 100px;
    height: 100px;
    border: 2px dashed var(--duino-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    background: var(--duino-brand-50);
}

.duino-upload__avatar:hover:not(.duino-upload--disabled .duino-upload__avatar) {
    border-color: var(--duino-brand-400);
    background: var(--duino-brand-100);
}

.duino-upload__avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duino-upload__avatar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.duino-upload__avatar-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--duino-color-muted);
}

.duino-upload__avatar-icon {
    width: 24px;
    height: 24px;
}

.duino-upload__avatar-text {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

/* ===== FILE LIST ===== */

.duino-upload__list {
    margin-top: var(--duino-gap);
}

/* Text list */
.duino-upload__list--text {
    display: flex;
    flex-direction: column;
    gap: var(--duino-gap-sm);
}

.duino-upload__file-item {
    display: flex;
    align-items: center;
    gap: var(--duino-gap-sm);
    padding: 8px 12px;
    border: 1px solid var(--duino-border);
    border-radius: var(--duino-radius);
    background: var(--duino-color-bg);
    transition: all 0.2s ease;
}

.duino-upload__file-item--uploading {
    border-color: var(--duino-brand-300);
    background: var(--duino-brand-50);
}

.duino-upload__file-item--done {
    border-color: var(--duino-brand-200);
}

.duino-upload__file-item--error {
    border-color: var(--duino-danger-500);
    background: color-mix(in srgb, var(--duino-danger-500) 5%, transparent);
}

/* Picture list */
.duino-upload__list--picture .duino-upload__file-item {
    padding: 12px;
}

.duino-upload__file-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--duino-border);
}

/* Picture card list */
.duino-upload__list--picture-card {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--duino-gap);
}

.duino-upload__file-card {
    position: relative;
    border: 1px solid var(--duino-border);
    border-radius: var(--duino-radius);
    overflow: hidden;
    background: var(--duino-color-bg);
    aspect-ratio: 1;
    transition: all 0.2s ease;
}

.duino-upload__file-card:hover {
    border-color: var(--duino-brand-300);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.1);
}

.duino-upload__file-thumbnail {
    width: 100%;
    height: calc(100% - 32px);
    object-fit: cover;
}

.duino-upload__file-icon {
    width: 100%;
    height: calc(100% - 32px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: var(--duino-brand-50);
}

.duino-upload__file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: var(--duino-color-bg);
    border-top: 1px solid var(--duino-border);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.duino-upload__file-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.duino-upload__file-card:hover .duino-upload__file-actions {
    opacity: 1;
}

/* File info */
.duino-upload__file-info {
    flex: 1;
    min-width: 0;
}

.duino-upload__file-name {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.duino-upload__file-size {
    font-size: 12px;
    color: var(--duino-color-muted);
    margin-top: 2px;
}

.duino-upload__file-error {
    font-size: 12px;
    color: var(--duino-danger-500);
    margin-top: 2px;
}

/* Progress */
.duino-upload__file-progress {
    position: relative;
    margin-top: 4px;
    height: 4px;
    background: var(--duino-border);
    border-radius: 2px;
    overflow: hidden;
}

.duino-upload__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--duino-brand-400), var(--duino-brand-500));
    border-radius: 2px;
    transition: width 0.3s ease;
    position: relative;
}

.duino-upload__progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: duino-upload-progress-shine 2s infinite;
}

@keyframes duino-upload-progress-shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.duino-upload__progress-text {
    font-size: 11px;
    color: var(--duino-brand-600);
    font-weight: 500;
    margin-left: 8px;
}

/* Action buttons */
.duino-upload__action-btn {
    appearance: none;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    transition: background-color 0.2s ease;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.duino-upload__action-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.duino-upload__action-btn--danger {
    background: var(--duino-danger-500);
}

.duino-upload__action-btn--danger:hover {
    background: #dc2626;
}

/* For text/picture lists */
.duino-upload__list--text .duino-upload__file-actions,
.duino-upload__list--picture .duino-upload__file-actions {
    display: flex;
    gap: 4px;
    opacity: 1;
}

.duino-upload__list--text .duino-upload__action-btn,
.duino-upload__list--picture .duino-upload__action-btn {
    background: none;
    color: var(--duino-color-muted);
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    height: auto;
    width: auto;
}

.duino-upload__list--text .duino-upload__action-btn:hover,
.duino-upload__list--picture .duino-upload__action-btn:hover {
    background: var(--duino-border);
    color: var(--duino-color-fg);
}

.duino-upload__list--text .duino-upload__action-btn--danger:hover,
.duino-upload__list--picture .duino-upload__action-btn--danger:hover {
    background: var(--duino-danger-500);
    color: white;
}

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

@media (max-width: 640px) {
    .duino-upload__dragger {
        padding: 30px 16px;
    }

    .duino-upload__dragger-icon {
        width: 40px;
        height: 40px;
    }

    .duino-upload__dragger-hint {
        font-size: 15px;
    }

    .duino-upload__dragger-description {
        font-size: 13px;
    }

    .duino-upload__list--picture-card {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .duino-upload__avatar {
        width: 80px;
        height: 80px;
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {

    .duino-upload__dragger,
    .duino-upload__file-item,
    .duino-upload__file-card,
    .duino-upload__action-btn {
        transition: none;
    }

    .duino-upload--drag-over .duino-upload__dragger {
        transform: none;
    }

    .duino-upload__progress-bar::after {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .duino-upload__dragger {
        border-width: 3px;
    }

    .duino-upload__file-item {
        border-width: 2px;
    }
}

/* Focus styles */
.duino-upload__dragger:focus-visible {
    outline: 2px solid var(--duino-ring);
    outline-offset: 2px;
}

.duino-upload__action-btn:focus-visible {
    outline: 2px solid var(--duino-ring);
    outline-offset: 1px;
}

/* Print styles */
@media print {
    .duino-upload__file-actions {
        display: none;
    }

    .duino-upload__dragger {
        border-style: solid;
    }
}