/**
 * {{RIPER-5:
 *   Action: "Added"
 *   Task_ID: "b886c65d-4f43-4129-b122-e96580a2ece1"
 *   Timestamp: "2025-11-10T15:20:00Z"
 *   Authoring_Role: "LD"
 *   Principle_Applied: "Aether-Design-Liquid-Glass, Aether-Design-Universal-Softness"
 *   Quality_Check: "CSS validated, glassmorphism tested, WCAG AA compliant"
 * }}
 */

/* ============================================
   AETHER DESIGN SYSTEM - LIQUID GLASS
   Core CSS Variables & Foundation Styles
   ============================================ */

/* CSS Variables - Design Tokens */
:root {
  /* ========== Glass Effect Variables ========== */
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-bg-dark: rgba(0, 0, 0, 0.2);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-dark: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --glass-shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.15);
  
  /* ========== Border Radius規範 ========== */
  --radius-2xl: 1rem;        /* 16px - 容器/按鈕/輸入框 */
  --radius-full: 9999px;     /* 圓形 - 頭像/徽章 */
  
  /* ========== Primary Color Palette ========== */
  --color-primary: #FF6B35;           /* 探險橙 */
  --color-primary-light: #FF8A5C;
  --color-primary-dark: #E55520;
  --color-primary-rgb: 255, 107, 53;
  
  --color-secondary: #1A365D;         /* 深藍夜空 */
  --color-secondary-light: #2D4A7C;
  --color-secondary-dark: #0F1F3D;
  --color-secondary-rgb: 26, 54, 93;
  
  --color-accent: #FFD93D;            /* 金色高光 */
  --color-accent-light: #FFE570;
  --color-accent-dark: #E6C324;
  
  /* ========== Semantic Colors ========== */
  --color-success: #10B981;
  --color-success-light: #34D399;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;
  --color-info: #3B82F6;
  
  /* ========== Neutral Colors ========== */
  --color-white: #FFFFFF;
  --color-black: #000000;
  --color-gray-50: #F9FAFB;
  --color-gray-100: #F3F4F6;
  --color-gray-200: #E5E7EB;
  --color-gray-300: #D1D5DB;
  --color-gray-400: #9CA3AF;
  --color-gray-500: #6B7280;
  --color-gray-600: #4B5563;
  --color-gray-700: #374151;
  --color-gray-800: #1F2937;
  --color-gray-900: #111827;
  
  /* ========== Background Gradients ========== */
  --bg-starry-night: radial-gradient(
    ellipse at top,
    #1A365D 0%,
    #0f172a 50%,
    #000000 100%
  );
  --bg-sunrise: linear-gradient(
    135deg,
    #FF6B35 0%,
    #FFD93D 100%
  );
  --bg-glass-overlay: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  
  /* ========== Typography ========== */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 
               'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
               'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 
               Consolas, 'Courier New', monospace;
  
  --font-size-xs: 0.75rem;      /* 12px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;      /* 24px */
  --font-size-3xl: 1.875rem;    /* 30px */
  --font-size-4xl: 2.25rem;     /* 36px */
  --font-size-5xl: 3rem;        /* 48px */
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* ========== Spacing Scale ========== */
  --spacing-1: 0.25rem;   /* 4px */
  --spacing-2: 0.5rem;    /* 8px */
  --spacing-3: 0.75rem;   /* 12px */
  --spacing-4: 1rem;      /* 16px */
  --spacing-5: 1.25rem;   /* 20px */
  --spacing-6: 1.5rem;    /* 24px */
  --spacing-8: 2rem;      /* 32px */
  --spacing-10: 2.5rem;   /* 40px */
  --spacing-12: 3rem;     /* 48px */
  --spacing-16: 4rem;     /* 64px */
  --spacing-20: 5rem;     /* 80px */
  
  /* ========== Animation Easing ========== */
  --ease-smooth: cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0.0, 1, 1);
  --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* ========== Transitions ========== */
  --transition-fast: 150ms var(--ease-smooth);
  --transition-base: 300ms var(--ease-smooth);
  --transition-slow: 500ms var(--ease-smooth);
  
  /* ========== Z-Index Layers ========== */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-modal-backdrop: 1200;
  --z-modal: 1300;
  --z-popover: 1400;
  --z-tooltip: 1500;
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */

/* Box Sizing Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* HTML & Body Setup */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-white);
  background: var(--bg-starry-night);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Typography Base */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-4);
}

h1 { font-size: var(--font-size-5xl); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-3xl); }
h4 { font-size: var(--font-size-2xl); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

p {
  margin-bottom: var(--spacing-4);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* List Reset */
ul, ol {
  list-style: none;
}

/* Image & Media */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form Elements Base */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Accessibility - Focus Outline */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Disabled State */
:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================
   GLASS EFFECT CLASSES - CORE SYSTEM
   ============================================ */

/* Primary Glass Card */
.glass-card {
  backdrop-filter: blur(20px) saturate(150%) brightness(110%);
  -webkit-backdrop-filter: blur(20px) saturate(150%) brightness(110%);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

/* Glass Card with Dark Variant */
.glass-card-dark {
  backdrop-filter: blur(20px) saturate(150%) brightness(90%);
  -webkit-backdrop-filter: blur(20px) saturate(150%) brightness(90%);
  background: var(--glass-bg-dark);
  border: 1px solid var(--glass-border-dark);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow);
}

/* Intense Glass Effect (for modals) */
.glass-modal {
  backdrop-filter: blur(30px) saturate(180%) brightness(110%);
  -webkit-backdrop-filter: blur(30px) saturate(180%) brightness(110%);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow-lg);
}

/* Subtle Glass (for overlays) */
.glass-subtle {
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-2xl);
}

/* Glass Hover Effect */
.glass-card:hover,
.glass-card-dark:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transition: all var(--transition-base);
}

/* Inner Glow Effect (on hover) */
.glass-glow:hover {
  box-shadow: 
    0 0 20px rgba(255, 107, 53, 0.3),
    0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ============================================
   BORDER RADIUS UTILITIES
   ============================================ */

.rounded-2xl {
  border-radius: var(--radius-2xl) !important;
}

.rounded-full {
  border-radius: var(--radius-full) !important;
}

/* Directional Rounded Corners */
.rounded-top-2xl {
  border-top-left-radius: var(--radius-2xl);
  border-top-right-radius: var(--radius-2xl);
}

.rounded-bottom-2xl {
  border-bottom-left-radius: var(--radius-2xl);
  border-bottom-right-radius: var(--radius-2xl);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.gap-1 { gap: var(--spacing-1); }
.gap-2 { gap: var(--spacing-2); }
.gap-3 { gap: var(--spacing-3); }
.gap-4 { gap: var(--spacing-4); }
.gap-6 { gap: var(--spacing-6); }
.gap-8 { gap: var(--spacing-8); }

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Spacing Utilities */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.p-2 { padding: var(--spacing-2); }
.p-3 { padding: var(--spacing-3); }
.p-4 { padding: var(--spacing-4); }
.p-6 { padding: var(--spacing-6); }
.p-8 { padding: var(--spacing-8); }

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-bold { font-weight: var(--font-weight-bold); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-medium { font-weight: var(--font-weight-medium); }

/* Color Utilities */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent); }
.text-white { color: var(--color-white); }
.text-gray-400 { color: var(--color-gray-400); }

.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-accent { background-color: var(--color-accent); }

/* Display Utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Position Utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

/* Width Utilities */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  :root {
    --font-size-5xl: 2.25rem;   /* 36px on mobile */
    --font-size-4xl: 1.875rem;  /* 30px on mobile */
    --font-size-3xl: 1.5rem;    /* 24px on mobile */
  }
  
  .glass-card {
    padding: var(--spacing-4);
  }
}

@media (max-width: 480px) {
  :root {
    --font-size-5xl: 2rem;      /* 32px on small mobile */
    --font-size-4xl: 1.5rem;    /* 24px on small mobile */
  }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  body {
    background: white;
    color: black;
  }
  
  .glass-card,
  .glass-card-dark,
  .glass-modal {
    background: white;
    border: 1px solid #000;
    box-shadow: none;
    backdrop-filter: none;
  }
}

/* ============================================
   BACKDROP-FILTER FALLBACK
   ============================================ */

@supports not (backdrop-filter: blur(20px)) {
  .glass-card,
  .glass-card-dark {
    background: rgba(26, 54, 93, 0.85);
  }
  
  .glass-modal {
    background: rgba(26, 54, 93, 0.95);
  }
}

