@import url('/styles/shared.css');

/* Form */
.subnet-form {
    margin-top: 1rem;
}

.subnet-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    align-items: end;
}

.subnet-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1f2937;
}

.subnet-form input,
.subnet-form select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

.subnet-form input:focus,
.subnet-form select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.9rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 12px 32px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    margin-left: 0.75rem;
    background: #6b7280;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 24px rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(75, 85, 99, 0.35);
}

/* Results */
.result-table {
    margin-top: 2.25rem;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
    padding: 2rem;
}

.result-table h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.45rem;
    color: #0f172a;
}

.error-message {
    margin-top: 1.5rem;
}

/* Tables */
.modern-results-table th {
    width: 32%;
    color: #0f172a;
}

.modern-results-table td {
    color: #1f2937;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Description Section */
.description-section {
    margin-top: 3rem;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.09);
    padding: 2.75rem;
}

.description-header {
    color: #0f172a;
    font-size: 1.7rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0f2fe;
}

.description-content {
    display: flex;
    flex-direction: column;
    gap: 2.75rem;
}

.description-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 2rem;
}

.description-column h3 {
    color: #1d4ed8;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.description-column p,
.description-column li {
    color: #475569;
    line-height: 1.7;
}

.description-column ul {
    margin: 0;
    padding-left: 1.3rem;
}

/* Examples */
.examples-section h3 {
    color: #0f172a;
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.5rem;
}

.example-card {
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #bae6fd;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
    box-shadow: 0 18px 40px rgba(59, 130, 246, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.example-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 46px rgba(37, 99, 235, 0.22);
}

.example-card h4 {
    margin: 0 0 0.75rem 0;
    color: #1d4ed8;
}

.example-card code {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 8px;
    color: #0f172a;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
}

/* Comparison */
.comparison-section h3 {
    color: #0f172a;
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
}

.comparison-table {
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.06);
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.comparison-table th,
.comparison-table td {
    padding: 0.95rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.comparison-table thead tr {
    background: linear-gradient(135deg, #1d4ed8 0%, #0ea5e9 100%);
    color: #ffffff;
    letter-spacing: 0.3px;
}

.comparison-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

/* Practical Usage */
.practical-usage h3 {
    color: #0f172a;
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
}

.usage-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.75rem;
}

.usage-card {
    padding: 1.75rem;
    border-radius: 16px;
    border: 1px solid #c4b5fd;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, rgba(165, 180, 252, 0.18) 100%);
    box-shadow: 0 20px 48px rgba(79, 70, 229, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.usage-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 54px rgba(67, 56, 202, 0.25);
}

.usage-card h4 {
    margin: 0 0 0.75rem 0;
    color: #3730a3;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.usage-card p,
.usage-card li {
    color: #4338ca;
    line-height: 1.6;
}

.usage-card ul {
    margin: 0.75rem 0 0;
    padding-left: 1.3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .subnet-form .form-grid {
        grid-template-columns: 1fr;
    }

    .btn-secondary {
        margin-left: 0;
        margin-top: 0.75rem;
        width: 100%;
    }

    .result-table {
        padding: 1.6rem;
    }

    .modern-results-table {
        width: 100%;
    }

    .modern-results-table th,
    .modern-results-table td {
        display: block;
        width: 100%;
        padding: 0.55rem 0;
    }

    .modern-results-table th {
        font-size: 0.9rem;
        color: #1f2937;
    }

    .modern-results-table td {
        font-size: 1.05rem;
        font-weight: 600;
        color: #0f172a;
        margin-bottom: 0.4rem;
    }

    .modern-results-table tr {
        border-bottom: 1px solid #e5e7eb;
        padding: 0.65rem 0;
    }

    .description-section {
        padding: 2rem;
    }
}

@media (max-width: 576px) {
    .result-table,
    .description-section {
        padding: 1.35rem;
    }

    .result-table h3 {
        font-size: 1.25rem;
    }

    .comparison-table,
    .table-container {
        overflow-x: auto;
    }

    .comparison-table table {
        min-width: 520px;
    }

    .modern-results-table {
        min-width: 0;
    }
}

