* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background-color: white;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    padding: 0; /* Remover padding para expandir até as bordas */
}

/* Header */
.header {
    background: linear-gradient(135deg, #2c5530, #4a7c59);
    color: white;
    padding: 20px 10px; /* Reduzir padding lateral */
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    margin: 0 auto;
}

.logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.header-text {
    text-align: center;
    flex: 1;
    margin: 0 20px;
}

.header-text h1 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.header-text p {
    font-size: 14px;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    padding: 40px 10px; /* Reduzir padding lateral para aproximar das bordas */
    min-height: calc(100vh - 200px);
}

.form-section, .resul.form-section {
    max-width: 100%; /* Expandir para a largura total */
    margin: 0; /* Remover centralização */
    background: white;
    padding: 30px 10px; /* Reduzir padding lateral */
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.form-section h2, .results-section h2 {
    color: #2c5530;
    margin-bottom: 20px;
    font-size: 28px;
    text-align: center;
}

.form-section p {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c5530;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #4a7c59;
}

/* Buttons */
.btn-primary, .btn-success, .btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px;
}

.btn-primary {
    background-color: #2c5530;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #1e3a21;
}

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

.btn-success:hover {
    background-color: #218838;
}

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

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c5530;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.message {
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    text-align: center;
    font-weight: 600;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Results Section */
.results-section {
    max-width: 100%; /* Expandir para a largura total */
    margin: 0; /* Remover centralização */
    padding: 0 10px; /* Reduzir padding lateral para aproximar das bordas */
}

.servidor-info {
    background-color: #f8f9fa;
    padding: 20px 10px; /* Reduzir padding lateral */
    border-radius: 5px;
    margin-bottom: 30px;
    width: 100%;   /* ocupa toda largura */
}

.servidor-info h3 {
    color: #2c5530;
    margin-bottom: 15px;
}

.servidor-info p {
    margin-bottom: 8px;
}

/* Table */
.table-container {
    overflow-x: auto;
    margin-bottom: 30px;
    margin-left: 0; /* Remover margem esquerda */
    margin-right: 0; /* Remover margem direita */
}

.vinculos-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.vinculos-table th,
.vinculos-table td {
    padding: 6px 8px; /* Reduz o padding para compactar o texto */
    text-align: left;
    border-bottom: 1px solid #ddd;
    word-wrap: break-word; /* Quebra palavras longas */
    overflow-wrap: break-word; /* Garante que o texto não saia das células */
    font-size: 14px; /* Reduz ligeiramente o tamanho da fonte */
    line-height: 1.4; /* Ajusta o espaçamento entre linhas */
}

.vinculos-table th {
    background-color: #2c5530;
    color: white;
    font-weight: 600;
}

.vinculos-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.vinculos-table tr:hover {
    background-color: #e9ecef;
}

.vinculos-table .total-row {
    background-color: #e9ecef;
    font-weight: bold;
}

/* Actions */
.actions {
    text-align: center;
    margin-top: 30px;
}

/* Footer */
.footer {
    background-color: #2c5530;
    color: white;
    text-align: center;
    padding: 20px 10px; /* Reduzir padding lateral */
    margin-top: auto;
}

.footer p {
    margin-bottom: 5px;
}

.footer a {
    color: #a8d5aa;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-text {
        margin: 20px 0;
    }
    
    .logo {
        width: 50px;
        height: 50px;
    }
    
    .main-content {
        padding: 20px 5px; /* Reduzir ainda mais o padding em dispositivos móveis */
    }
    
.results-section {
    width: 100%;
    max-width: 100%;  /* deixa expandir até o limite da tela */
    margin: 0;        /* remove centralização */
    padding: 0 5px;   /* reduzir padding em dispositivos móveis */
}
    
    .header-text h1 {
        font-size: 20px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .actions button {
        width: 100%;
        margin: 5px 0;
    }
    
    /* Ajustes específicos para tabela em dispositivos móveis */
    .table-container {
        margin: 0 0 30px 0; /* Remover todas as margens laterais em telas pequenas */
        padding: 0; /* Remover padding interno */
    }
    
    .vinculos-table th,
    .vinculos-table td {
        padding: 4px 6px; /* Reduz ainda mais o padding em telas pequenas */
        font-size: 12px; /* Fonte menor para dispositivos móveis */
    }
    
    .servidor-info {
        padding: 15px 5px; /* Reduzir padding em dispositivos móveis */
    }
}


/* Popup Modal Styles */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: popup-appear 0.3s ease-out;
}

.popup-content h3 {
    color: #28a745;
    margin-bottom: 15px;
    font-size: 20px;
}

.popup-content p {
    color: #333;
    font-size: 16px;
    margin-bottom: 0;
}

.popup-content #contador {
    font-weight: bold;
    color: #2c5530;
}

@keyframes popup-appear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive para popup */
@media (max-width: 768px) {
    .popup-content {
        padding: 20px;
        margin: 20px;
    }
    
    .popup-content h3 {
        font-size: 18px;
    }
    
    .popup-content p {
        font-size: 14px;
    }
}

