/* Theme CSS Variables and Custom Styles */

/* CSS Custom Properties for Theme */
:root {
  /* Color Palette */
  --color-primary: #1F3A93;
  --color-secondary: #F39C12;
  --color-accent: #16A085;
  --color-enchunblue: #3083BF;
  --color-background: #FFFFFF;
  --color-surface: #F7FAFC;
  --color-text: #1A202C;
  --color-text-muted: #718096;
  --color-border: #E2E8F0;
  /* 
    Purpose: 
    Define extended Enchun brand color palette as CSS custom properties, all prefixed with --color- for consistency and semantic clarity.
    This ensures all color variables are easily discoverable and maintainable across the codebase.
  */
  --color-alabaster: #fafafa;
  --color-alto: #d1d1d1;
  --color-amber: #ffc107;
  --color-black: #000000;
  --color-boston-blue: #3083bf;
  --color-concrete: #f2f2f2;
  --color-cream-can: #f6c456;
  --color-dove-gray: #6b6b6b;
  --color-dusty-gray: #999999;
  --color-emperor: #4f4f4f;
  --color-gray: #878787;
  --color-killarney: #3c6f50;
  --color-lucky-point: #171c61;
  --color-manatee: #939494;
  --color-mercury: #e3e3e3;
  --color-mine-shaft: #333333;
  --color-mine-shaft-60: #222222;
  --color-nobel: #b6b6b6;
  --color-oslo-gray: #939494;
  --color-pomegranate: #f44336;
  --color-silver: #bdbdbd;
  --color-silver-chalice: #acacac;
  --color-st-tropaz: #2b618f;
  --color-tarawera: #062841;
  --color-tropical-blue: #c7e4fa;
  --color-tundora: #4d4d4d;
  --color-turbo: #ffef00;
  --color-valencia: #d84038;
  --color-viking: #67aee1;
  --color-white: #ffffff;
  --color-wild-sand: #f6f6f6;

  /* Typography */
  --font-family-sans: 'Noto Sans CJK TC', 'Inter', system-ui, -apple-system, sans-serif;
  --font-family-heading: 'Noto Sans CJK TC', 'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
}

/* Dark Theme (if needed in future) */
@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #1A202C;
    --color-surface: #2D3748;
    --color-text: #F7FAFC;
    --color-text-muted: #A0AEC0;
    --color-border: #4A5568;
  }
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  font-family: var(--font-family-sans);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
}

body {
  margin: 0;
  padding: 0;
  font-family: inherit;
  line-height: inherit;
  color: inherit;
  background-color: inherit;
}

/* Typography Classes */
.text-gradient {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn var(--transition-normal) ease-in-out;
}

.slide-up {
  animation: slideUp var(--transition-normal) ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Utility Classes */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.shadow-custom {
  box-shadow: var(--shadow-lg);
}

/* Component Specific Styles */
.nav-link {
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition-fast);
}

.nav-link:hover::after {
  width: 100%;
}

/* Active Navigation Link Indicator */
.nav-active {
  position: relative;
}

.nav-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 2px;
  background: var(--color-secondary);
}

/* Prose/Markdown Styles */
.prose-custom {
  color: var(--color-text);
  font-family: var(--font-family-sans);
}

.prose-custom h1,
.prose-custom h2,
.prose-custom h3,
.prose-custom h4,
.prose-custom h5,
.prose-custom h6 {
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.2;
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
}

.prose-custom h1 {
  font-size: 2.25rem;
}

.prose-custom h2 {
  font-size: 1.875rem;
}

.prose-custom h3 {
  font-size: 1.5rem;
}

.prose-custom p {
  margin-bottom: var(--spacing-md);
  line-height: 1.7;
}

.prose-custom a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.prose-custom a:hover {
  color: #1a2f7a;
  text-decoration: underline;
}

.prose-custom strong {
  color: var(--color-text);
  font-weight: 600;
}

.prose-custom em {
  color: var(--color-text-muted);
}

.prose-custom ul,
.prose-custom ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
}

.prose-custom li {
  margin-bottom: var(--spacing-xs);
  line-height: 1.6;
}

.prose-custom blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  color: var(--color-text-muted);
  font-style: italic;
  background: var(--color-surface);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
}

.prose-custom code {
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0.125rem 0.25rem;
  border-radius: var(--radius-sm);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875em;
}

.prose-custom pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  overflow-x: auto;
  margin: var(--spacing-lg) 0;
}

.prose-custom pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.prose-custom hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--spacing-2xl) 0;
}

.prose-custom table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-lg) 0;
}

.prose-custom th,
.prose-custom td {
  border: 1px solid var(--color-border);
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
}

.prose-custom th {
  background: var(--color-surface);
  font-weight: 600;
}

.prose-custom img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--spacing-md) 0;
}

/* Button Styles */
.btn-primary {
  background: var(--color-primary);
  color: white;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background: #1a2f7a;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-secondary);
  color: white;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: #e08e0b;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}