.main {
  min-height: 100vh;
  padding: 2rem;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 2rem;
}

.header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e0e0e0;
}

.headerContent {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.headerContent > div:first-child {
  text-align: center;
  flex: 1;
  min-width: 200px;
}

.title {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.subtitle {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
  max-width: 100%;
}

.controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.controlGroup {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.label {
  font-weight: 600;
  color: #333;
}

.select {
  padding: 0.5rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.select:hover {
  border-color: #667eea;
}

.select:focus {
  outline: none;
  border-color: #667eea;
}

.analyzeButtonGroup {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  margin-left: auto;
  max-width: 400px;
}

.analyzeButton {
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}

.analyzeButton:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.analyzeButton:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.analyzeButton.flashing {
  animation: flashButton 1.5s ease-in-out infinite;
}

@keyframes flashButton {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.8), 0 0 30px rgba(102, 126, 234, 0.6);
    transform: scale(1.02);
  }
}

.analyzeButtonDescription {
  font-size: 0.85rem;
  color: #666;
  text-align: right;
  line-height: 1.4;
  margin: 0;
  max-width: 100%;
}

.inputSection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.inputGroup {
  display: flex;
  flex-direction: column;
}

.inputHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.inputHeader h2 {
  font-size: 1.3rem;
  color: #333;
}

.fileUploadLabel {
  padding: 0.5rem 1rem;
  background: #f5f5f5;
  border: 2px dashed #ccc;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.fileUploadLabel:hover {
  background: #e8e8e8;
  border-color: #667eea;
}

.fileUploadButton {
  padding: 0.5rem 1rem;
  background: #f5f5f5;
  border: 2px dashed #ccc;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  font-family: inherit;
  color: #333;
}

.fileUploadButton:hover {
  background: #e8e8e8;
  border-color: #667eea;
}

.fileUploadButton:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fileInput {
  display: none;
}

.textarea {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  resize: vertical;
  transition: border-color 0.2s;
}

.textarea:focus {
  outline: none;
  border-color: #667eea;
}

.fileInfo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f0f4ff;
  border: 2px solid #667eea;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.fileName {
  flex: 1;
  color: #333;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fileType {
  padding: 0.25rem 0.75rem;
  background: #667eea;
  color: white;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.clearButton {
  padding: 0.25rem 0.5rem;
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clearButton:hover {
  background: #cc0000;
}

.diffSection {
  margin-bottom: 2rem;
}

.sectionTitle {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 1rem;
}

/* Editor Wrapper - Responsive container for two editors */
.editorWrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  min-height: 500px;
}

/* Responsive: Stack editors vertically on narrow screens */
@media (max-width: 1024px) {
  .editorWrapper {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
  }
}

/* Individual editor pane */
.editorPane {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0; /* Important for grid items to shrink properly */
  overflow: hidden; /* Prevent content overflow */
}

.editorPaneHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #f5f5f5;
  border: 2px solid #e0e0e0;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}

.editorPaneHeader h3 {
  margin: 0;
  font-size: 1rem;
  color: #333;
  font-weight: 600;
}

.editorFileName {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

.editorContainer {
  border: 2px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  min-height: 500px;
  height: 500px;
  width: 100%;
}

/* Responsive: Increase editor height on narrow screens */
@media (max-width: 1024px) {
  .editorContainer {
    min-height: 400px;
    height: 400px;
  }
}

@media (max-width: 768px) {
  .editorContainer {
    min-height: 350px;
    height: 350px;
  }
}

/* Monaco Diff Highlighting Styles */
.monaco-diff-removed-line {
  background-color: rgba(255, 59, 48, 0.2) !important;
  border-left: 3px solid rgba(255, 59, 48, 0.8) !important;
}

.monaco-diff-added-line {
  background-color: rgba(52, 199, 89, 0.2) !important;
  border-left: 3px solid rgba(52, 199, 89, 0.8) !important;
}

.monaco-diff-modified-line {
  background-color: rgba(255, 149, 0, 0.2) !important;
  border-left: 3px solid rgba(255, 149, 0, 0.8) !important;
}

.monaco-diff-removed-glyph {
  background-color: rgba(255, 59, 48, 0.8) !important;
}

.monaco-diff-added-glyph {
  background-color: rgba(52, 199, 89, 0.8) !important;
}

.monaco-diff-modified-glyph {
  background-color: rgba(255, 149, 0, 0.8) !important;
}

.analysisSection {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e0e0e0;
}

.statsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.statCard {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.statValue {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.statLabel {
  font-size: 0.9rem;
  opacity: 0.9;
}

.keywordTables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.keywordTable {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 12px;
}

.keywordTable h3 {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 1rem;
}

.tableContainer {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.table thead {
  background: #667eea;
  color: white;
}

.table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
}

.table th:nth-child(3) {
  min-width: 200px;
}

.table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
}

.table tbody tr:hover {
  background: #f5f5f5;
}

.frequencyCell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 150px;
}

.frequencyValue {
  min-width: 60px;
  font-weight: 600;
  color: #667eea;
}

.frequencyBarContainer {
  flex: 1;
  height: 20px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  min-width: 80px;
}

.frequencyBar {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  transition: width 0.3s ease;
  min-width: 2px;
}

.changesSection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.changesBox {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
}

.changesBox h3 {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 1rem;
}

.keywordList {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.keywordTag {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: white;
  border: 1px solid #667eea;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #667eea;
  font-weight: 500;
}

.noKeywords {
  color: #999;
  font-style: italic;
}

.helpButton {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.helpButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.helpSection {
  background: #f9f9f9;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.helpContent h2 {
  font-size: 1.5rem;
  color: #333;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.helpContent h2:first-child {
  margin-top: 0;
}

.helpList {
  padding-left: 1.5rem;
  line-height: 1.8;
  color: #555;
}

.helpList li {
  margin-bottom: 0.75rem;
}

.helpList strong {
  color: #667eea;
}

.useCasesGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.useCaseCard {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
  transition: transform 0.2s, box-shadow 0.2s;
}

.useCaseCard:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.useCaseCard h3 {
  font-size: 1.2rem;
  color: #667eea;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.targetUsers {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
  line-height: 1.5;
}

.useCaseCard ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.useCaseCard li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: #555;
  line-height: 1.6;
}

.useCaseCard li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #667eea;
  font-weight: bold;
}

/* Flash Cards Section */
.flashCardSection {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e0e0e0;
}

.flashCardHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.flashCardControls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.flashCardNav {
  padding: 0.5rem 1rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.flashCardNav:hover:not(:disabled) {
  background: #5568d3;
}

.flashCardNav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.flashCardCounter {
  font-weight: 600;
  color: #333;
  min-width: 100px;
  text-align: center;
}

.flashCardContainer {
  margin: 2rem 0;
  min-height: 300px;
}

.flashCard {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.flashCardBadge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.badgeAdded {
  background: #e8f5e9;
  color: #2e7d32;
}

.badgeRemoved {
  background: #ffebee;
  color: #c62828;
}

.badgeModified {
  background: #fff3e0;
  color: #e65100;
}

.flashCardLineNumber {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.flashCardOld {
  background: #ffebee;
  border-left: 4px solid #f44336;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.flashCardOld strong {
  color: #c62828;
  display: block;
  margin-bottom: 0.5rem;
}

.flashCardOld pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.9rem;
}

.flashCardNew {
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.flashCardNew strong {
  color: #2e7d32;
  display: block;
  margin-bottom: 0.5rem;
}

.flashCardNew pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.9rem;
}

.flashCardContext {
  margin-top: 1rem;
  padding: 1rem;
  background: #f5f5f5;
  border-radius: 6px;
}

.flashCardContext summary {
  cursor: pointer;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 0.5rem;
}

.flashCardContext pre {
  margin: 0.5rem 0 0 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.85rem;
  color: #666;
}

.flashCardNote {
  margin: 0.25rem 0 0.75rem 0;
  font-size: 0.85rem;
  color: #555;
  font-style: italic;
}

.wordAdded {
  background: rgba(76, 175, 80, 0.25);
  border-radius: 3px;
  padding: 0 1px;
}

.wordRemoved {
  background: rgba(244, 67, 54, 0.25);
  border-radius: 3px;
  padding: 0 1px;
}

.flashCardActions {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.actionButtonWrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 250px;
}

.printButton,
.downloadButton {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}

.buttonDescription {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #666;
  text-align: center;
  line-height: 1.4;
  max-width: 300px;
}

.printButton {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.printButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.downloadButton {
  background: #4caf50;
  color: white;
}

.downloadButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.keywordActions {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e0e0e0;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .inputSection {
    grid-template-columns: 1fr;
  }

  .keywordTables {
    grid-template-columns: 1fr;
  }

  .title {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .subtitle {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .analyzeButtonGroup {
    margin-left: 0;
    max-width: 100%;
    align-items: stretch;
  }

  .analyzeButtonDescription {
    text-align: left;
  }

  .flashCardHeader {
    flex-direction: column;
    align-items: stretch;
  }

  .flashCardControls {
    justify-content: center;
  }
}

