/* Estilos para a seção de Campanhas */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: #dcfce7;
    color: #047857;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

.badge-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.btn-icon {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #3b82f6;
}

.btn-icon.btn-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

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

/* QR Code Wizard */
.qr-wizard {
    max-width: 600px;
    width: 100%;
}

.qr-wizard .modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qr-wizard .modal-header h3 {
    margin: 0;
    color: #111827;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qr-wizard .close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.qr-wizard .close-modal:hover {
    color: #111827;
}

.qr-wizard .modal-body {
    padding: 2rem;
}

.qr-preview {
    text-align: center;
    margin-bottom: 2rem;
}

.qr-image {
    max-width: 100%;
    height: auto;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    background: white;
    margin-bottom: 1rem;
}

.qr-link {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: #f9fafb;
    padding: 0.75rem;
    border-radius: 8px;
}

.qr-link-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    color: #374151;
    outline: none;
}

.qr-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.option-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.size-options,
.format-options {
    display: flex;
    gap: 0.5rem;
}

.size-btn,
.format-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.size-btn:hover,
.format-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.size-btn.active,
.format-btn.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
}

.qr-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.qr-actions .btn {
    flex: 1;
    min-width: 150px;
    padding: 0.875rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.qr-actions .btn-primary {
    background: #3b82f6;
    color: white;
}

.qr-actions .btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.qr-actions .btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.qr-actions .btn-secondary:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Responsive - Campaign Modal */
#campaignModal .modal-content {
    max-width: 800px;
    width: 95%;
}

#campaignModal form > div[style*="grid"] {
    display: grid !important;
    gap: 1.5rem;
}

/* Força responsividade nos grids inline do modal */
#campaignModal form div[style*="grid-template-columns: 1fr 1fr"] {
    display: grid !important;
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 95% !important;
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    #campaignModal .modal-header {
        padding: 1rem !important;
        flex-wrap: wrap;
    }
    
    #campaignModal .modal-header h2 {
        font-size: 1.25rem !important;
    }
    
    #campaignModal form {
        padding: 1rem !important;
    }
    
    #campaignModal form > div > div {
        padding: 1rem !important;
    }
    
    /* Força grid de 1 coluna em mobile */
    #campaignModal form div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Botões em coluna no mobile */
    #campaignModal form > div > div:last-child {
        flex-direction: column !important;
    }
    
    #campaignModal form button {
        width: 100% !important;
    }
    
    /* Ajustes de espaçamento */
    #campaignModal details {
        padding: 1rem !important;
    }
    
    #campaignModal input,
    #campaignModal select,
    #campaignModal textarea {
        font-size: 16px !important; /* Previne zoom no iOS */
    }
    
    .qr-wizard .modal-body {
        padding: 1.5rem;
    }
    
    .qr-actions {
        flex-direction: column;
    }
    
    .qr-actions .btn {
        width: 100%;
        min-width: 100%;
    }
    
    .size-options,
    .format-options {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .modal-content {
        max-width: 100% !important;
        margin: 0;
        border-radius: 0 !important;
        max-height: 100vh;
    }
    
    #campaignModal .modal-header {
        border-radius: 0 !important;
    }
    
    #campaignModal form {
        padding: 0.75rem !important;
    }
    
    #campaignModal form > div > div {
        padding: 0.75rem !important;
    }
    
    #campaignModal .modal-header h2 {
        font-size: 1.1rem !important;
    }
}
