/* MODAL DE SUGERENCIAS */
.sugerencias-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sugerencias-modal-content {
    background: rgba(26, 26, 26, 0.3);
    backdrop-filter: blur(25px);
    border: none;
    border-radius: 16px;
    width: 90%;
    max-width: 350px;
    animation: slideIn 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sugerencias-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: rgba(35, 35, 35, 0.2);
    backdrop-filter: blur(15px);
    border-radius: 16px 16px 0 0;
}

.sugerencias-header h2 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.sugerencias-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.sugerencias-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: scale(1.1);
}

.sugerencias-form {
    padding: 20px 25px 25px 25px;
}

.sugerencias-field {
    margin-bottom: 15px;
}

.sugerencias-field label {
    display: none;
}

.sugerencias-field input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.sugerencias-field input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(255, 0, 128, 0.3);
}

.sugerencias-field input::placeholder {
    color: #bbb;
}

/* AUTOCOMPLETADO */
.sugerencias-autocomplete {
    position: relative;
}

.sugerencias-lista {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(42, 42, 42, 0.95);
    backdrop-filter: blur(15px);
    border: none;
    border-radius: 12px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.sugerencia-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sugerencia-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sugerencia-item:last-child {
    border-bottom: none;
}

.sugerencia-poster {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
    background: #333;
}

.sugerencia-info {
    flex: 1;
    min-width: 0;
}

.sugerencia-titulo {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sugerencia-meta {
    color: #aaa;
    font-size: 12px;
    text-transform: capitalize;
}

.sugerencia-error,
.sugerencia-no-results {
    padding: 15px;
    text-align: center;
    color: #aaa;
    font-size: 13px;
    font-style: italic;
}

.sugerencia-error {
    color: #ff6b6b;
}

/* BOTONES */
.sugerencias-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.sugerencias-buttons button {
    padding: 12px 32px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancelar {
    display: none;
}

.btn-enviar {
    background: linear-gradient(135deg, #ff0080, #e91e63);
    color: #fff;
    border: 1px solid transparent;
    min-width: 120px;
}

.btn-enviar:hover:not(:disabled) {
    background: linear-gradient(135deg, #e6006b, #d81159);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 128, 0.4);
}

.btn-enviar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .sugerencias-modal {
        align-items: flex-start;
        padding-top: 5vh;
    }
    
    .sugerencias-modal-content {
        width: 95%;
        margin: 0 10px;
        position: relative;
        max-height: none;
    }
    
    .sugerencias-header {
        padding: 15px 20px;
    }
    
    .sugerencias-header h2 {
        font-size: 16px;
    }
    
    .sugerencias-form {
        padding: 20px;
    }
    
    .sugerencias-field {
        margin-bottom: 18px;
    }
    
    .sugerencias-field input {
        padding: 12px 14px;
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .sugerencias-buttons button {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }
    
    /* Lista de sugerencias en tablets/móviles - aparece en posición fija */
    .sugerencias-lista {
        position: fixed !important;
        top: 30vh !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 95% !important;
        max-width: none !important;
        max-height: 40vh;
        z-index: 10002 !important;
    }
    
    .sugerencia-item {
        padding: 12px 15px;
    }
    
    .sugerencia-poster {
        width: 35px;
        height: 52px;
        margin-right: 10px;
    }
    
    .sugerencia-titulo {
        font-size: 13px;
    }
    
    .sugerencia-meta {
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .sugerencias-modal {
        align-items: flex-start;
        padding-top: 5vh;
    }
    
    .sugerencias-modal-content {
        width: 95%;
        margin: 0 10px;
        position: relative;
        max-height: none;
    }
    
    .sugerencias-header {
        padding: 15px 20px;
    }
    
    .sugerencias-header h2 {
        font-size: 16px;
    }
    
    .sugerencias-form {
        padding: 20px;
    }
    
    .sugerencias-field {
        margin-bottom: 18px;
    }
    
    .sugerencias-field input {
        padding: 12px 14px;
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .sugerencias-buttons button {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }
    
    /* Lista de sugerencias en móvil - aparece en posición fija */
    .sugerencias-lista {
        position: fixed !important;
        top: 30vh !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 95% !important;
        max-width: none !important;
        max-height: 40vh;
        z-index: 10002 !important;
    }
    
    .sugerencia-item {
        padding: 12px 15px;
    }
    
    .sugerencia-poster {
        width: 35px;
        height: 52px;
        margin-right: 10px;
    }
    
    .sugerencia-titulo {
        font-size: 13px;
    }
    
    .sugerencia-meta {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .sugerencias-modal {
        padding-top: 2vh;
    }
    
    .sugerencias-modal-content {
        width: 98%;
        margin: 0 5px;
        border-radius: 12px;
    }
    
    .sugerencias-header {
        padding: 12px 15px;
        border-radius: 12px 12px 0 0;
    }
    
    .sugerencias-header h2 {
        font-size: 15px;
    }
    
    .sugerencias-close {
        font-size: 24px;
        width: 26px;
        height: 26px;
    }
    
    .sugerencias-form {
        padding: 15px;
    }
    
    .sugerencias-field input {
        font-size: 16px; /* Importante para iOS */
        padding: 14px;
    }
    
    /* En móviles pequeños, lista más compacta y arriba */
    .sugerencias-lista {
        top: 25vh !important;
        width: 98% !important;
        max-height: 45vh;
    }
    
    .sugerencia-item {
        padding: 10px 12px;
    }
    
    .sugerencia-poster {
        width: 30px;
        height: 45px;
        margin-right: 8px;
    }
    
    .sugerencia-titulo {
        font-size: 12px;
    }
    
    .sugerencia-meta {
        font-size: 10px;
    }
}

/* Clase especial cuando aparece el teclado */
.sugerencias-modal.keyboard-active {
    align-items: flex-start;
    padding-top: 2vh;
}

.sugerencias-modal.keyboard-active .sugerencias-modal-content {
    transform: translateY(0);
}

.sugerencias-modal.keyboard-active .sugerencias-lista {
    top: 15vh !important;
    max-height: 35vh;
}

/* SCROLLBAR PERSONALIZADO PARA LA LISTA */
.sugerencias-lista::-webkit-scrollbar {
    width: 6px;
}

.sugerencias-lista::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sugerencias-lista::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sugerencias-lista::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}