/* ========================================
   IP/서브넷 계산기 페이지 전용 스타일
   탭 공통 스타일(tab-nav 등)은 components.css 참고
   ======================================== */

/* 이진수 표기 */
.binary-display {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-top: 0.35rem;
    word-break: break-all;
}

/* VLSM / 범위 입력 등 동적 행 */
.dynamic-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.dynamic-row input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.dynamic-row-remove {
    background: transparent;
    border: 2px solid #e53e3e;
    color: #e53e3e;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    min-width: 44px;
    min-height: 44px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.dynamic-row-remove:hover {
    background: #e53e3e;
    color: white;
}

.add-row-btn {
    background: transparent;
    border: 2px dashed var(--border-color);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 0.7rem 1.25rem;
    width: 100%;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.add-row-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 서브넷 결과 테이블 (분할/VLSM 공용) */
.subnet-table-wrap {
    overflow-x: auto;
    margin-top: 1.5rem;
}

.subnet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.subnet-table th,
.subnet-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.subnet-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.82rem;
}

.subnet-table td {
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.subnet-table tbody tr:hover {
    background: var(--bg-secondary);
}

/* 모바일: 테이블 -> 카드 리스트 전환 */
@media (max-width: 768px) {
    .subnet-table thead { display: none; }
    .subnet-table, .subnet-table tbody, .subnet-table tr, .subnet-table td {
        display: block;
        width: 100%;
    }
    .subnet-table tr {
        border: 1px solid var(--border-color);
        border-radius: 12px;
        margin-bottom: 0.75rem;
        padding: 0.5rem 0;
        background: var(--bg-primary);
    }
    .subnet-table td {
        border-bottom: none;
        white-space: normal;
        padding: 0.4rem 1rem;
        display: flex;
        justify-content: space-between;
        gap: 0.75rem;
    }
    .subnet-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-family: inherit;
        flex-shrink: 0;
    }

    .dynamic-row {
        grid-template-columns: 1fr;
    }
    .dynamic-row-remove {
        width: 100%;
    }
}

/* 동일 서브넷 판별 결과 배지 */
.subnet-match-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 1rem;
}
.subnet-match-badge.match {
    background: #c6f6d5;
    color: #22543d;
}
.subnet-match-badge.mismatch {
    background: #fed7d7;
    color: #742a2a;
}

/* VLSM/분할 요약 정보 */
.subnet-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    font-size: 0.9rem;
}
.subnet-summary strong {
    color: var(--primary-color);
}
