:root {
  /* HSL Color Palette - Vibrant, Modern, Premium */
  --hue-primary: 235;
  --hue-secondary: 280;
  --hue-accent: 340;
  
  --color-primary: hsl(var(--hue-primary), 90%, 65%);
  --color-primary-dark: hsl(var(--hue-primary), 80%, 55%);
  --color-secondary: hsl(var(--hue-secondary), 85%, 65%);
  --color-accent: hsl(var(--hue-accent), 85%, 65%);
  
  /* Neutral scale - sleek dark mode focus */
  --bg-color: hsl(220, 25%, 4%);
  --text-primary: hsl(210, 20%, 98%);
  --text-secondary: hsl(210, 15%, 80%);
  --text-muted: hsl(210, 10%, 60%);
  
  /* Glassmorphism Tokens */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-border-light: rgba(255, 255, 255, 0.15);
  --glass-highlight: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 16px 40px 0 rgba(0, 0, 0, 0.4);
  
  /* Typography */
  --font-family: 'Outfit', 'Pretendard', sans-serif;
  
  /* Transition Constants */
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow: hidden; /* App container handles scroll */
  -webkit-font-smoothing: antialiased;
}

/* Ambient Animated Background */
.ambient-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-color);
}

.blob {
  position: absolute;
  filter: blur(100px);
  opacity: 0.5;
  border-radius: 50%;
  animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--color-primary);
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: var(--color-secondary);
  bottom: -20%;
  right: -10%;
  animation-delay: -5s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: var(--color-accent);
  top: 40%;
  left: 30%;
  animation-duration: 25s;
  opacity: 0.2;
}

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

/* App Container */
#app-container {
  position: relative;
  width: 100%;
  height: 100vh;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}

.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* Glass Card Premium Core Component */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-light);
  box-shadow: var(--glass-shadow);
  border-radius: 28px;
  transition: transform 0.3s, box-shadow 0.3s;
}

/* Splash Screen Specifics */
.splash-content {
  padding: 40px 60px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-container {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px rgba(var(--hue-primary), 80%, 50%, 0.4);
}

.logo-icon {
  font-size: 48px;
  color: white;
}

.brand-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
  background: linear-gradient(to right, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 40px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.loading-bar-container {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transition: width 0.3s ease;
  animation: load 2s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes load {
  0% { transform: translateX(-100%); width: 50%; }
  100% { transform: translateX(200%); width: 50%; }
}

.status-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* Login Screen Specifics */
.login-content {
  width: 90%;
  max-width: 420px;
  padding: 48px 40px;
  text-align: center;
}

.login-header i.small {
  font-size: 36px;
  color: var(--color-primary);
  margin-bottom: 16px;
  text-shadow: 0 0 20px rgba(var(--hue-primary), 80%, 50%, 0.5);
}

.login-header h2 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 12px;
}

.login-header h2 span {
  background: linear-gradient(to right, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 48px;
}

/* Google Button */
.btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-premium {
  width: 100%;
  padding: 16px 24px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  transition: all var(--transition-smooth);
}

.btn-google {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-google:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-google:active {
  transform: translateY(0);
}

.google-logo {
  margin-right: 12px;
}

.btn-sparkle {
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: skewX(-20deg);
  transition: 0.5s;
}

.btn-google:hover .btn-sparkle {
  left: 200%;
  transition: left 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
}

.login-footer p {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.login-footer i {
  font-size: 16px;
  color: var(--color-primary);
}

.login-footer strong {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Utilities */
.animate-slide-up {
  animation: slideUp 0.8s var(--transition-bounce) both;
}

@keyframes slideUp {
  0% { transform: translateY(40px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Main Screen Specifics (SCR-02) */
.main-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.9), transparent);
  width: 100%;
}

.nav-brand {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-profile i {
  font-size: 36px;
  color: var(--color-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.nav-profile i:hover {
  transform: scale(1.1);
  color: var(--color-accent);
}

.dashboard-scroll-area {
  flex: 1;
  width: 100%;
  padding: 0 32px;
  overflow-y: auto;
  padding-bottom: 100px;
}

.section-heading {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-secondary);
}

.trip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.empty-trip-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  text-align: center;
}

.empty-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.empty-icon-circle i {
  font-size: 32px;
  color: var(--color-secondary);
}

.empty-trip-state h4 {
  font-size: 18px;
  margin-bottom: 8px;
}

.empty-trip-state p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* FAB */
.fab {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 64px;
  height: 64px;
  border-radius: 32px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  border: none;
  box-shadow: 0 10px 30px rgba(var(--hue-primary), 80%, 50%, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-smooth);
}

.fab i {
  font-size: 32px;
}

.fab:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 15px 40px rgba(var(--hue-accent), 80%, 50%, 0.6);
}

/* Modal UI */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-content {
  width: 90%;
  max-width: 480px;
  padding: 32px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 22px;
  font-weight: 600;
}

.btn-close-modal {
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.btn-close-modal:hover {
  color: var(--color-accent);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.input-row {
  display: flex;
  gap: 16px;
}

.input-group label {
  font-size: 14px;
  color: var(--text-secondary);
}

.input-group input {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s;
}

.input-group input:focus {
  border-color: var(--color-primary);
}

.btn-create {
  background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
  color: white;
  font-size: 16px;
}

/* Detail Planner Screen Specifics (SCR-06) */
#detail-screen {
  display: flex;
  flex-direction: column;
}

.detail-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  z-index: 10;
  margin: 16px; 
}

.btn-back {
  font-size: 24px;
  cursor: pointer;
  color: var(--text-primary);
  transition: color 0.3s;
}

.btn-back:hover {
  color: var(--color-primary);
}

.detail-trip-title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  padding: 0 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex: 1;
  overflow: hidden;
}

/* Responsive Centered Layout */
@media (min-width: 768px) {
  .detail-top-nav {
    background: transparent;
    border: none;
    box-shadow: none;
    margin-bottom: 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
  .map-view-placeholder {
    margin: 32px 16px 32px 32px;
  }
  .timeline-scroll-area {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    height: 100%;
  }
}

/* FAB Extra (지도 모달 제어용) */
.fab-btn {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background: var(--color-secondary);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-smooth);
}

.fab-btn:hover {
  transform: scale(1.05);
  background: var(--color-primary);
}
.timeline-scroll-area {
  flex: 1;
  padding: 0 24px 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}

.timeline-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.btn-small-glass {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-small-glass:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-small-glass i {
  font-size: 16px;
}

.timeline-list {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.timeline-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  margin-top: 16px;
}

.timeline-empty-state i {
  font-size: 32px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.timeline-empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Google Maps Autocomplete Dark Mode Fix */
.pac-container {
  background-color: var(--bg-color);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 12px;
  margin-top: 8px;
  font-family: var(--font-family);
  z-index: 9999 !important;
}

.pac-item {
  color: var(--text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  cursor: pointer;
}

.pac-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.pac-item-query {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 15px;
}

.pac-icon {
  filter: invert(1);
  opacity: 0.6;
}

.timeline-place-card {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--color-primary);
  align-items: center;
  gap: 16px;
}

/* Trip Card Delete Button */
.glass-card { /* Overriding position to relative for absolute delete button positioning */
  position: relative;
}

.btn-delete-trip {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s, color 0.3s, transform 0.2s;
  z-index: 10;
}

.glass-card:hover .btn-delete-trip {
  opacity: 1;
}

.btn-delete-trip:hover {
  color: #ff4757;
  transform: scale(1.1);
}

/* Timeline Reorder Buttons */
.btn-icon-small {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-icon-small i {
  font-size: 20px;
}

.btn-icon-small:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.btn-icon-small:disabled {
  opacity: 0.2;
  cursor: default;
}
