/* ===== 도구 공통 스타일 ===== */

/* 도구 입력/결과 영역 */
.tool-textarea {
    width: 100%;
    min-height: 200px;
    font-size: 0.95rem;
    resize: vertical;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.2s;
}
.tool-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.15);
}

/* 통계 카드 그리드 */
.tool-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.tool-stat-card {
    text-align: center;
    padding: 16px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}
.tool-stat-card:hover {
    transform: translateY(-1px);
}
.tool-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}
.tool-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 2단 레이아웃 (Base64, URL 인코더) */
.tool-dual-pane {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: start;
}
@media (max-width: 767px) {
    .tool-dual-pane {
        grid-template-columns: 1fr;
    }
}
.tool-dual-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: center;
}
@media (max-width: 767px) {
    .tool-dual-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* JSON 포맷터 monospace */
.tool-mono-textarea {
    font-family: 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: 0.85rem;
    tab-size: 4;
}

/* 허브 카테고리 카드 */
.tool-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 2rem;
}
.tool-hub-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
    background: var(--bg-card);
    text-decoration: none;
    color: var(--text-primary);
    display: block;
}
.tool-hub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: var(--text-primary);
}
.tool-hub-card .hub-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}
.tool-hub-card .hub-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.tool-hub-card .hub-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.tool-hub-card .hub-count {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}
.tool-hub-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}
.tool-hub-list li {
    padding: 4px 0;
}
.tool-hub-list li a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.tool-hub-list li a:hover {
    color: var(--primary);
}
.tool-hub-list li a i {
    color: var(--primary);
    margin-right: 4px;
    width: 16px;
    display: inline-block;
}

/* 비밀번호 강도 */
.strength-bar {
    height: 6px;
    border-radius: 3px;
    transition: width 0.3s, background-color 0.3s;
}
.strength-weak { background-color: #dc3545; }
.strength-fair { background-color: #fd7e14; }
.strength-good { background-color: #ffc107; }
.strength-strong { background-color: #198754; }

/* 비밀번호 대형 표시 */
.password-display {
    font-family: 'Fira Code', Consolas, monospace;
    font-size: 1.4rem;
    font-weight: 600;
    word-break: break-all;
    padding: 16px;
    border-radius: 8px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
}

/* SNS 한도 프로그레스 */
.sns-limit-bar {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    overflow: hidden;
    margin-top: 4px;
}
.sns-limit-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s, background-color 0.3s;
}
.sns-limit-fill.safe { background-color: #198754; }
.sns-limit-fill.warn { background-color: #ffc107; }
.sns-limit-fill.over { background-color: #dc3545; }

/* 도구 결과 테이블 */
.tool-result-table td {
    font-family: 'Fira Code', Consolas, monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

/* 도구 페이지 내부 링크 */
.related-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 1rem;
}
.related-tools .btn {
    font-size: 0.85rem;
}

/* 토스트 알림 (도구 전용) */
.tool-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

/* QR 미리보기 */
.qr-preview {
    display: inline-block;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* 날짜/나이 결과 */
.date-result-card {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}
.date-result-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
}
.date-result-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 다크모드 지원 */
[data-bs-theme="dark"] .tool-textarea {
    background: #1a1d23;
    color: #e9ecef;
    border-color: #495057;
}
[data-bs-theme="dark"] .tool-stat-card {
    background: #1a1d23;
    border-color: #495057;
}
[data-bs-theme="dark"] .tool-hub-card {
    background: #1a1d23;
    border-color: #495057;
}
[data-bs-theme="dark"] .tool-hub-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
[data-bs-theme="dark"] .password-display {
    background: #1a1d23;
    border-color: #495057;
}
[data-bs-theme="dark"] .qr-preview {
    background: #fff;
}
[data-bs-theme="dark"] .sns-limit-bar {
    background: #343a40;
}
[data-bs-theme="dark"] .date-result-card {
    background: #1a1d23;
    border-color: #495057;
}
