/* ============================================ */
/* IMAGE CONFIRMATION MODAL - THEME AWARE V2 */
/* ============================================ */

/* Modal Container (Full Screen Overlay) */
#image-confirmation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2147483647 !important;
    /* Max Z-Index posible */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
}

/* 
   THEME VARIABLES LOCAL SCOPE 
   El JS copiará data-theme al modal, así que usamos selectores locales 
*/

/* Default Dark Theme */
#image-confirmation-modal {
    --m-bg-card: #1e1e24;
    --m-bg-sec: #111111;
    --m-text: #ffffff;
    --m-text-sec: #aaaaaa;
    --m-border: rgba(255, 255, 255, 0.1);
    --m-select-bg: #2a2a35;
}

/* Light Theme Override */
#image-confirmation-modal[data-theme="light"] {
    --m-bg-card: #ffffff;
    --m-bg-sec: #f3f4f6;
    /* Gris muy clarito para fondo imagen */
    --m-text: #1f2937;
    /* Gris casi negro */
    --m-text-sec: #6b7280;
    --m-border: #e5e7eb;
    --m-select-bg: #f9fafb;
}

/* Wrapper Flotante Compacto */
.modal-content-wrapper {
    position: relative;
    width: 90%;
    max-width: 380px;
    background: var(--m-bg-card);
    border-radius: 20px;
    box-shadow: 0 25px 100px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--m-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--m-text);
}

@keyframes modalPop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

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

/* Header Actions */
.modal-header-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.modal-close-btn {
    background: rgba(0, 0, 0, 0.5);
    /* Siempre oscuro para contraste con imagen */
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: scale(1.1);
    border-color: transparent;
}

/* Image Area */
.modal-image-area {
    background: var(--m-bg-sec);
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border-bottom: 1px solid var(--m-border);
    position: relative;
    /* Patrón sutil */
    background-image: radial-gradient(var(--m-border) 1px, transparent 1px);
    background-size: 20px 20px;
}

.modal-image-area img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--m-border);
}

/* Footer / Controls */
.modal-footer {
    background: var(--m-bg-card);
    padding: 20px;
}

.modal-footer label {
    color: var(--m-text-sec);
    font-size: 0.8rem;
    margin-bottom: 8px;
    display: block;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Styled Select */
#modal-timer-select {
    background: var(--m-select-bg);
    color: var(--m-text);
    border: 1px solid var(--m-border);
    padding: 12px;
    border-radius: 10px;
    width: 100%;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    /* Chevron dinámico (SVG con currentColor para adaptarse al texto) */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' 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;
}

#modal-timer-select:focus {
    border-color: #ec4899;
    outline: none;
}

#modal-timer-select option {
    background: var(--m-bg-card);
    color: var(--m-text);
    padding: 10px;
}

/* Send Button */
.modal-send-btn {
    width: 100%;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    border: none;
    padding: 14px;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.4);
}

.modal-send-btn svg {
    width: 18px;
    height: 18px;
}