/* ═══════════════════════════════════════
   Vyner.kr — Admin & Landing Styles
   ═══════════════════════════════════════ */

:root {
    --c-primary: #0070f3;
    --c-accent: #00d4aa;
    --c-dark: #0a0e1a;
    --c-dark2: #111827;
    --c-surface: #151b2e;
    --c-surface2: #1e2642;
    --c-border: rgba(255,255,255,0.08);
    --c-text: #f1f5f9;
    --c-muted: #94a3b8;
    --c-dim: #64748b;
    --c-danger: #ef4444;
    --c-success: #22c55e;
    --c-warn: #f59e0b;
    --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--c-dark);
    color: var(--c-text);
    min-height: 100vh;
}
a { color: var(--c-primary); text-decoration: none; }

/* ── Topbar ── */
.topbar {
    background: var(--c-dark2);
    border-bottom: 1px solid var(--c-border);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar h1 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.topbar h1 i { color: var(--c-primary); }
.topbar-links {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
}
.topbar-links a {
    color: var(--c-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.topbar-links a:hover,
.topbar-links a.active { color: var(--c-primary); }

/* ── Page layout ── */
.page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ── Login ── */
.login-box {
    max-width: 380px;
    margin: 6rem auto;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
}
.login-icon {
    width: 56px; height: 56px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    color: #fff;
}
.login-box h2 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.login-box p { font-size: 0.85rem; color: var(--c-muted); margin-bottom: 1.5rem; }
.login-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 0.82rem;
    margin-bottom: 1rem;
}
.login-box input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: var(--c-dark);
    color: var(--c-text);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    outline: none;
    font-family: inherit;
}
.login-box input:focus { border-color: var(--c-primary); }
.login-box button {
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 8px;
    background: var(--c-primary);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.login-box button:hover { background: #005ed1; }

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.page-header h2 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    font-family: inherit;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: #005ed1; }
.btn-outline { background: transparent; border: 1px solid var(--c-border); color: var(--c-muted); }
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-success { background: var(--c-success); color: #fff; }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; }

/* ── Card / Table ── */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.65rem 0.8rem; text-align: left; font-size: 0.85rem; }
th {
    background: var(--c-surface2);
    color: var(--c-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
td { border-top: 1px solid var(--c-border); }
tr:hover td { background: rgba(255,255,255,0.02); }

.link-icon-preview {
    width: 28px; height: 28px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.06);
}
.link-thumb-preview { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}
.badge-button { background: rgba(0,112,243,0.15); color: #5ba3f5; }
.badge-social { background: rgba(0,212,170,0.15); color: #00d4aa; }
.badge-active { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-inactive { background: rgba(239,68,68,0.15); color: #ef4444; }

.url-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--c-dim);
    font-size: 0.8rem;
}

.toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.15s;
}
.toggle-btn.active { color: var(--c-success); }
.toggle-btn.inactive { color: var(--c-dim); opacity: 0.5; }

.action-btns { display: flex; gap: 0.3rem; }
.order-btns { display: flex; flex-direction: column; gap: 2px; }
.order-btn {
    background: none;
    border: none;
    color: var(--c-dim);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.15s;
}
.order-btn:hover { color: var(--c-primary); }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--c-muted);
}
.empty-state i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
    color: var(--c-dim);
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--c-border);
}
.modal-header h3 { font-size: 1rem; }
.modal-close {
    background: none;
    border: none;
    color: var(--c-muted);
    cursor: pointer;
    font-size: 1.1rem;
}
.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--c-border);
}

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label { font-size: 0.8rem; color: var(--c-muted); font-weight: 600; }
.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: var(--c-dark);
    color: var(--c-text);
    font-size: 0.88rem;
    outline: none;
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--c-primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
.icon-hint { font-size: 0.75rem; color: var(--c-dim); margin-top: 0.2rem; }
.icon-shortcuts { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.3rem; }
.icon-shortcut {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: var(--c-surface2);
    border: 1px solid var(--c-border);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--c-muted);
}
.icon-shortcut:hover { border-color: var(--c-primary); color: var(--c-text); }
.color-preview { display: flex; align-items: center; gap: 0.5rem; }
.color-preview input[type="color"] {
    width: 36px; height: 32px;
    padding: 0; border: none;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}
.color-preview input[type="text"] { flex: 1; }

/* ── Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}
.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--c-primary);
}
.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--c-muted);
    margin-top: 0.3rem;
}

/* 기간 선택 바 */
.stats-range-bar {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}
.stats-range-bar button {
    padding: 0.35rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--c-border);
    background: transparent;
    color: var(--c-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.stats-range-bar button:hover { border-color: var(--c-primary); color: var(--c-primary); }
.stats-range-bar button.active {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}

/* 일별 바 차트 */
.stats-chart {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.stats-chart h4 {
    font-size: 0.85rem;
    color: var(--c-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.chart-legend {
    display: flex;
    gap: 1rem;
    margin-left: auto;
    font-size: 0.72rem;
}
.chart-legend span { display: flex; align-items: center; gap: 0.3rem; }
.chart-legend span::before {
    content: '';
    width: 10px; height: 10px;
    border-radius: 2px;
    display: inline-block;
}
.chart-legend .leg-views::before { background: var(--c-primary); }
.chart-legend .leg-clicks::before { background: var(--c-accent); }
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 120px;
    padding-bottom: 20px;
    position: relative;
}
.chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}
.chart-bar-stack {
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    min-width: 4px;
}
.chart-bar {
    width: 80%;
    min-width: 4px;
    max-width: 28px;
    border-radius: 3px 3px 0 0;
    transition: height 0.3s;
}
.chart-bar.views { background: var(--c-primary); }
.chart-bar.clicks { background: var(--c-accent); border-radius: 0; }
.chart-date {
    position: absolute;
    bottom: -18px;
    font-size: 0.6rem;
    color: var(--c-dim);
    white-space: nowrap;
}

/* 분석 2열 그리드 */
.stats-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* 수평 막대 분석 (기기, 브라우저, 유입경로) */
.stats-breakdown {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.stats-breakdown h4 {
    font-size: 0.85rem;
    color: var(--c-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.breakdown-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.82rem;
}
.breakdown-row .br-label {
    width: 80px;
    flex-shrink: 0;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.breakdown-row .br-track {
    flex: 1;
    height: 6px;
    background: var(--c-surface2);
    border-radius: 3px;
    overflow: hidden;
}
.breakdown-row .br-bar {
    height: 100%;
    border-radius: 3px;
    background: var(--c-primary);
    transition: width 0.4s;
}
.breakdown-row .br-count {
    width: 40px;
    text-align: right;
    font-weight: 700;
    color: var(--c-primary);
    font-size: 0.8rem;
}

/* 인기 링크 / UTM 테이블 */
.stats-table {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.stats-table h4 {
    font-size: 0.85rem;
    color: var(--c-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.stats-table table { width: 100%; border-collapse: collapse; }
.stats-table th {
    padding: 0.4rem 0.6rem;
    font-size: 0.72rem;
    color: var(--c-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--c-border);
    text-align: left;
    font-weight: 600;
    background: transparent;
}
.stats-table td {
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
    border-top: 1px solid var(--c-border);
}
.stats-table td:last-child {
    font-weight: 700;
    color: var(--c-primary);
    text-align: right;
}
.stats-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--c-dim);
    font-size: 0.85rem;
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.success { background: var(--c-success); color: #fff; }
.toast.error { background: var(--c-danger); color: #fff; }

/* ── Landing page ── */
.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    padding: 2rem;
    width: 100%;
    max-width: 800px;
}
.hero-logo {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}
.hero-section p {
    font-size: 1rem;
    color: var(--c-muted);
    max-width: 500px;
    line-height: 1.6;
    margin-bottom: 2rem;
}
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    border-radius: 12px;
    background: var(--c-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}
.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}
.hero-cta:hover {
    background: #005ed1;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,112,243,0.3);
}
.hero-cta-outline {
    background: transparent;
    border: 2px solid var(--c-primary);
    color: var(--c-primary);
    cursor: pointer;
}
.hero-cta-outline:hover {
    background: var(--c-primary);
    color: #fff;
}

/* 도입문의 모달 */
.inquiry-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.inquiry-modal.active { display: flex; }
.inquiry-modal-content {
    background: #1a1f2e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 460px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.inquiry-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--c-muted);
    line-height: 1;
}
.inquiry-modal-content h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.inquiry-modal-content > p {
    color: var(--c-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
#inquiryForm input,
#inquiryForm textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    background: var(--c-bg);
    color: var(--c-text);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    font-family: inherit;
    box-sizing: border-box;
}
#inquiryForm input:focus,
#inquiryForm textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(0,112,243,0.15);
}
.inquiry-submit {
    width: 100%;
    justify-content: center;
    border: none;
    cursor: pointer;
    margin-top: 0.5rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 3rem 2rem;
    max-width: 900px;
    width: 100%;
}
.feature-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.2s;
}
.feature-card:hover { border-color: rgba(0,112,243,0.3); }
.feature-card i {
    font-size: 1.8rem;
    color: var(--c-primary);
    margin-bottom: 0.75rem;
}
.feature-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}
.feature-card p {
    font-size: 0.82rem;
    color: var(--c-muted);
    line-height: 1.5;
}

.landing-footer {
    text-align: center;
    padding: 3rem 1rem;
    font-size: 0.78rem;
    color: var(--c-dim);
    width: 100%;
    border-top: 1px solid var(--c-border);
}
.landing-footer a { color: var(--c-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .topbar { padding: 0.75rem 1rem; flex-direction: column; gap: 0.5rem; }
    .page { padding: 1rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .url-cell { max-width: 120px; }
    .hero-logo { font-size: 2.2rem; }
    .hero-section h2 { font-size: 1.2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-panels { grid-template-columns: 1fr; }
    .stat-card { padding: 0.9rem; }
    .stat-card .stat-value { font-size: 1.4rem; }
    .chart-bars { height: 90px; }
}
