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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #495057;
}

.container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 900px;
    width: 100%;
    padding: 40px;
    border: 1px solid #e9ecef;
}

h1 {
    color: #343a40;
    text-align: center;
    margin-bottom: 8px;
    font-size: 2.2em;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 35px;
    font-size: 1.05em;
    font-weight: 400;
}

.input-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

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

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

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
    background: #ffffff;
    color: #495057;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #6c757d;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.1);
}

.input-hint {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
    font-weight: 400;
}

button {
    width: 100%;
    padding: 14px;
    background: #495057;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

button:hover {
    background: #343a40;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
}

.results-section {
    display: none;
}

.results-section.show {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.result-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.result-card h3 {
    color: #343a40;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    color: #495057;
}

.result-value {
    color: #212529;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
    font-size: 0.95em;
    word-break: break-all;
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
}

.subnet-list {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.subnet-list h3 {
    color: #343a40;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
}

.subnet-item {
    background: #ffffff;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.subnet-item:hover {
    border-color: #adb5bd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.subnet-header {
    font-weight: 600;
    color: #343a40;
    margin-bottom: 10px;
    font-size: 1.05em;
}

.subnet-detail {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9em;
}

.subnet-detail-label {
    color: #6c757d;
    font-weight: 500;
}

.subnet-detail-value {
    color: #212529;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@media (max-width: 768px) {
    .container {
        padding: 25px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .result-item,
    .subnet-detail {
        flex-direction: column;
        gap: 3px;
    }
    
    .result-value,
    .subnet-detail-value {
        word-break: break-word;
    }
}

/* Comparison Section Styles */
.comparison-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.comparison-section h3 {
    color: #343a40;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    text-align: center;
    font-weight: 600;
}

.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.comparison-column {
    background: #ffffff;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.comparison-column h4 {
    color: #343a40;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.comparison-subnet-item {
    background: #f8f9fa;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #495057;
    border-left: 3px solid #6c757d;
}

.comparison-subnet-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .comparison-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .comparison-section {
        padding: 1rem;
    }
}

/* Navigation Tabs Styles */
.navigation-tabs {
    display: flex;
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
    border: 1px solid #dee2e6;
}

.tab-button {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-button:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-button.active {
    background: #495057;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-icon {
    font-size: 1.1em;
}

.calculator-section {
    display: none;
}

.calculator-section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

@media (max-width: 768px) {
    .navigation-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        justify-content: flex-start;
    }
}

/* Hex Table Section */
.hex-table-section {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.hex-table-section h3 {
    color: #343a40;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.hex-table-section > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
}

.hex-table-section > div > div {
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #dee2e6;
    color: #495057;
    font-weight: 500;
}

.hex-table-section > p {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
    font-style: italic;
}