/* nhash.css */
:root {
    --nh-bg:      #0a0a0f;
    --nh-surface: #12121a;
    --nh-border:  #2a2a3d;
    --nh-accent:  #a855f7;
    --nh-accent2: #7c3aed;
    --nh-glow:    #a855f744;
    --nh-text:    #e2e0ff;
    --nh-muted:   #6b6b8a;
    --nh-error:   #f87171;
    --nh-success: #4ade80;
    --nh-md5:     #f59e0b;
    --nh-sha1:    #06b6d4;
    --nh-sha256:  #a855f7;
    --nh-sha512:  #ec4899;
}

.nh-hero {
    background: var(--nh-bg);
    min-height: 100vh;
    padding: 2rem 0 4rem;
    font-family: 'Space Mono', 'Courier New', monospace;
}

/* 배경 그리드 효과 */
.nh-hero::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--nh-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--nh-border) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.nh-hero .container { position: relative; z-index: 1; }

/* 헤더 */
.nh-header { text-align: center; margin-bottom: 2.5rem; }

.nh-badge {
    display: inline-block;
    background: linear-gradient(135deg, #a855f722, #7c3aed22);
    border: 1px solid var(--nh-accent);
    color: var(--nh-accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    padding: 0.25rem 0.8rem;
    border-radius: 2px;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.nh-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--nh-text);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 40px var(--nh-glow);
}

.nh-title span { color: var(--nh-accent); }

.nh-subtitle {
    color: var(--nh-muted);
    font-size: 0.85rem;
    font-family: -apple-system, sans-serif;
}

/* 알고리즘 선택 */
.nh-algo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.nh-algo-btn {
    padding: 0.7rem 0.5rem;
    border: 1px solid var(--nh-border);
    background: var(--nh-surface);
    color: var(--nh-muted);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: center;
    transition: all 0.15s;
}

.nh-algo-btn:hover { color: var(--nh-text); border-color: var(--nh-accent); }

.nh-algo-btn.active[data-algo="MD5"]    { border-color: var(--nh-md5);    color: var(--nh-md5);    background: #f59e0b12; box-shadow: 0 0 12px #f59e0b22; }
.nh-algo-btn.active[data-algo="SHA1"]   { border-color: var(--nh-sha1);   color: var(--nh-sha1);   background: #06b6d412; box-shadow: 0 0 12px #06b6d422; }
.nh-algo-btn.active[data-algo="SHA256"] { border-color: var(--nh-sha256); color: var(--nh-sha256); background: #a855f712; box-shadow: 0 0 12px #a855f722; }
.nh-algo-btn.active[data-algo="SHA512"] { border-color: var(--nh-sha512); color: var(--nh-sha512); background: #ec489912; box-shadow: 0 0 12px #ec489922; }

.nh-algo-sub {
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.6;
    display: block;
    margin-top: 2px;
}

/* 탭 */
.nh-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: 6px;
    padding: 4px;
}

.nh-tab {
    flex: 1;
    padding: 0.55rem 1rem;
    border: none;
    background: transparent;
    color: var(--nh-muted);
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
    letter-spacing: 0.05em;
}

.nh-tab.active { background: var(--nh-accent); color: #fff; }
.nh-tab:hover:not(.active) { color: var(--nh-text); background: #ffffff08; }

/* 패널 */
.nh-panel {
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.nh-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--nh-border);
    background: #ffffff04;
}

.nh-panel-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--nh-muted);
}

.nh-panel-actions { display: flex; gap: 0.5rem; }

.nh-btn-sm {
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    border: 1px solid var(--nh-border);
    background: transparent;
    color: var(--nh-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.nh-btn-sm:hover { border-color: var(--nh-accent); color: var(--nh-accent); }
.nh-btn-del:hover { border-color: var(--nh-error) !important; color: var(--nh-error) !important; }

.nh-textarea {
    width: 100%;
    min-height: 140px;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--nh-text);
    font-family: 'Space Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.nh-textarea::placeholder { color: var(--nh-muted); opacity: 0.5; }

/* 해시 결과 */
.nh-result-wrap {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nh-result-hash {
    flex: 1;
    font-family: 'Space Mono', monospace;
    font-size: 0.82rem;
    color: var(--nh-accent);
    word-break: break-all;
    line-height: 1.5;
    min-height: 1.5rem;
    text-shadow: 0 0 12px var(--nh-glow);
    letter-spacing: 0.03em;
}

.nh-result-hash.empty { color: var(--nh-muted); opacity: 0.4; font-style: italic; }

/* 해시 버튼 */
.nh-btn-hash {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--nh-accent2), var(--nh-accent));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.08em;
    transition: all 0.15s;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px var(--nh-glow);
}

.nh-btn-hash:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 24px var(--nh-glow); }
.nh-btn-hash:active { transform: translateY(0); }

/* 모두 해시 */
.nh-all-results {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.nh-all-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: 6px;
}

.nh-all-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    min-width: 56px;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-align: center;
}

.nh-all-label.MD5    { background: #f59e0b22; color: var(--nh-md5); border: 1px solid #f59e0b44; }
.nh-all-label.SHA1   { background: #06b6d422; color: var(--nh-sha1); border: 1px solid #06b6d444; }
.nh-all-label.SHA256 { background: #a855f722; color: var(--nh-sha256); border: 1px solid #a855f744; }
.nh-all-label.SHA512 { background: #ec489922; color: var(--nh-sha512); border: 1px solid #ec489944; }

.nh-all-value {
    flex: 1;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--nh-text);
    word-break: break-all;
    opacity: 0.85;
}

/* 비교 패널 */
.nh-compare-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.nh-compare-result {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    text-align: center;
    display: none;
}

.nh-compare-result.match    { background: #4ade8022; color: var(--nh-success); border: 1px solid #4ade8044; display: block; }
.nh-compare-result.mismatch { background: #f8717122; color: var(--nh-error);   border: 1px solid #f8717144; display: block; }

/* 파일 드롭존 */
.nh-dropzone {
    border: 2px dashed var(--nh-border);
    border-radius: 8px;
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--nh-surface);
    margin-bottom: 1rem;
}

.nh-dropzone:hover, .nh-dropzone.drag-over {
    border-color: var(--nh-accent);
    background: #a855f708;
    box-shadow: 0 0 20px var(--nh-glow);
}

.nh-dropzone-icon { font-size: 2.2rem; margin-bottom: 0.5rem; }
.nh-dropzone-text { color: var(--nh-muted); font-size: 0.85rem; font-family: -apple-system, sans-serif; }
.nh-dropzone-text strong { color: var(--nh-accent); }

/* 상태 */
.nh-status { font-size: 0.78rem; padding: 0.5rem 1rem; border-radius: 4px; display: none; font-family: -apple-system, sans-serif; margin-top: 0.5rem; }
.nh-status.show  { display: block; }
.nh-status.error { background: #f8717122; color: var(--nh-error); border: 1px solid #f8717144; }
.nh-status.info  { background: #a855f712; color: var(--nh-accent); border: 1px solid #a855f744; }

/* 기록 패널 */
.nh-history-section { margin-top: 2.5rem; }

.nh-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.nh-history-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--nh-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nh-plan-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nh-plan-badge.free    { background: #ffffff12; color: var(--nh-muted); border: 1px solid var(--nh-border); }
.nh-plan-badge.premium { background: linear-gradient(135deg,#f59e0b,#ef4444); color:#fff; }

.nh-hist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: border-color 0.15s;
    gap: 1rem;
}

.nh-hist-item:hover { border-color: var(--nh-accent); }

.nh-hist-meta { display: flex; align-items: center; gap: 0.75rem; overflow: hidden; flex: 1; }

.nh-hist-algo {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    flex-shrink: 0;
}

.nh-hist-algo.MD5    { background: #f59e0b22; color: var(--nh-md5); }
.nh-hist-algo.SHA1   { background: #06b6d422; color: var(--nh-sha1); }
.nh-hist-algo.SHA256 { background: #a855f722; color: var(--nh-sha256); }
.nh-hist-algo.SHA512 { background: #ec489922; color: var(--nh-sha512); }

.nh-hist-label { font-size: 0.82rem; color: var(--nh-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: -apple-system, sans-serif; }
.nh-hist-hash  { font-size: 0.7rem; color: var(--nh-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; font-family: 'Space Mono', monospace; }
.nh-hist-time  { font-size: 0.7rem; color: var(--nh-muted); flex-shrink: 0; font-family: -apple-system, sans-serif; }
.nh-hist-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

.nh-history-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--nh-muted);
    font-size: 0.82rem;
    background: var(--nh-surface);
    border: 1px dashed var(--nh-border);
    border-radius: 6px;
    font-family: -apple-system, sans-serif;
}

/* 비로그인 안내 */
.nh-login-nudge {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: 8px;
    margin-top: 2rem;
}

.nh-login-nudge-text { flex: 1; font-size: 0.82rem; color: var(--nh-muted); line-height: 1.5; font-family: -apple-system, sans-serif; }
.nh-login-nudge-text strong { color: var(--nh-text); display: block; margin-bottom: 0.2rem; }

.nh-btn-login {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--nh-accent);
    color: var(--nh-accent);
    border-radius: 5px;
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.15s;
}

.nh-btn-login:hover { background: var(--nh-accent); color: #fff; }

/* 프리미엄 배너 */
.nh-premium-nudge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f59e0b12, #ef444412);
    border: 1px solid #f59e0b44;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    font-family: -apple-system, sans-serif;
    color: var(--nh-text);
}

.nh-premium-nudge a { color: #f59e0b; font-weight: 700; text-decoration: none; margin-left: auto; white-space: nowrap; font-size: 0.75rem; }

/* 토스트 */
.nh-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--nh-accent);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: 'Space Mono', monospace;
    transform: translateY(4rem);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    z-index: 9999;
    pointer-events: none;
}

.nh-toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 576px) {
    .nh-title { font-size: 1.7rem; }
    .nh-algo-grid { grid-template-columns: repeat(2, 1fr); }
    .nh-hist-hash, .nh-hist-time { display: none; }
    .nh-hist-item { flex-direction: column; align-items: flex-start; }
    .nh-hist-actions { width: 100%; justify-content: flex-end; }
}
