/* 
 * error-pages.css - 에러 페이지 스타일 통합
 * 이전: 404.html, 500.html의 인라인 스타일을 통합
 */

/* ===== 404 페이지 스타일 ===== */
.error-page {
  position: relative;
  min-height: calc(var(--real-vh, 1vh) * 100);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  overflow: hidden;
  background: var(--bg-primary);
}

.background-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 1.0;
  background: transparent;
  pointer-events: none;
  display: block;
}

.error-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 600px;
  width: 100%;
  background: var(--bg-secondary);
  background: color-mix(in srgb, var(--bg-secondary) 92%, transparent);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 3rem 2rem;
  border: 1px solid var(--border-color);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.1),
    0 8px 16px rgba(0, 0, 0, 0.05);
  animation: contentFadeIn 1s ease-out;
}

@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.error-code {
  font-size: 6rem;
  font-weight: 900;
  background: linear-gradient(135deg, #0969da 0%, #1f6feb 50%, #4493f8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  font-family: var(--font-sans);
  letter-spacing: -0.05em;
  line-height: 0.9;
  animation: numberPulse 3s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.error-code:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 20px rgba(9, 105, 218, 0.4));
}

@keyframes numberPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.error-image-container {
  margin: 2rem 0;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 320px;
  height: 320px;
  margin-left: auto;
  margin-right: auto;
}

.error-image {
  max-width: 320px;
  max-height: 320px;
  width: auto;
  height: auto;
  border-radius: 16px;
  transition: transform 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  object-fit: contain;
  display: block;
  image-rendering: auto;
  image-resolution: from-image;
}

.error-image:hover {
  transform: translateY(-8px) rotate(2deg);
}

.error-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.5rem 0 1rem;
  font-family: var(--font-sans);
}

.error-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.5;
  font-family: var(--font-sans);
}

.error-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.error-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font-family: var(--font-sans);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-width: 240px;
}

.error-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s;
}

.error-btn:hover::before {
  left: 100%;
}

.error-btn-primary {
  background: linear-gradient(135deg, #0969da, #1f6feb);
  color: white;
  box-shadow: 0 4px 16px rgba(9, 105, 218, 0.3);
}

.error-btn-primary:hover {
  background: linear-gradient(135deg, #0860C9, #1a5feb);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(9, 105, 218, 0.4);
  text-decoration: none;
  color: white;
}

.error-btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.error-btn-secondary:hover {
  background: var(--neutral-200);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: var(--text-primary);
  border-color: var(--github-accent);
}

.error-btn-fun {
  background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
  color: white;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

.error-btn-fun:hover {
  background: linear-gradient(135deg, #ff5252, #26c6da);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(255, 107, 107, 0.4);
  text-decoration: none;
  color: white;
}

/* ===== 500 페이지 스타일 ===== */
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(var(--real-vh, 1vh) * 60);
  text-align: center;
  padding: 2rem 1rem;
}

.error-container h1 {
  font-size: 2.5rem;
  color: var(--danger);
  margin-bottom: 1rem;
  font-family: var(--font-sans);
}

.error-container p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-family: var(--font-sans);
}

.error-container .btn {
  min-width: 180px;
  padding: 0.8rem 1.5rem;
}

/* ===== 다크모드 조정 ===== */
html.dark-theme .error-content {
  background: rgba(22, 27, 34, 0.9);
  border-color: var(--border-color);
}

html.dark-theme .error-btn-secondary {
  background-color: var(--bg-tertiary);
  border-color: var(--border-color);
}

html.dark-theme .error-btn-secondary:hover {
  background-color: rgba(48, 54, 61, 0.8);
  border-color: #58a6ff;
}

/* ===== 반응형 조정 ===== */
@media (max-width: 768px) {
  .error-content { 
    padding: 2rem 1.5rem; 
    margin: 1rem; 
  }
  
  .error-code { 
    font-size: 4rem; 
  }
  
  .error-title { 
    font-size: 1.5rem; 
  }
  
  .error-subtitle { 
    font-size: 1rem; 
  }
  
  .error-image-container { 
    width: 240px; 
    height: 240px; 
  }
  
  .error-image { 
    max-width: 240px; 
    max-height: 240px; 
  }
  
  .error-btn { 
    min-width: 200px; 
    padding: 0.9rem 1.5rem; 
    font-size: 1rem; 
  }
}

@media (max-width: 480px) {
  .error-page { 
    min-height: calc(100vh - 120px); 
    padding: 1rem 0.5rem; 
  }
  
  .error-content { 
    padding: 1.5rem 1rem; 
  }
  
  .error-code { 
    font-size: 3.5rem; 
  }
  
  .error-image-container { 
    width: 200px; 
    height: 200px; 
  }
  
  .error-image { 
    max-width: 200px; 
    max-height: 200px; 
  }
  
  .error-btn { 
    min-width: 180px; 
    padding: 0.8rem 1.2rem; 
  }
}

/* ===== 8비트 테마 조정 ===== */
html.theme-8bit .error-btn,
html.theme-pixel-fusion .error-btn,
html.theme-royal-pixel .error-btn,
html.theme-future-pixel .error-btn {
  border-radius: 0;
  border-width: 2px;
  border-style: solid;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.4);
  transition: none;
}

html.theme-8bit .error-btn:hover,
html.theme-pixel-fusion .error-btn:hover,
html.theme-royal-pixel .error-btn:hover,
html.theme-future-pixel .error-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.4);
}
