@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;800;900&display=swap');:root {
  font-family: 'Pretendard', Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: #111827;
  background-color: #f3f4f6;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* App colors */
  --primary-color: #8b5cf6;
  --primary-hover: #7c3aed;
  --bg-color: #f3f4f6;
  --sidebar-bg: #ffffff;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
}

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

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  min-width: 100vw;
  overflow: hidden;
  background-color: var(--bg-color);
}

#root {
  display: flex;
  width: 100%;
  height: 100%;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
}

@font-face {
  font-family: 'Gotham';
  src: url('../fonts/GOTHAM-LIGHT.OTF') format('opentype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Gotham';
  src: url('../fonts/Gotham-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Gotham';
  src: url('../fonts/GOTHAM-BOLD.OTF') format('opentype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Gotham';
  src: url('../fonts/GOTHAM-BLACK.TTF') format('truetype');
  font-weight: 900;
  font-style: normal;
}

@font-face {
  font-family: 'Paperlogy';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-2ExtraLight.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
}

@font-face {
  font-family: 'Paperlogy';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-3Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Paperlogy';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-5Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Paperlogy';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-6SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Paperlogy';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-7Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Paperlogy';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-8ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
}

@font-face {
  font-family: 'Paperlogy';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-9Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
}

@font-face {
     font-family: 'S-CoreDream';
     src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-2ExtraLight.woff') format('woff');
     font-weight: 200;
     font-style: normal;
}

@font-face {
     font-family: 'S-CoreDream';
     src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-3Light.woff') format('woff');
     font-weight: 300;
     font-style: normal;
}

@font-face {
     font-family: 'S-CoreDream';
     src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-4Regular.woff') format('woff');
     font-weight: 400;
     font-style: normal;
}

@font-face {
     font-family: 'S-CoreDream';
     src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-5Medium.woff') format('woff');
     font-weight: 500;
     font-style: normal;
}

@font-face {
     font-family: 'S-CoreDream';
     src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-6Bold.woff') format('woff');
     font-weight: 600;
     font-style: normal;
}

@font-face {
     font-family: 'S-CoreDream';
     src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-7ExtraBold.woff') format('woff');
     font-weight: 700;
     font-style: normal;
}

@font-face {
     font-family: 'S-CoreDream';
     src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-8Heavy.woff') format('woff');
     font-weight: 800;
     font-style: normal;
}

@font-face {
     font-family: 'S-CoreDream';
     src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-9Black.woff') format('woff');
     font-weight: 900;
     font-style: normal;
}

@font-face {
    font-family: 'KoPub Dotum';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_two@1.0/KoPubDotumMedium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'KoPub Dotum';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_two@1.0/KoPubDotumBold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
}

.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Styling */

.sidebar {
  width: 380px;
  min-width: 380px;
  background-color: var(--sidebar-bg);
  height: 100%;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

/* Custom Scrollbar for Sidebar */

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.sidebar-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.sidebar-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.format-btn {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.format-btn:hover {
  background: #f9fafb;
}

.format-btn.active {
  background: var(--text-main);
  color: white;
  border-color: var(--text-main);
}

.flex-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.flex-row>* {
  flex: 1;
}

.switch-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #f9fafb;
  border-radius: 12px;
}

.switch-text h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.switch-text p {
  font-size: 12px;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-switch.active {
  background: var(--text-main);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch.active::after {
  transform: translateX(20px);
}

.input-field {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background-color: #EFF4F8;
  color: var(--text-main);
}

.input-field:focus {
  border-color: var(--primary-color);
}

input[type="date"].input-field::-webkit-calendar-picker-indicator {
  background-color: #64748b; /* 쿨톤 진회색 (Slate) */
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
  filter: invert(1); /* 아이콘 흰색 반전 */
}

/* Custom Scrollbar for Textarea */

textarea.input-field::-webkit-scrollbar {
  width: 6px;
}

textarea.input-field::-webkit-scrollbar-track {
  background: transparent;
}

textarea.input-field::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.5);
  border-radius: 10px;
}

textarea.input-field::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.8);
}

.calc-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #6b7280;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.calc-btn:hover {
  background-color: #374151;
  transform: translateY(-50%) scale(1.05);
}

.calc-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: #ffffff;
  color: #334155;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(71, 85, 105, 0.15), 0 2px 4px rgba(71, 85, 105, 0.1);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 100;
}

.calc-btn:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.hide-native-indicator::-webkit-calendar-picker-indicator {
  display: none !important;
  -webkit-appearance: none;
}

.ai-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
  color: white;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ai-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.image-drop-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
}

.image-drop-area:hover {
  border-color: var(--primary-color);
  background: #f5f3ff;
  color: var(--primary-color);
}

.swatch-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #fafafa;
}

.swatch-color {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

/* Canvas Area */

.canvas-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: auto;
  padding: 40px;
}

.canvas-toolbar {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  z-index: 5;
}

.status-badge {
  background: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.status-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
}

.format-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.artboard-wrapper {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  background: white;
  transition: all 0.3s ease;
}

.export-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: var(--text-main);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
  z-index: 5;
}

.export-btn:hover {
  background: #374151;
  transform: translateY(-2px);
}

.highlight-red {
  border: 1px solid red;
  box-sizing: border-box;
  background-color: rgba(255, 0, 0, 0.03); /* slight tint for visibility */
}

@media print {
  .highlight-red {
    border: none !important;
    background-color: transparent !important;
    display: none !important;
  }
}