* {
    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: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    animation: slideIn 0.5s ease-out;
}

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

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    color: #555;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.input-section,
.output-section {
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

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

input[type="text"],
input[type="number"],
select {
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 0.95em;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

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

.info {
    font-size: 0.85em;
    color: #888;
    margin-top: 5px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin: 25px 0;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #e0e0e0;
    color: #333;
    flex: 1;
    min-width: 150px;
}

button:hover {
    background-color: #d0d0d0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

button.primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8c 100%);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* CIDR Container */
.cidr-container {
    display: flex;
    gap: 15px;
    align-items: center;
}

#cidr {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 0.95em;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

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

.cidr-info {
    display: flex;
    gap: 15px;
    flex: 1;
    flex-wrap: wrap;
}

.cidr-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.cidr-label {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9em;
}

.cidr-value {
    color: #333;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Results Table Styles */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.results-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    border-bottom: 2px solid #667eea;
}

.results-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    word-break: break-all;
}

.results-table tbody tr {
    transition: all 0.3s ease;
}

.results-table tbody tr:hover {
    background-color: #f8f9fa;
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.results-table strong {
    color: #667eea;
    display: block;
    font-weight: 600;
}

footer {
    text-align: center;
    color: #999;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 30px;
    }

    h2 {
        font-size: 1.2em;
    }

    .button-group {
        flex-direction: column;
    }

    button {
        min-width: unset;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .cidr-container {
        flex-direction: column;
    }
    
    #cidr {
        width: 100%;
    }
    
    .cidr-info {
        width: 100%;
    }
    
    .results-table {
        font-size: 0.8em;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 10px;
    }
}

/* Centered counter */
.centered-counter {
    text-align: center;
    margin: 12px 0 6px 0;
}
.centered-counter img {
    max-width: 220px;
    height: auto;
}

/* Animation for results */
.result-item {
    animation: fadeIn 0.3s ease-out;
}

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