/* ============================================================
   INPUT STYLES - Monyma Design System
   ============================================================ */

/* Base Input - Small size (igual que botones) */
.input {
    display: flex;
    width: 100%;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 400;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

/* Placeholder */
.input::placeholder {
    color: var(--text-muted);
}

/* Focus state */
.input:focus {
    border-color: var(--text-secondary);
    background: var(--bg-secondary);
}

/* Disabled state */
.input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

/* Error state */
.input.input-error {
    border-color: var(--danger);
}

.input.input-error:focus {
    border-color: var(--danger);
}

/* Number input - Ocultar spinners (flechitas) para diseño limpio */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox - Ocultar spinners */
input[type="number"] {
    -moz-appearance: textfield;
}

/* Readonly state */
.input:read-only {
    background: var(--bg-secondary);
    cursor: default;
}

/* Date input styling */
.input[type="date"] {
    cursor: pointer;
    color-scheme: dark;
}

.input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.6);
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Textarea */
.textarea {
    display: block;
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    font-family: inherit;
    line-height: 1.5;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    resize: none;
    overflow-y: auto;
}

.textarea::placeholder {
    color: var(--text-muted);
}

.textarea:focus {
    border-color: #2d2d30;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

/* Scrollbar para textarea - Monyma style */
.textarea::-webkit-scrollbar {
    width: 11px; /* 8px thumb + 3px separación */
}

.textarea::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}

.textarea::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
    border-right: 3px solid transparent;
    background-clip: padding-box;
}

.textarea::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
    border-right: 3px solid transparent;
    background-clip: padding-box;
}


/* Select - Estilo shadcn/ui adaptado a Jade */
.select {
    display: flex;
    align-items: center;
    width: 100%;
    height: 36px; /* shadcn usa 36px */
    padding: 0 36px 0 12px;
    border-radius: 6px; /* shadcn usa 6px */
    border: 1px solid var(--border-primary);
    background-color: transparent; /* shadcn usa transparent */
    color: var(--text-primary);
    font-size: 14px; /* shadcn usa 14px */
    font-weight: 400;
    font-family: inherit;
    line-height: 1;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    /* Flecha SVG custom - shadcn style */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239A9C9D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.select:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-muted);
}

.select:focus {
    border-color: var(--jade-light);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 1px var(--jade-light);
}

.select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--bg-secondary);
    pointer-events: none;
}

/* Placeholder styling para select */
.select option[value=""] {
    color: var(--text-muted);
}

/* ============================================================
   INPUT WITH CLEAR BUTTON - Wrapper con botón X
   ============================================================ */
.input-wrapper {
    position: relative;
    display: inline-flex;
    width: 100%;
}

.input-wrapper .input {
    padding-right: 40px;
}

.input-clear-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.input-wrapper.has-value .input-clear-btn {
    display: flex;
}

.input-clear-btn:hover {
    background: var(--border-primary);
    color: var(--text-primary);
}

.input-clear-btn svg,
.input-clear-btn i {
    width: 14px;
    height: 14px;
}
