/* servidorLocal.css v1.0 - ESTILOS SIMPLIFICADOS DO MÓDULO SERVIDOR LOCAL */

/* ============================================
   CONTAINER PRINCIPAL
   ============================================ */

.servidor-local-container {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   PAINEL DE STATUS PRINCIPAL
   ============================================ */

.status-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.status-icon-wrapper {
    margin-right: 1.5rem;
}

.status-icon {
    font-size: 3.5rem;
    color: #6c757d;
    transition: all 0.3s ease;
}

.status-icon.status-connected {
    color: #28a745;
    animation: pulse 2s ease-in-out infinite;
}

.status-icon.status-disconnected {
    color: #ffc107;
}

.status-icon.status-error {
    color: #dc3545;
}

.status-icon.status-unknown {
    color: #6c757d;
}

.status-info {
    flex: 1;
}

.status-info h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: #333;
}

.status-info p {
    margin: 0.25rem 0 0 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.status-actions {
    display: flex;
    gap: 0.5rem;
}

/* Métricas */
.status-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
}

.metric-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-3px);
    border-color: #667eea;
}

.metric-icon {
    font-size: 2.5rem;
    margin-right: 1.25rem;
    color: #667eea;
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
}

/* Detalhes de Conexão */
.connection-details {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid #dee2e6;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #dee2e6;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-value {
    font-weight: 600;
    color: #333;
}

/* ============================================
   SEÇÕES GERAIS
   ============================================ */

.config-section,
.discovery-section,
.sync-section,
.help-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
}

/* ============================================
   CONFIGURAÇÕES
   ============================================ */

.config-content {
    padding: 0.5rem 0;
}

.config-item {
    margin-bottom: 1.5rem;
}

.config-item:last-child {
    margin-bottom: 0;
}

.config-toggle-main {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    color: white;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toggle-label {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex-shrink: 0;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.3);
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-input:checked + .toggle-slider {
    background-color: rgba(40, 167, 69, 0.9);
}

.toggle-input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-info {
    flex: 1;
}

.toggle-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.toggle-description {
    font-size: 0.9rem;
    opacity: 0.9;
}

.advanced-options {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 1rem;
    border: 1px solid #dee2e6;
}

.config-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.config-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================
   DESCOBERTA DE SERVIDOR
   ============================================ */

.discovery-content {
    padding: 0.5rem 0;
}

.discovery-auto,
.discovery-manual {
    margin-bottom: 2rem;
}

.discovery-auto:last-child,
.discovery-manual:last-child {
    margin-bottom: 0;
}

.discovery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.discovery-label {
    font-weight: 600;
    font-size: 1.05rem;
    color: #333;
}

.discovery-help {
    margin-top: 1rem;
}

.manual-form {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
}

.form-group-ip {
    flex: 2;
}

.form-group-port {
    flex: 1;
    max-width: 100px;
}

.form-group-path {
    flex: 1;
    max-width: 120px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #495057;
}

.form-group input {
    width: 100%;
}

.form-group input.is-valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ============================================
   SINCRONIZAÇÃO
   ============================================ */

.sync-content {
    padding: 0.5rem 0;
}

.sync-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.25rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.sync-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.sync-progress {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.sync-progress .progress {
    height: 25px;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.sync-progress-text {
    text-align: center;
    margin: 0;
    font-weight: 500;
    color: #6c757d;
}

/* ============================================
   AJUDA
   ============================================ */

.help-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.help-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.help-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-3px);
    border-color: #667eea;
}

.help-icon {
    font-size: 2.5rem;
    color: #667eea;
}

.help-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.help-info p {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: #6c757d;
}

/* ============================================
   ALERTS CUSTOMIZADOS
   ============================================ */

.alert-servidor-local {
    border-radius: 10px;
    border-left: 4px solid;
    padding: 1rem 1.5rem;
}

.alert-servidor-local.alert-info {
    border-left-color: #17a2b8;
    background-color: #d1ecf1;
}

.alert-servidor-local i {
    margin-right: 0.5rem;
}

/* ============================================
   ANIMAÇÕES
   ============================================ */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .servidor-local-container {
        padding: 0.5rem;
    }
    
    .status-header {
        flex-direction: column;
        text-align: center;
    }
    
    .status-icon-wrapper {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .status-metrics {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group-ip,
    .form-group-port,
    .form-group-path {
        max-width: none;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .help-content {
        grid-template-columns: 1fr;
    }
    
    .help-card {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-soft {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.transition-all {
    transition: all 0.3s ease;
}