/* ==========================================================================
   PROK Link Hub - Premium Light Theme + Login + Tabs + Modal + Video
   ========================================================================== */
:root {
    --bg-base: #f0f4f8;
    --bg-white: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-violet: 263, 85%, 55%;
    --accent-indigo: 239, 84%, 57%;
    --accent-cyan: 192, 91%, 40%;
    --accent-green: 142, 72%, 42%;
    --accent-red: 350, 89%, 52%;
    --card-bg: rgba(255, 255, 255, 0.88);
    --card-border: rgba(148, 163, 184, 0.2);
    --card-shadow: 0 4px 24px rgba(30, 41, 59, 0.08);
    --font-base: 'Pretendard', -apple-system, system-ui, sans-serif;
    --font-mono: 'Outfit', 'Pretendard', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-base); }
body { background: var(--bg-base); color: var(--text-primary); min-height: 100vh; display: flex; justify-content: center; overflow-x: hidden; line-height: 1.6; }

/* ===== Login Overlay ===== */
.login-overlay { position: fixed; inset: 0; z-index: 9999; background: linear-gradient(135deg, #ede9fe 0%, #e0f2fe 50%, #f0f4f8 100%); display: flex; align-items: center; justify-content: center; }
.login-overlay.hidden { display: none; }
.login-card { background: #fff; border-radius: 24px; padding: 3rem 2.5rem; width: 100%; max-width: 400px; box-shadow: 0 16px 48px rgba(30,41,59,0.12); text-align: center; }
.login-logo { font-size: 3rem; margin-bottom: 0.75rem; }
.login-title { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 800; margin-bottom: 0.25rem; }
.login-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }
.login-form { display: flex; flex-direction: column; gap: 1.25rem; }
.login-input-group { text-align: left; display: flex; flex-direction: column; gap: 0.35rem; }
.login-input-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.login-input-group input { width: 100%; padding: 0.9rem 1rem; border: 1.5px solid rgba(148,163,184,0.3); border-radius: 12px; font-size: 1rem; background: var(--bg-base); transition: border-color 0.2s; }
.login-input-group input:focus { outline: none; border-color: hsl(var(--accent-violet)); box-shadow: 0 0 0 3px rgba(139,92,246,0.1); }
.login-btn { margin-top: 0.5rem; }
.login-error { color: hsl(var(--accent-red)); font-size: 0.85rem; font-weight: 600; margin-top: 0.5rem; }

/* ===== Background ===== */
.background-glow-1 { position: fixed; top: -25%; left: -15%; width: 65vw; height: 65vw; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,0.07) 0%, transparent 70%); filter: blur(100px); z-index: -2; pointer-events: none; }
.background-glow-2 { position: fixed; bottom: -25%; right: -15%; width: 55vw; height: 55vw; border-radius: 50%; background: radial-gradient(circle, rgba(6,182,212,0.05) 0%, transparent 70%); filter: blur(80px); z-index: -2; pointer-events: none; }

/* ===== Layout ===== */
.app-container { width: 100%; max-width: 1024px; padding: 2rem 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; z-index: 1; }

/* ===== Header ===== */
.app-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; }
.logo-area { display: flex; align-items: center; gap: 0.75rem; }
.logo-symbol { font-size: 2rem; filter: drop-shadow(0 2px 8px rgba(139,92,246,0.2)); animation: pulseSymbol 3s infinite ease-in-out; }
.logo-title { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; }
.text-gradient { background: linear-gradient(135deg, hsl(var(--accent-violet)), hsl(var(--accent-indigo))); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo-subtitle { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
.header-right { display: flex; align-items: center; gap: 0.75rem; }
.header-badge { background: rgba(139,92,246,0.08); border: 1px solid rgba(139,92,246,0.2); color: hsl(var(--accent-violet)); font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; padding: 0.3rem 0.65rem; border-radius: 20px; letter-spacing: 0.05em; }

/* ===== Tabs ===== */
.tab-nav { display: flex; gap: 0.5rem; background: rgba(255,255,255,0.7); border-radius: 14px; padding: 0.35rem; border: 1px solid var(--card-border); }
.tab-btn { flex: 1; padding: 0.75rem 1rem; border: none; background: transparent; border-radius: 10px; font-size: 0.95rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all 0.25s; }
.tab-btn.active { background: #fff; color: hsl(var(--accent-violet)); box-shadow: 0 2px 8px rgba(30,41,59,0.08); }
.tab-btn:hover:not(.active) { color: var(--text-primary); }
.tab-content { display: none; flex-direction: column; gap: 1.5rem; }
.tab-content.active { display: flex; }

/* ===== Cards ===== */
.card { border-radius: 20px; padding: 2rem; position: relative; overflow: hidden; transition: box-shadow 0.3s; }
.glass-card { background: var(--card-bg); border: 1px solid var(--card-border); box-shadow: var(--card-shadow); backdrop-filter: blur(20px); }
.card-header { margin-bottom: 1.5rem; }
.card-header.row-layout { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.section-title { font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 0.4rem; }
.section-desc { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.2rem; }
.centered { text-align: center; }

/* ===== Forms ===== */
.form-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.input-group { display: flex; flex-direction: column; gap: 0.4rem; }
.input-group label { font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 0.2rem; }
.required { color: hsl(var(--accent-red)); }
.input-wrapper { position: relative; width: 100%; }
.input-icon { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); font-size: 1rem; opacity: 0.55; pointer-events: none; }
.input-wrapper input { width: 100%; background: var(--bg-base); border: 1.5px solid rgba(148,163,184,0.3); border-radius: 12px; padding: 0.95rem 1rem 0.95rem 3rem; font-size: 0.95rem; color: var(--text-primary); transition: all 0.2s; }
.input-wrapper input:focus { outline: none; border-color: hsl(var(--accent-violet)); box-shadow: 0 0 0 3px rgba(139,92,246,0.1); background: #fff; }
.input-wrapper input::placeholder { color: var(--text-muted); }
.input-help { font-size: 0.75rem; color: var(--text-muted); }

/* ===== Buttons ===== */
.btn { border: none; border-radius: 12px; padding: 0.95rem 1.75rem; font-size: 0.95rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; transition: all 0.25s; }
.btn-primary { background: linear-gradient(135deg, hsl(var(--accent-violet)), hsl(var(--accent-indigo))); color: #fff; box-shadow: 0 4px 14px rgba(139,92,246,0.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(139,92,246,0.35); }
.btn-secondary { background: rgba(148,163,184,0.1); color: var(--text-primary); border: 1px solid rgba(148,163,184,0.2); }
.btn-secondary:hover { background: rgba(148,163,184,0.18); }
.btn-tertiary { background: transparent; color: var(--text-secondary); border: 1px solid rgba(148,163,184,0.2); padding: 0.55rem 1rem; font-size: 0.8rem; border-radius: 10px; }
.btn-tertiary:hover { background: rgba(148,163,184,0.08); color: var(--text-primary); }
.btn-danger { background: rgba(239,68,68,0.08); color: hsl(var(--accent-red)); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.15); }
.btn-restore { background: rgba(34,197,94,0.08); color: hsl(var(--accent-green)); border: 1px solid rgba(34,197,94,0.2); }
.btn-restore:hover { background: rgba(34,197,94,0.15); }
.btn.compact { padding: 0.5rem 0.75rem; font-size: 0.8rem; border-radius: 8px; }
.actions-cell { display: flex; gap: 0.35rem; justify-content: center; }

/* ===== File Drop Zone ===== */
.file-drop-zone { border: 2px dashed rgba(148,163,184,0.35); border-radius: 14px; padding: 2rem; text-align: center; cursor: pointer; transition: all 0.2s; background: rgba(241,245,249,0.5); }
.file-drop-zone:hover, .file-drop-zone.drag-over { border-color: hsl(var(--accent-violet)); background: rgba(139,92,246,0.04); }
.drop-icon { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.drop-text { color: var(--text-secondary); font-size: 0.9rem; }
.drop-link { color: hsl(var(--accent-violet)); font-weight: 600; }
.drop-limit { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.25rem; }
.file-selected { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem; background: rgba(139,92,246,0.05); border-radius: 10px; }
.file-selected.hidden { display: none; }
.file-icon { font-size: 1.25rem; }
.file-name { font-weight: 600; font-size: 0.9rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--text-muted); font-size: 0.8rem; }
.file-clear { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); padding: 0.25rem; }
.drop-content.hidden { display: none; }

/* ===== Upload Progress ===== */
.upload-progress { display: flex; align-items: center; gap: 0.75rem; }
.upload-progress.hidden { display: none; }
.progress-bar-wrapper { flex: 1; height: 8px; background: rgba(148,163,184,0.15); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, hsl(var(--accent-violet)), hsl(var(--accent-indigo))); border-radius: 4px; transition: width 0.3s; width: 0%; }
.progress-text { font-size: 0.8rem; font-weight: 600; color: hsl(var(--accent-violet)); min-width: 36px; text-align: right; }

/* ===== Storage Bar ===== */
.storage-card .card-header { margin-bottom: 0.75rem; }
.storage-text { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600; color: hsl(var(--accent-violet)); }
.storage-bar-wrapper { margin-bottom: 0.5rem; }
.storage-bar { height: 10px; background: rgba(148,163,184,0.12); border-radius: 5px; overflow: hidden; }
.storage-bar-fill { height: 100%; background: linear-gradient(90deg, hsl(var(--accent-violet)), hsl(var(--accent-cyan))); border-radius: 5px; transition: width 0.5s; }
.storage-bar-fill.warning { background: linear-gradient(90deg, hsl(var(--accent-red)), #f97316); }
.storage-help { font-size: 0.75rem; color: var(--text-muted); }

/* ===== Modal Popup ===== */
.modal-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(15,23,42,0.5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-card { background: #fff; border-radius: 24px; padding: 2.5rem 2rem; max-width: 500px; width: 100%; box-shadow: 0 24px 64px rgba(30,41,59,0.18); text-align: center; position: relative; }
.modal-close { position: absolute; top: 1rem; right: 1.25rem; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-close:hover { color: var(--text-primary); }
.modal-icon-badge { width: 56px; height: 56px; background: rgba(34,197,94,0.1); border: 1.5px solid rgba(34,197,94,0.3); color: hsl(var(--accent-green)); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; box-shadow: 0 4px 16px rgba(34,197,94,0.12); }
.modal-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.35rem; }
.modal-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; word-break: break-all; }
.modal-url-box { background: var(--bg-base); border: 1.5px solid rgba(139,92,246,0.2); border-radius: 14px; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.modal-url-text { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 700; color: hsl(var(--accent-violet)); word-break: break-all; user-select: all; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: center; margin-bottom: 1.25rem; }
.modal-qr { display: flex; justify-content: center; }
.modal-qr canvas { border-radius: 8px; box-shadow: 0 2px 8px rgba(30,41,59,0.08); }

/* ===== Result Card (keep for fallback) ===== */
.result-card { background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(243,232,255,0.5)); border-color: rgba(139,92,246,0.25); }
.result-glow { position: absolute; top: -50px; left: -50px; width: 150px; height: 150px; background: hsl(var(--accent-violet)); opacity: 0.05; filter: blur(50px); pointer-events: none; }
.success-icon-badge { width: 52px; height: 52px; background: rgba(34,197,94,0.1); border: 1.5px solid rgba(34,197,94,0.3); color: hsl(var(--accent-green)); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 0.75rem; }
.result-body { display: flex; flex-direction: column; gap: 1.25rem; align-items: center; margin-top: 1.25rem; }
.url-output-box { width: 100%; max-width: 580px; background: var(--bg-base); border: 1.5px solid rgba(139,92,246,0.2); padding: 0.9rem 1rem 0.9rem 1.25rem; border-radius: 14px; display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.output-url-text { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700; color: hsl(var(--accent-violet)); word-break: break-all; user-select: all; }
.result-details { width: 100%; max-width: 580px; background: rgba(241,245,249,0.5); border-radius: 10px; padding: 0.75rem 1rem; border: 1px solid rgba(148,163,184,0.15); }
.original-preview { display: flex; gap: 0.4rem; font-size: 0.85rem; }
.preview-label { color: var(--text-muted); white-space: nowrap; }
.preview-value { color: var(--text-secondary); word-break: break-all; }
.qr-code-section { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; margin-top: 0.75rem; padding: 1.25rem; background: rgba(241,245,249,0.3); border-radius: 14px; }
.qr-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.qr-canvas-wrapper { background: #fff; padding: 10px; border-radius: 12px; box-shadow: 0 4px 16px rgba(30,41,59,0.08); display: inline-block; }
.qr-canvas-wrapper canvas { display: block; max-width: 140px; max-height: 140px; }

/* ===== History Table ===== */
.history-table-wrapper { width: 100%; overflow-x: auto; border-radius: 12px; border: 1px solid rgba(148,163,184,0.15); background: rgba(255,255,255,0.5); }
.history-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; text-align: left; min-width: 700px; }
.history-table th { background: rgba(241,245,249,0.8); padding: 0.85rem 1rem; font-weight: 700; border-bottom: 1.5px solid rgba(148,163,184,0.2); }
.history-table td { padding: 0.9rem 1rem; border-bottom: 1px solid rgba(148,163,184,0.1); color: var(--text-secondary); vertical-align: middle; }
.history-table tbody tr { transition: background 0.15s; }
.history-table tbody tr:hover { background: rgba(139,92,246,0.03); }
.history-table tbody tr:last-child td { border-bottom: none; }
.table-code-link { font-family: var(--font-mono); color: hsl(var(--accent-violet)); font-weight: 600; font-size: 0.8rem; text-decoration: none; word-break: break-all; }
.table-code-link:hover { color: hsl(var(--accent-indigo)); text-decoration: underline; }
.table-long-url { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; color: var(--text-muted); font-size: 0.8rem; }
.table-clicks-badge { background: rgba(6,182,212,0.08); color: hsl(var(--accent-cyan)); font-family: var(--font-mono); font-weight: 600; font-size: 0.8rem; padding: 0.2rem 0.5rem; border-radius: 6px; }
.center-align { text-align: center; }
.right-align { text-align: right; font-family: var(--font-mono); font-size: 0.8rem; }
.empty-state { text-align: center; padding: 2.5rem !important; color: var(--text-muted); }

/* ===== Toast ===== */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; z-index: 10001; }
.toast { background: rgba(255,255,255,0.95); border: 1px solid rgba(139,92,246,0.2); box-shadow: 0 8px 24px rgba(30,41,59,0.1); color: var(--text-primary); padding: 0.8rem 1.25rem; border-radius: 10px; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 0.4rem; animation: toastSlideIn 0.3s cubic-bezier(0.16,1,0.3,1) forwards; }
.toast.error { border-color: rgba(244,63,94,0.3); }

/* ===== Footer ===== */
.app-footer { padding: 0.75rem 0; text-align: center; }
.footer-text { font-size: 0.75rem; color: var(--text-muted); }

/* ===== Utilities ===== */
.hidden { display: none !important; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(139,92,246,0.2); border-top-color: hsl(var(--accent-violet)); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; margin-right: 0.3rem; }

/* ===== Animations ===== */
@keyframes pulseSymbol { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
@keyframes spin { to{transform:rotate(360deg)} }
@keyframes toastSlideIn { from{opacity:0;transform:translateY(20px) scale(0.95)} to{opacity:1;transform:translateY(0) scale(1)} }
.animate-fade-in { animation: toastSlideIn 0.4s cubic-bezier(0.16,1,0.3,1) forwards; }

/* ===== Responsive ===== */
@media(max-width:768px) {
    .app-container { padding: 1.25rem 0.75rem; gap: 1rem; }
    .app-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .card { padding: 1.5rem 1.25rem; }
    .url-output-box { flex-direction: column; padding: 0.85rem; align-items: stretch; }
    .modal-card { padding: 2rem 1.5rem; }
    .modal-actions { flex-direction: column; }
    .tab-nav { flex-direction: column; }
    .history-table th,.history-table td { padding: 0.65rem 0.75rem; }
}
