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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.form-container {
    padding: 30px;
    background: #f8f9fa;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 1em;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85em;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

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

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

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

.loading {
    text-align: center;
    padding: 50px;
}

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

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

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    margin: 20px 30px;
    border-radius: 8px;
    border-left: 4px solid #f5c6cb;
}

.results {
    padding: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.results-header h2 {
    color: #333;
    font-size: 1.8em;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1em;
    opacity: 0.9;
}

.protocols {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.protocol-item {
    display: inline-block;
    margin: 5px 10px 5px 0;
    padding: 8px 15px;
    background: white;
    border-radius: 20px;
    border: 2px solid #667eea;
    color: #667eea;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:nth-child(even) {
    background: #fafafa;
}

.unique-ips {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
}

.unique-ips h3 {
    margin-bottom: 20px;
    color: #333;
}

.ip-list {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
    line-height: 1.8;
}

.ip-item {
    padding: 5px 10px;
    margin: 5px 0;
    background: #e9ecef;
    border-radius: 4px;
    display: inline-block;
    margin-right: 10px;
}

footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    header h1 {
        font-size: 1.8em;
    }
}




/* Melhorias visuais */
.form-group input:focus,
.form-group select:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
}

/* Animação de entrada */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-container {
    animation: slideIn 0.5s ease-out;
}

/* Tooltip para informações */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Badge de status */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

/* Responsivo aprimorado */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    header a {
        position: static !important;
        display: block;
        margin-top: 15px;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Indicador de carregamento melhorado */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Destaque ao copiar */
.copied-highlight {
    animation: highlight 0.5s ease-out;
}

@keyframes highlight {
    0% {
        background: #fff3cd;
    }
    100% {
        background: transparent;
    }
}




/* Modo Escuro */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .container {
    background: #0f3460;
    color: #e0e0e0;
}

body.dark-mode header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .form-container {
    background: #16213e;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #0f3460;
    color: #e0e0e0;
    border-color: #2a2a4e;
}

body.dark-mode .results-container {
    background: #16213e;
}

body.dark-mode .stat-card {
    background: #0f3460;
    border-color: #2a2a4e;
}

body.dark-mode table {
    background: #0f3460;
}

body.dark-mode th {
    background: #1a1a2e;
}

body.dark-mode tr:hover {
    background: #1a1a2e;
}

body.dark-mode .ip-item {
    background: #1a1a2e;
    color: #e0e0e0;
}

/* Botões do cabeçalho */
.header-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Busca nos resultados */
.search-container {
    position: relative;
    margin: 20px 0;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

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

.btn-clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-clear-search:hover {
    background: #c0392b;
}

/* Ações dos resultados */
.results-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s;
}

.modal-large {
    max-width: 900px;
}

body.dark-mode .modal-content {
    background: #16213e;
    color: #e0e0e0;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark-mode .modal-header {
    border-bottom-color: #2a2a4e;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.modal-close {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #c0392b;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Favoritos */
.favorite-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

body.dark-mode .favorite-item {
    background: #0f3460;
}

.favorite-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.favorite-info {
    flex: 1;
}

.favorite-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.favorite-details {
    font-size: 13px;
    color: #666;
}

body.dark-mode .favorite-details {
    color: #999;
}

.favorite-actions {
    display: flex;
    gap: 10px;
}

.btn-favorite {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-load {
    background: #667eea;
    color: white;
}

.btn-load:hover {
    background: #5568d3;
}

.btn-delete-fav {
    background: #e74c3c;
    color: white;
}

.btn-delete-fav:hover {
    background: #c0392b;
}

/* Marcação de IPs */
.ip-marked {
    position: relative;
    padding-left: 25px;
}

.ip-marked::before {
    content: '📌';
    position: absolute;
    left: 5px;
}

.ip-marked-suspicious {
    background: #fee !important;
}

.ip-marked-trusted {
    background: #efe !important;
}

/* Highlight de busca */
.search-highlight {
    background: yellow;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 3px;
}

body.dark-mode .search-highlight {
    background: #ffd700;
    color: #000;
}

/* Responsivo para modais */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .results-actions button {
        width: 100%;
    }
}

