/* Modal Personalizado - Estilo Moderno */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    box-shadow: 
        0 32px 64px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.85) translateY(30px) rotateX(10deg);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0) rotateX(0deg);
}

.modal-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #1e40af 100%);
    color: white;
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

.modal-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.025em;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.modal-body {
    padding: 36px 28px;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.modal-body.form-modal {
    text-align: left;
}

.modal-message {
    font-size: 17px;
    color: #374151;
    line-height: 1.7;
    margin-bottom: 32px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-align: left;
}

.modal-message form {
    margin: 0;
}

.modal-message input,
.modal-message textarea {
    font-family: inherit;
    box-sizing: border-box;
}

.modal-message label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    display: block;
    margin-bottom: 8px;
}

.modal-message input:focus,
.modal-message textarea:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.modal-btn:hover::before {
    left: 100%;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-btn-primary:hover {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
}

.modal-btn-secondary {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid #cbd5e1;
}

.modal-btn-secondary:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Tipos de Modal */
.modal-info .modal-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 50%, #0284c7 100%);
}

.modal-warning .modal-header {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #d97706 100%);
}

.modal-success .modal-header {
    background: linear-gradient(135deg, #10b981 0%, #22c55e 50%, #059669 100%);
}

.modal-error .modal-header {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 50%, #dc2626 100%);
}

.modal-confirm .modal-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 50%, #7c3aed 100%);
}

/* Responsivo */
@media (max-width: 640px) {
    .modal-container {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-body {
        padding: 24px 20px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}

/* Animações */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(30px) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0) rotateX(0deg);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0) rotateX(0deg);
    }
    to {
        opacity: 0;
        transform: scale(0.85) translateY(30px) rotateX(10deg);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.modal-container.animate-in {
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-container.animate-out {
    animation: modalSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-icon.pulse {
    animation: pulse 2s infinite;
}
