/**
 * CSS para Configuração de E-mail - email_config.css
 * 
 * @author Claudio Felix - Mappersona Consultoria
 */


/* Seções do formulário */
.section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    margin: 25px -15px 20px -15px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header i {
    font-size: 18px;
}

.section-header:first-of-type {
    margin-top: 0;
}

/* Formulário */
#form_email_config .form-group {
    margin-bottom: 20px;
}

#form_email_config .form-group label {
    color: #2c3e50;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

#form_email_config .form-control {
    height: 44px;
    border: 1px solid #d5dce3;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    color: #2c3e50;
    transition: all 0.2s ease;
}

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

#form_email_config .form-control::placeholder {
    color: #b0b9c2;
}

/* Select/Combo personalizado */
#form_email_config select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    padding-right: 40px;
}

/* Radio buttons */
#form_email_config .btn-group {
    display: flex;
    gap: 10px;
}

#form_email_config .btn-group label {
    min-width: 80px;
    text-align: center;
}

/* Correção específica para TRadioGroup com setUseButton() */
#form_email_config .btn-group .btn {
    margin: 0;
    padding: 8px 16px;
}

#form_email_config .btn-group input[type="radio"] {
    position: absolute !important;
    clip: rect(0, 0, 0, 0) !important;
    pointer-events: none !important;
    opacity: 0 !important;
}

#form_email_config .btn-group .btn-default {
    background: #fff;
    border: 1px solid #d5dce3;
    color: #495057;
}

#form_email_config .btn-group .btn-default.active,
#form_email_config .btn-group .btn-default:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* Fix para campos dentro de form-group */
#form_email_config .form-group {
    margin-bottom: 15px;
}

#form_email_config .form-group > div {
    width: 100%;
}

#form_email_config .field-display {
    width: 100%;
}

/* Garantir que todos os campos ocupem 100% */
#form_email_config input[type="text"],
#form_email_config input[type="password"],
#form_email_config input[type="email"],
#form_email_config select {
    width: 100% !important;
}

/* Alertas */
#form_email_config .alert {
    border-radius: 6px;
    padding: 14px 18px;
    margin: 15px 0;
    font-size: 13px;
    line-height: 1.6;
}

#form_email_config .alert-info {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    color: #2c5282;
}

#form_email_config .alert-warning {
    background: #fffbeb;
    border: 1px solid #f6e05e;
    color: #744210;
}

#form_email_config .alert i {
    margin-right: 8px;
}

/* Botões */
#form_email_config .btn {
    height: 44px;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#form_email_config .btn-success {
    background: #28a745;
    color: white;
}

#form_email_config .btn-success:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

#form_email_config .btn-info {
    background: #17a2b8;
    color: white;
}

#form_email_config .btn-info:hover {
    background: #138496;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

#form_email_config .btn-default {
    background: #fff;
    color: #6c757d;
    border: 1px solid #d5dce3;
}

#form_email_config .btn-default:hover {
    background: #f8f9fa;
    border-color: #b0b9c2;
}

/* Lista de configurações */
.bootstrap-table {
    border-radius: 8px;
    overflow: hidden;
}

.bootstrap-table table {
    margin-bottom: 0;
}

.bootstrap-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 15px;
    border-bottom: 2px solid #dee2e6;
}

.bootstrap-table td {
    padding: 15px;
    vertical-align: middle;
    font-size: 14px;
    color: #495057;
}

.bootstrap-table tr:hover {
    background: #f8f9fa;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: #667eea;
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

/* Ações da linha */
.datagrid-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.datagrid-actions a {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.datagrid-actions a:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Estatísticas */
.stats-cell {
    font-size: 11px;
    line-height: 1.6;
}

.stats-cell i {
    width: 16px;
    text-align: center;
}

/* Painel */
.panel-default > .panel-heading {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
    padding: 15px 20px;
}

.panel-default > .panel-heading .panel-title {
    font-size: 18px;
    font-weight: 600;
}

.panel-default {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Botão header do painel */
.panel-heading .btn {
    margin-left: 15px;
}

/* Responsividade */
@media (max-width: 768px) {
    .section-header {
        margin-left: 0;
        margin-right: 0;
        font-size: 14px;
    }
    
    #form_email_config .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .datagrid-actions {
        flex-direction: column;
    }
    
    .datagrid-actions a {
        width: 100%;
        justify-content: center;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-default {
    animation: fadeIn 0.3s ease;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

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

/* Melhorias de acessibilidade */
#form_email_config .form-control:focus,
#form_email_config .btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
    .section-header {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    }
    
    .bootstrap-table th {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .bootstrap-table td {
        color: #cbd5e0;
    }
    
    .bootstrap-table tr:hover {
        background: #4a5568;
    }
}