:root {
  --background-color: #f9fafb;
  --card-background: #ffffff;
  --primary-blue: #3182f6;
  --primary-blue-hover: #1b64da;
  --text-primary: #333d4b;
  --text-secondary: #6b7684;
  --text-placeholder: #b0b8c1;
  --border-color: #e5e8eb;
  --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body.dark-mode {
  --background-color: #121212;
  --card-background: #1e1e1e;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --border-color: #333333;
}


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

body {
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--text-primary);
  transition: background-color 0.3s, color 0.3s;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--card-background);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  transition: background-color 0.3s, border-bottom-color 0.3s;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.theme-toggle-button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-button:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

body.dark-mode .theme-toggle-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}


.app-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.tabs {
  margin-bottom: 1.5rem;
  display: flex;
  background-color: var(--background-color);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

body.dark-mode .tabs {
    background-color: #2a2a2a;
}

.tab-button {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border: none;
  background-color: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.tab-button:hover {
  background-color: #f0f1f3;
}

body.dark-mode .tab-button:hover {
    background-color: #3a3a3a;
}

.tab-button.active {
  background-color: var(--card-background);
  color: var(--text-primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tab-content {
  display: none;
  width: 100%;
  max-width: 580px;
}

.tab-content.active {
  display: block;
}


.converter-card {
  width: 100%;
  background-color: var(--card-background);
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: background-color 0.3s;
}

.converter-header {
  padding: 2rem 2rem 1.5rem;
  text-align: center;
}

.converter-header h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.converter-header p {
  color: var(--text-secondary);
}

.converter-header code {
  background-color: #f2f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

body.dark-mode .converter-header code {
  background-color: #2c2c2c;
  color: var(--text-primary);
}


.converter-body {
  padding: 0 2rem 1.5rem;
}

#file-drop-area, #file-drop-area-2 {
  border: 2px solid var(--border-color); /* Changed from dashed to solid for more prominence */
  background-color: #f8f9fa; /* Subtle background color */
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.2s, background-color 0.2s;
}

body.dark-mode #file-drop-area, body.dark-mode #file-drop-area-2 {
  background-color: #2a2a2a;
  border-color: #444;
}

#file-drop-area.dragover, #file-drop-area-2.dragover {
  background-color: #f0f6ff;
  border-color: var(--primary-blue);
}

body.dark-mode #file-drop-area.dragover, body.dark-mode #file-drop-area-2.dragover {
    background-color: #2c3a4e;
    border-color: var(--primary-blue);
}


.upload-icon {
  margin-bottom: 1rem;
  color: var(--text-placeholder);
}

.upload-text {
  font-weight: 500;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.upload-subtext {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.file-upload-button {
  display: inline-block;
  background-color: #e5e8eb;
  color: var(--text-primary);
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.file-upload-button:hover {
  background-color: #d8dde3;
}

body.dark-mode .file-upload-button {
    background-color: #3a3a3a;
    color: var(--text-primary);
}

body.dark-mode .file-upload-button:hover {
    background-color: #4a4a4a;
}

.file-name {
  display: block;
  margin-top: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  min-height: 1.2em;
  word-break: break-all;
}

.converter-footer {
  background-color: #f9fafb;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  transition: background-color 0.3s, border-top-color 0.3s;
}

body.dark-mode .converter-footer {
    background-color: #121212;
}

#convertBtn {
  width: 100%;
  background-color: var(--primary-blue);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 1rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

#convertBtn:hover:not(:disabled) {
  background-color: var(--primary-blue-hover);
}

#convertBtn:disabled {
  background-color: #b0b8c1;
  cursor: not-allowed;
}

body.dark-mode #convertBtn:disabled {
    background-color: #555;
    color: #999;
}


#convertBtn:active:not(:disabled) {
  transform: scale(0.98);
}

.app-footer {
  text-align: center;
  padding: 1.5rem 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.results-card {
    width: 100%;
    background-color: var(--card-background);
    border-radius: 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    margin-top: 2rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.results-header h2 {
    font-size: 1.25rem;
}

#downloadCsvBtn {
    background-color: var(--primary-blue);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#downloadCsvBtn:hover {
    background-color: var(--primary-blue-hover);
}

.results-body {
    padding: 1rem;
    overflow-x: auto;
}

#results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

#results-table th, #results-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

#results-table th {
    font-weight: 700;
    color: var(--text-secondary);
}

#results-table tbody tr:last-child td {
    border-bottom: none;
}

#results-table tbody tr:hover {
    background-color: #f8f9fa;
}

body.dark-mode #results-table tbody tr:hover {
    background-color: #2a2a2a;
}