/*
File: frontend/public/style.css
Purpose:
    Defines premium visual styling for ONE-SHOT static frontend pages.
Primary Responsibility:
    Provide consistent layout, typography, glassmorphism UI, and tight animations.
*/
@import url("https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap");
@import url("https://cdn.jsdelivr.net/gh/sunn-us/SUIT/fonts/variable/woff2/SUIT-Variable.css");

:root {
  /* Dynamic Background Colors */
  --bg-dark: #0f172a;
  --bg-gradient-1: #3b0764;
  --bg-gradient-2: #1e1b4b;
  --bg-gradient-3: #020617;
  
  /* Surface & Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-inner: rgba(0, 0, 0, 0.2);
  
  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-highlight: #e2e8f0;
  
  /* Accents */
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --secondary: #3b82f6;
  --accent: #10b981;
  --danger: #ef4444;
  
  /* Shadows & Glows */
  --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glow-primary: 0 0 20px rgba(139, 92, 246, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "SUIT Variable", "Pretendard Variable", "Noto Sans KR", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 50%, var(--bg-gradient-1), transparent 50%),
    radial-gradient(circle at 85% 30%, var(--bg-gradient-2), transparent 50%),
    radial-gradient(circle at 50% 100%, var(--bg-gradient-3), transparent 60%);
  background-attachment: fixed;
  background-size: cover;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Floating Background Orbs */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.6;
  animation: float 20s infinite ease-in-out alternate;
}
.orb-1 {
  width: 400px; height: 400px;
  background: var(--primary);
  top: -100px; left: -100px;
}
.orb-2 {
  width: 300px; height: 300px;
  background: var(--secondary);
  bottom: 20%; right: -50px;
  animation-delay: -5s;
}
.orb-3 {
  width: 250px; height: 250px;
  background: var(--accent);
  top: 40%; left: 30%;
  animation-delay: -10s;
  opacity: 0.4;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 50px) scale(1.1); }
  100% { transform: translate(-30px, 20px) scale(0.9); }
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 20px 60px;
  display: grid;
  gap: 24px;
  position: relative;
  z-index: 1;
}

/* Glass Panels */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 24px;
  transition: transform 0.3s ease, background 0.3s ease;
}

.glass-panel:hover {
  background: var(--glass-bg-hover);
}

.glass-inner {
  background: var(--glass-inner);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
}

/* Hero Section */
.hero-panel {
  display: grid;
  gap: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
  border-top: 1px solid rgba(255,255,255,0.3);
  border-left: 1px solid rgba(255,255,255,0.3);
}

.hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.hero-brand {
  display: grid;
  gap: 4px;
}

.hero-kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  color: var(--text-highlight);
  font-family: "Do Hyeon", "SUIT Variable", sans-serif;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

h1 {
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.1;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 24px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.subtitle {
  margin: 0;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
}

.meta {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

/* Buttons and Links */
.hero-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-main);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.glass-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-2px);
  text-decoration: none;
}

.hero-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.3);
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Session Area */
.session-summary {
  padding: 16px 20px;
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.session-title {
  margin: 0;
  font-weight: 700;
  font-size: 18px;
  color: #e2e8f0;
}

.session-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.session-identity code {
  background: rgba(0,0,0,0.4);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.1);
}

.identity-badge {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.provider-google { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.4); }
.provider-naver { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
.provider-guest { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.4); }

/* Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr);
  gap: 24px;
}

.dashboard-primary,
.dashboard-secondary {
  display: grid;
  gap: 24px;
  align-content: start;
}

/* Buttons */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-glow {
  position: relative;
}
.btn-glow::after {
  content: "";
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: inherit;
  border-radius: inherit;
  z-index: -1;
  filter: blur(8px);
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.btn-glow:hover::after { opacity: 0.9; }

.btn-outline {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-highlight);
}
.btn-outline:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: white;
  border: 1px solid rgba(255,100,100,0.3);
}

/* Social Logins */
.auth-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.social-btn {
  width: 100%;
}
.social-btn.google { background: #ffffff; color: #1e293b; }
.social-btn.google:hover { background: #f8fafc; transform: translateY(-2px); }
.social-btn.naver { background: #03c75a; color: white; }
.social-btn.naver:hover { background: #02b351; transform: translateY(-2px); }
.social-btn.guest { background: rgba(255,255,255,0.1); color: white; border: 1px solid rgba(255,255,255,0.2); }
.social-btn.guest:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }

/* Forms & Inputs */
form {
  display: grid;
  gap: 16px;
}

label {
  font-weight: 600;
  color: var(--text-highlight);
  font-size: 14px;
  display: block;
}

input, select {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px 16px;
  color: white;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.2s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0,0,0,0.5);
  box-shadow: var(--glow-primary);
}

input::placeholder {
  color: rgba(255,255,255,0.3);
}

.input-group {
  display: flex;
  gap: 12px;
  align-items: center;
}
.input-group .input-wrapper {
  flex: 1;
}
.input-group input {
  margin: 0;
}
.input-group button {
  height: 52px;
  padding: 0 28px;
}

/* Lists and Ranks */
.rank-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.rank-list li {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.rank-list li:hover {
  background: rgba(255,255,255,0.08);
  transform: translateX(4px);
}

.guide-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
  display: grid;
  gap: 10px;
}
.guide-list li { line-height: 1.5; }
.guide-list strong { color: var(--text-highlight); }

/* Results */
.result-card {
  margin-top: 16px;
  padding: 16px;
}
pre.result-card {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: monospace;
  font-size: 13px;
  color: #a7f3d0;
  max-height: 300px;
  overflow-y: auto;
}
pre.error {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.hidden { display: none !important; }

/* Helpers */
.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.panel-title-row h2 { margin-bottom: 0; }

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  text-decoration: underline;
  color: #a855f7;
}

/* Animations */
.list-animated li {
  animation: slide-up 0.4s ease forwards;
  opacity: 0;
}
.list-animated li:nth-child(1) { animation-delay: 0.05s; }
.list-animated li:nth-child(2) { animation-delay: 0.1s; }
.list-animated li:nth-child(3) { animation-delay: 0.15s; }
.list-animated li:nth-child(4) { animation-delay: 0.2s; }
.list-animated li:nth-child(5) { animation-delay: 0.25s; }

.glass-panel {
  animation: fade-in-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dashboard-primary .glass-panel:nth-child(1) { animation-delay: 0.1s; }
.dashboard-primary .glass-panel:nth-child(2) { animation-delay: 0.2s; }
.dashboard-primary .glass-panel:nth-child(3) { animation-delay: 0.3s; }
.dashboard-secondary .glass-panel:nth-child(1) { animation-delay: 0.25s; }
.dashboard-secondary .glass-panel:nth-child(2) { animation-delay: 0.35s; }

@keyframes fade-in-up {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes slide-up {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 980px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .bg-orb { display: none; }
}

@media (max-width: 680px) {
  .layout { padding: 16px 12px 40px; }
  h1 { font-size: 32px; }
  .hero-head { flex-direction: column; align-items: stretch; }
  .hero-links { justify-content: flex-start; margin-top: 8px;}
  .input-group { flex-direction: column; align-items: stretch; }
  .input-group button { height: 48px; }
}
