/* ==========================================================================
   PhilosFurry Studio - Custom Fursuit Maker & Milestone Management Platform
   Theme: Aurora Celestial & Glassmorphism UI
   ========================================================================== */

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.3);
  
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --secondary: #818cf8;
  --accent-pink: #f472b6;
  --accent-green: #34d399;
  --accent-amber: #fbbf24;
  --accent-purple: #c084fc;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --font-base: 'Outfit', 'Noto Sans Thai', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-base);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Background Atmosphere */
.nebula-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.nebula-glow-1 {
  position: absolute;
  top: -10%;
  left: 15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, rgba(0,0,0,0) 70%);
  filter: blur(80px);
}

.nebula-glow-2 {
  position: absolute;
  bottom: 5%;
  right: 10%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.12) 0%, rgba(0,0,0,0) 70%);
  filter: blur(90px);
}

.nebula-glow-3 {
  position: absolute;
  top: 40%;
  right: 30%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.08) 0%, rgba(0,0,0,0) 70%);
  filter: blur(100px);
}

/* App Header & Navigation */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
}

.header-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
}

.brand-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 0 15px var(--primary-glow);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, #fff 30%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.nav-tab-btn:hover {
  color: var(--text-main);
}

.nav-tab-btn.active {
  background: linear-gradient(135deg, var(--primary), #0284c7);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 12px var(--primary-glow);
}

/* Role Switcher Toolbar */
.role-switcher {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
}

.role-switcher-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
}

.role-select {
  background: #1e293b;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  font-family: inherit;
  font-size: 0.8rem;
  border-radius: var(--radius-full);
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  outline: none;
  font-weight: 500;
}

.role-select:focus {
  border-color: var(--primary);
}

/* Main Content Area */
.main-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

/* Common Card Styling */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #0284c7);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-blue {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-emerald {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-amber {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-purple {
  background: rgba(192, 132, 252, 0.15);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.badge-rose {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* ==========================================================================
   PAGE: SHOWCASE & GALLERY
   ========================================================================== */
.hero-banner {
  text-align: center;
  padding: 3rem 1rem 4rem;
  max-width: 850px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.2rem;
  letter-spacing: -1px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2rem;
}

/* Before / After Comparison Slider */
.slider-section {
  margin-bottom: 4rem;
}

.comparison-card {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 480px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
  user-select: none;
}

.comparison-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.comparison-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comparison-overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
  border-right: 3px solid #fff;
  box-shadow: 5px 0 25px rgba(0,0,0,0.5);
  z-index: 2;
}

.comparison-overlay img {
  position: absolute;
  top: 0;
  left: 0;
  width: 900px; /* matched to container */
  height: 100%;
  object-fit: cover;
  max-width: none;
}

.comparison-slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  background: #fff;
  color: #0f172a;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  cursor: ew-resize;
  z-index: 5;
  transition: transform 0.1s;
}

.comparison-label {
  position: absolute;
  bottom: 1.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  z-index: 4;
}

.label-left { left: 1.5rem; }
.label-right { right: 1.5rem; }

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.75rem;
}

.gallery-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.gallery-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-glow);
}

.gallery-card-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: #1e293b;
}

.gallery-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-grow: 1;
}

/* ==========================================================================
   PAGE: PUBLIC LIVE QUEUE BOARD
   ========================================================================== */
.queue-header-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.search-input-wrapper {
  position: relative;
  width: 320px;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.queue-table-card {
  overflow-x: auto;
}

.queue-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.queue-table th {
  padding: 1rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.queue-table td {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.queue-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Progress bar inside table/cards */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.4rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* ==========================================================================
   PAGE: MAKER STUDIO DASHBOARD (FOCUS MODE & 60-DAY ENGINE)
   ========================================================================== */
.studio-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 2rem;
}

@media (max-width: 1024px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

/* Today's Mission Radar */
.mission-radar-card {
  position: relative;
  overflow: hidden;
}

.mission-radar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f43f5e, #fbbf24, #38bdf8);
}

.mission-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.mission-item.urgent {
  border-left: 4px solid #f43f5e;
  background: rgba(244, 63, 94, 0.04);
}

.mission-item.warning {
  border-left: 4px solid #fbbf24;
  background: rgba(251, 191, 36, 0.04);
}

.mission-item.success {
  border-left: 4px solid #34d399;
  background: rgba(52, 211, 153, 0.04);
}

/* 60-Day Timeline Stage Cards */
.timeline-stages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.timeline-stage-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.timeline-stage-card.completed {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.04);
}

/* ==========================================================================
   PAGE: CLIENT PORTAL (MY FURSUIT & WIP APPROVAL)
   ========================================================================== */
.client-hero-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
  .client-hero-card {
    grid-template-columns: 1fr;
  }
}

.client-ref-preview {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-glow);
}

.payment-unlocked-banner {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(56, 189, 248, 0.15));
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.wip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.wip-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.wip-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.wip-card-body {
  padding: 1.25rem;
}

/* ==========================================================================
   MODALS & TOAST NOTIFICATIONS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #111827;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 90%;
  padding: 2rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: #fff;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 300;
}

.toast {
  background: #1e293b;
  border: 1px solid var(--border-glow);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   CONTRACT & LEGAL AGREEMENT STYLES (ป้องกันลูกค้าบิดงาน / มาตรการทางกฎหมาย)
   ========================================================================== */
.contract-paper {
  background: #ffffff;
  color: #1e293b;
  border-radius: var(--radius-md);
  padding: 2.5rem 2.25rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  position: relative;
  font-family: 'Noto Sans Thai', sans-serif;
  line-height: 1.7;
}

.contract-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.contract-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-size: 4.5rem;
  font-weight: 900;
  color: rgba(14, 165, 233, 0.06);
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

.contract-clause-box {
  background: #f8fafc;
  border-left: 4px solid #0284c7;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  border-radius: 4px;
  font-size: 0.92rem;
  color: #334155;
}

.contract-signature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #cbd5e1;
}

@media (max-width: 640px) {
  .contract-signature-block {
    grid-template-columns: 1fr;
  }
}

.signature-pad-container {
  background: #0f172a;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.signature-pad-canvas {
  width: 100%;
  height: 160px;
  background: #1e293b;
  border: 2px dashed rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-sm);
  cursor: crosshair;
  touch-action: none;
  display: block;
}

/* Print Friendly Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #contract-modal, #contract-modal * {
    visibility: visible;
  }
  #contract-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent !important;
  }
  .modal-content {
    background: #fff !important;
    color: #000 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }
  .no-print {
    display: none !important;
  }
}


