/* Spinner de carga */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Estado de procesamiento en nueva disciplina */
.disc-new-wrap--processing {
    opacity: 0.7;
}

.disc-new-wrap--processing .disc-new-add {
    background: #444 !important;
    cursor: wait;
}

.disc-new-wrap--processing .disc-new-input {
    cursor: wait;
    opacity: 0.5;
}

/* Dropdown para agregar equipos */
.disc-add-container {
    position: relative;
    display: inline-block;
}

.disc-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.25);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.disc-add-btn:hover {
    background: var(--accent-pink);
    border-color: var(--accent-pink);
    color: #1a1a1a;
    transform: rotate(90deg) scale(1.1);
}

.disc-add-btn svg {
    width: 14px;
    height: 14px;
}

.disc-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 240px;
    background: #2a2827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    padding: 6px 0;
}

.disc-dropdown__header {
    padding: 8px 14px;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 4px;
}

.disc-dropdown--show {
    display: block !important;
    animation: fadeInDown 0.2s ease;
}

.disc-dropdown__item {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-white);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.disc-dropdown__item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.disc-dropdown__item--selected {
    background: var(--accent-pink) !important;
    color: #1a1a1a !important;
}

.disc-dropdown__item--selected .disc-dropdown__id {
    color: #1a1a1a !important;
    opacity: 0.8;
}

.disc-dropdown__id {
    display: block;
    font-size: 10px;
    opacity: 0.6;
    margin-top: 2px;
}

/* Panel de Selector de Color (Desplegable) — MODO OSCURO */
.disc-color-pick {
    position: relative;
    /* Para el dropdown */
}

.color-picker-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: #2c2a29;
    /* Fondo oscuro café */
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: none;
    animation: fadeInDown 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.color-picker-dropdown--show {
    display: block !important;
}

.color-picker-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 67px;
    /* Movido a la izquierda para alinear con el cuadro */
    width: 12px;
    height: 12px;
    background: #2c2a29;
    transform: rotate(45deg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.color-picker-card__title {
    color: var(--text-white);
    /* Texto blanco */
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

.color-picker-visual {
    width: 100%;
    height: 140px;
    border-radius: 8px;
    margin-bottom: 16px;
    cursor: crosshair;
    position: relative;
    overflow: hidden;
    background: red;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.color-picker-cursor {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 5;
    transition: all 0.1s ease-out;
    /* Suavidad al mover */
}

.color-picker-visual__white {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #fff, transparent);
}

.color-picker-visual__black {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, #000, transparent);
}

.color-preview-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.color-preview-swatch {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 2px solid #f0f0f0;
}

.color-hex-input-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.color-hex-label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.color-hex-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 700;
    color: var(--text-white);
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
}

.color-hex-input:focus {
    border-color: var(--accent-pink);
    background: rgba(255, 255, 255, 0.1);
}

.color-picker-actions {
    display: flex;
    gap: 10px;
}

.btn-picker {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: none;
}

.btn-picker--cancel {
    background: transparent;
    border: 1.5px solid var(--accent-pink);
    color: var(--accent-pink);
}

.btn-picker--cancel:hover {
    background: rgba(224, 136, 191, 0.1);
}

.btn-picker--save {
    background: var(--accent-pink);
    color: #2c2a29;
}

.btn-picker--save:hover {
    transform: translateY(-1px);
}

.btn-picker--save:disabled {
    opacity: 0.5;
    cursor: wait;
}

.color-picker-hue-wrap {
    margin-bottom: 16px;
}

.hue-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
    outline: none;
    cursor: pointer;
}

.hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #2c2a29;
}

/* Enlace Borrar Todos */
.disc-clear-all {
    display: inline-block;
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 4px 8px;
    opacity: 0.5;
    transition: all 0.2s;
}

.disc-clear-all:hover {
    opacity: 1;
    color: #ff4d4d;
    text-decoration: underline;
}

/* Edición Inline de Puntos */
.disc-score-row__val {
    cursor: pointer;
    min-width: 30px;
    text-align: right;
    transition: all 0.2s;
    border-radius: 4px;
    padding: 2px 4px;
}

.disc-score-row__val:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-pink);
}

.disc-inline-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--accent-pink);
    color: var(--text-white);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    width: 50px;
    text-align: right;
    border-radius: 4px;
    outline: none;
    padding: 0 4px;
}

/* Quitar flechitas de subir/bajar en inputs numéricos */
.disc-inline-input::-webkit-outer-spin-button,
.disc-inline-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.disc-inline-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Nuevo contenedor para edición inline con botón */
.disc-inline-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--accent-pink);
    border-radius: 4px;
    padding: 0 4px;
    margin-right: -4px;
    /* Ajuste para no mover el texto */
    animation: fadeIn 0.2s ease;
}

.disc-inline-wrap .disc-inline-input {
    background: transparent;
    border: none;
    width: 38px;
    padding: 0;
}

.disc-inline-save-btn {
    background: transparent;
    border: none;
    color: var(--accent-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 2px;
    transition: transform 0.2s;
}

.disc-inline-save-btn:hover {
    transform: scale(1.2);
    color: var(--text-white);
}

.disc-inline-save-btn svg {
    width: 14px;
    height: 14px;
}

.disc-inline-input.saving {
    opacity: 0.6;
    pointer-events: none;
    cursor: wait;
}

.disc-tag__remove {
    margin-left: 6px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.disc-tag:hover .disc-tag__remove {
    opacity: 1;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Edición de Título de Disciplina */
.disc-title-edit {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    animation: fadeInTitle 0.2s ease;
}

.disc-title-input {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--accent-pink);
    border-radius: 10px;
    padding: 8px 16px;
    color: var(--text-white);
    font-size: 30px;
    font-weight: 700;
    width: 100%;
    outline: none;
    font-family: inherit;
    letter-spacing: -0.5px;
}

.disc-title-save-btn {
    background: var(--accent-pink);
    border: none;
    border-radius: 8px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.disc-title-save-btn:hover {
    background: var(--accent-pink-hover);
    transform: scale(1.05);
}

.disc-title-save-btn svg {
    width: 20px;
    height: 20px;
}

@keyframes fadeInTitle {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}