/* ========================================
   MODALS - DESTIN COMPANY
   Overlays y contenido de modales
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 2.5rem;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    box-shadow: var(--card-shadow);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
}

.close-modal:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    transform: rotate(90deg);
}

/* ======================================== 
   CONFIRMATION MODAL STYLES
   ======================================== */

.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirmation-modal.active {
    display: flex;
    opacity: 1;
}

.confirmation-modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease;
}

.confirmation-modal.active .confirmation-modal-content {
    transform: translateY(0) scale(1);
}

.confirmation-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    position: relative;
    overflow: hidden;
}

.confirmation-modal-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, var(--danger), #ff6b6b);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.confirmation-modal-icon i {
    color: var(--danger);
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.5));
}

.confirmation-modal-title {
    text-align: center;
    color: var(--text-light);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.confirmation-modal-message {
    text-align: center;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.confirmation-modal-list {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.confirmation-modal-list h4 {
    color: var(--danger);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confirmation-modal-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.confirmation-modal-list ul li {
    color: var(--text-muted);
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.9rem;
}

.confirmation-modal-list ul li::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: var(--danger);
    font-weight: bold;
}

.confirmation-modal-input {
    width: 100%;
    padding: 1rem;
    background: var(--bg-hover);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
    letter-spacing: 2px;
}

.confirmation-modal-input:focus {
    outline: none;
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.confirmation-modal-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: normal;
}

.confirmation-modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.confirmation-modal-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Outfit', sans-serif;
}

.confirmation-modal-btn-cancel {
    background: var(--bg-hover);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.confirmation-modal-btn-cancel:hover {
    background: var(--bg-card);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.confirmation-modal-btn-confirm {
    background: linear-gradient(135deg, var(--danger), #ff6b6b);
    color: white;
    position: relative;
    overflow: hidden;
}

.confirmation-modal-btn-confirm::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.confirmation-modal-btn-confirm:hover::before {
    width: 300px;
    height: 300px;
}

.confirmation-modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

.confirmation-modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Responsive */
@media (max-width: 640px) {
    .confirmation-modal-content {
        padding: 2rem 1.5rem;
    }

    .confirmation-modal-title {
        font-size: 1.5rem;
    }

    .confirmation-modal-buttons {
        flex-direction: column;
    }
}

/* Shake Animation */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-10px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(10px);
    }
}

/* ========================================
   NOTIFICATION MODAL STYLES
   ======================================== */

.notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-modal.active {
    display: flex;
    opacity: 1;
}

.notification-modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 450px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease;
    text-align: center;
}

.notification-modal.active .notification-modal-content {
    transform: translateY(0) scale(1);
}

.notification-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.notification-modal-icon i {
    filter: drop-shadow(0 0 20px currentColor);
}

/* Variantes de color */
.notification-success .notification-modal-icon {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid var(--success);
}

.notification-success .notification-modal-icon i {
    color: var(--success);
}

.notification-error .notification-modal-icon {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger);
}

.notification-error .notification-modal-icon i {
    color: var(--danger);
}

.notification-warning .notification-modal-icon {
    background: rgba(251, 191, 36, 0.1);
    border: 2px solid #fbbf24;
}

.notification-warning .notification-modal-icon i {
    color: #fbbf24;
}

.notification-info .notification-modal-icon {
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid #3b82f6;
}

.notification-info .notification-modal-icon i {
    color: #3b82f6;
}

.notification-modal-title {
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.notification-modal-message {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.notification-modal-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
}

.notification-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* ========================================
   CONFIRM MODAL STYLES (SIMPLE)
   ======================================== */

.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-modal.active {
    display: flex;
    opacity: 1;
}

.confirm-modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease;
}

.confirm-modal.active .confirm-modal-content {
    transform: translateY(0) scale(1);
}

.confirm-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: rgba(251, 191, 36, 0.1);
    border: 2px solid #fbbf24;
}

.confirm-modal-icon i {
    color: #fbbf24;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5));
}

.confirm-modal-title {
    text-align: center;
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.confirm-modal-message {
    text-align: center;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.confirm-modal-details {
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.confirm-modal-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.confirm-modal-details ul li {
    color: var(--text-muted);
    padding: 0.3rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.9rem;
}

.confirm-modal-details ul li::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: #fbbf24;
    font-weight: bold;
}

.confirm-modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.confirm-modal-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Outfit', sans-serif;
}

.confirm-modal-btn-cancel {
    background: var(--bg-hover);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.confirm-modal-btn-cancel:hover {
    background: var(--bg-card);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.confirm-modal-btn-confirm {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
}

.confirm-modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* ========================================
   INPUT MODAL STYLES
   ======================================== */

.input-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.input-modal.active {
    display: flex;
    opacity: 1;
}

.input-modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 450px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease;
}

.input-modal.active .input-modal-content {
    transform: translateY(0) scale(1);
}

.input-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid #3b82f6;
}

.input-modal-icon i {
    color: #3b82f6;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.5));
}

.input-modal-title {
    text-align: center;
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.input-modal-message {
    text-align: center;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.input-modal-input {
    width: 100%;
    padding: 1rem;
    background: var(--bg-hover);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.input-modal-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-modal-buttons {
    display: flex;
    gap: 1rem;
}

.input-modal-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Outfit', sans-serif;
}

.input-modal-btn-cancel {
    background: var(--bg-hover);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.input-modal-btn-cancel:hover {
    background: var(--bg-card);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.input-modal-btn-confirm {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
}

.input-modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* Responsive para todos los modales */
@media (max-width: 640px) {

    .notification-modal-content,
    .confirm-modal-content,
    .input-modal-content {
        padding: 2rem 1.5rem;
    }

    .notification-modal-title,
    .confirm-modal-title,
    .input-modal-title {
        font-size: 1.25rem;
    }

    .confirm-modal-buttons,
    .input-modal-buttons {
        flex-direction: column;
    }
}

/* ========================================
   MOBILE MODAL ACCESSIBILITY FIXES
   Ensure close buttons are always visible on mobile devices
   ======================================== */
@media (max-width: 768px) {

    /* Reduce modal height to account for mobile browser chrome */
    .modal-content {
        max-height: 85vh !important;
        padding: 1.5rem 1rem !important;
        max-width: 95% !important;
        margin: auto;
    }

    .modal-overlay {
        padding: 0.5rem !important;
        align-items: flex-start !important;
        padding-top: 1rem !important;
    }

    /* Make close button sticky at the top */
    .close-modal {
        position: sticky !important;
        top: -0.5rem;
        z-index: 10;
        background: var(--bg-card);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    /* Confirmation modals */
    .confirmation-modal-content,
    .notification-modal-content,
    .confirm-modal-content,
    .input-modal-content {
        max-height: 85vh !important;
        overflow-y: auto;
        padding: 1.5rem 1rem !important;
    }
}

/* ========================================
   SUPPLIER SECTION RESPONSIVE STYLES
   Estilos para la sección de proveedores en móviles
   ======================================== */

@media (max-width: 768px) {

    /* Make tables scrollable horizontally on mobile */
    .glass-panel table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure table headers and cells have proper padding */
    .glass-panel table th,
    .glass-panel table td {
        padding: 0.4rem !important;
        font-size: 0.75rem !important;
    }

    /* Stack instruction cards vertically on mobile */
    .supplier-instruction-cards {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        grid-template-columns: 1fr !important;
    }

    /* Ensure glass panels have proper spacing */
    .glass-panel {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }

    /* Make section headers stack properly */
    .glass-panel h3 {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }

    /* Adjust paragraph text size */
    .glass-panel p {
        font-size: 0.85rem !important;
    }

    /* Stack buttons properly on mobile */
    .glass-panel button {
        font-size: 0.85rem !important;
        padding: 0.6rem 1rem !important;
    }

    /* Fix header buttons to stack on mobile */
    div[style*="display: flex"][style*="justify-content: space-between"] {
        flex-direction: column !important;
        gap: 1rem !important;
    }
}

/* Additional responsive fixes for very small screens */
@media (max-width: 480px) {
    .glass-panel table {
        font-size: 0.7rem !important;
    }

    .glass-panel table th,
    .glass-panel table td {
        padding: 0.3rem !important;
    }

    /* Make instruction lists more compact */
    .glass-panel ul {
        margin-left: 0.8rem !important;
        font-size: 0.75rem !important;
    }

    .glass-panel ul li {
        margin-bottom: 0.3rem;
    }
}