/**
 * ================================================
 * MODAL DE PACOTES - DESIGN MODERNO E FUNCIONAL
 * ================================================
 * Estilo específico para o modal de criar/editar pacotes
 * Design clean, gradientes sutis e interações fluidas
 */

/* ===== ESTRUTURA DO MODAL ===== */
.modern-modal-pacote {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ===== HEADER COM GRADIENTE ===== */
.modern-modal-pacote .gradient-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.modern-modal-pacote .gradient-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.modern-modal-pacote .header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.modern-modal-pacote .icon-wrapper {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
}

.modern-modal-pacote .modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== BODY DO MODAL ===== */
.modern-modal-body {
    padding: 2rem;
    background: var(--bg-primary, #ffffff);
    max-height: 70vh;
    overflow-y: auto;
}

/* Scrollbar personalizada */
.modern-modal-body::-webkit-scrollbar {
    width: 8px;
}

.modern-modal-body::-webkit-scrollbar-track {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 4px;
}

.modern-modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color, #dee2e6);
    border-radius: 4px;
}

.modern-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary, #6c757d);
}

/* ===== SEÇÕES DO FORMULÁRIO ===== */
.form-section {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e9ecef);
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color, #e9ecef);
}

.section-header i {
    color: var(--primary-color, #667eea);
    font-size: 1.25rem;
}

.section-header h6 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
}

/* ===== CAMPOS DO FORMULÁRIO ===== */
.form-floating-modern {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-label-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary, #2c3e50);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-label-modern i {
    color: var(--primary-color, #667eea);
    font-size: 0.9rem;
}

.form-select-modern,
.form-control-modern {
    border: 2px solid var(--border-color, #e9ecef);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--input-bg, #ffffff);
    color: var(--text-primary, #2c3e50);
}

.form-select-modern:focus,
.form-control-modern:focus {
    border-color: var(--primary-color, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.form-select-modern:hover,
.form-control-modern:hover {
    border-color: var(--primary-color, #667eea);
}

.form-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #6c757d);
}

.form-hint i {
    font-size: 0.8rem;
    color: var(--primary-color, #667eea);
}

/* ===== CARD DE PREVIEW DO PLANO ===== */
.plano-preview-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 2px dashed var(--border-color, #e9ecef);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.plano-preview-card:has(.summary-content:not(.d-none)) {
    background: var(--card-bg, #ffffff);
    border-style: solid;
    border-color: var(--primary-color, #667eea);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.summary-placeholder {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary, #6c757d);
}

.summary-placeholder i {
    font-size: 3rem;
    color: var(--primary-color, #667eea);
    opacity: 0.3;
    margin-bottom: 1rem;
    display: block;
}

.summary-placeholder p {
    margin: 0;
    font-size: 0.95rem;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color, #e9ecef);
}

.preview-header i {
    color: var(--primary-color, #667eea);
    font-size: 1.1rem;
}

.preview-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
}

.preview-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color, #e9ecef);
}

.preview-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.preview-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary, #6c757d);
    margin-bottom: 0.5rem;
}

.preview-item label i {
    color: var(--primary-color, #667eea);
}

.preview-value {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.preview-value strong {
    font-size: 1.1rem;
    color: var(--text-primary, #2c3e50);
}

.preview-value small {
    font-size: 0.85rem;
}

/* ===== EDIÇÃO INLINE ===== */
.preview-value-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.value-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.value-display strong {
    font-size: 1.1rem;
    color: var(--text-primary, #2c3e50);
}

.btn-edit-inline {
    background: transparent;
    border: 1px solid var(--border-color, #e9ecef);
    color: var(--primary-color, #667eea);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-inline:hover {
    background: var(--primary-color, #667eea);
    color: white;
    transform: translateY(-1px);
}

.custom-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.custom-input-group input {
    flex: 1;
    border: 2px solid var(--primary-color, #667eea);
    border-radius: 6px;
    padding: 0.5rem;
}

.custom-input-group button {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* ===== INFO BOX ===== */
.info-box {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 152, 0, 0.1) 100%);
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    margin-top: 1rem;
}

.info-box i {
    color: #ffc107;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
}

.info-content strong {
    display: block;
    color: var(--text-primary, #2c3e50);
    margin-bottom: 0.25rem;
}

.info-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #6c757d);
}

/* ===== FOOTER DO MODAL ===== */
.modern-modal-footer {
    padding: 1.5rem 2rem;
    background: var(--bg-secondary, #f8f9fa);
    border-top: 1px solid var(--border-color, #e9ecef);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-modern {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-modern i {
    font-size: 0.9rem;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary.btn-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.btn-primary.btn-modern:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 992px) {
    .modern-modal-pacote .modal-dialog {
        max-width: 95%;
        margin: 1rem auto;
    }

    .form-section {
        margin-bottom: 1rem;
    }

    .modern-modal-body {
        padding: 1.5rem;
    }

    .section-header h6 {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .modern-modal-pacote .gradient-header {
        padding: 1rem 1.5rem;
    }

    .modern-modal-pacote .header-content {
        gap: 0.75rem;
    }

    .modern-modal-pacote .icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .modern-modal-pacote .modal-title {
        font-size: 1.25rem;
    }

    .modern-modal-body {
        padding: 1rem;
    }

    .form-section {
        padding: 1rem;
    }

    .modern-modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }

    .btn-modern {
        width: 100%;
        justify-content: center;
    }
}

/* ===== DARK MODE ===== */
[data-theme="dark"] .modern-modal-pacote {
    background: var(--dark-bg-primary, #1a1d29);
}

[data-theme="dark"] .modern-modal-body {
    background: var(--dark-bg-primary, #1a1d29);
}

[data-theme="dark"] .form-section {
    background: var(--dark-card-bg, #252836);
    border-color: var(--dark-border-color, #2d3142);
}

[data-theme="dark"] .plano-preview-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: var(--dark-border-color, #2d3142);
}

[data-theme="dark"] .plano-preview-card:has(.summary-content:not(.d-none)) {
    background: var(--dark-card-bg, #252836);
}

[data-theme="dark"] .form-select-modern,
[data-theme="dark"] .form-control-modern {
    background: var(--dark-input-bg, #1a1d29);
    border-color: var(--dark-border-color, #2d3142);
    color: var(--dark-text-primary, #e4e6eb);
}

[data-theme="dark"] .modern-modal-footer {
    background: var(--dark-card-bg, #252836);
    border-color: var(--dark-border-color, #2d3142);
}

[data-theme="dark"] .info-box {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 152, 0, 0.15) 100%);
}

/* ===== ANIMAÇÕES DE ENTRADA ===== */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal.show .modern-modal-pacote {
    animation: slideInDown 0.3s ease-out;
}

/* ===== ESTADOS DE LOADING ===== */
.btn-modern.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-modern.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
