/* Styles for the text comparison page */

/* Variables CSS */
:root {
  --primary-color: #48c78e;
  --primary-dark: #3a9e6b;
  --secondary-color: #3e8ed0;
  --accent-color: #ffdd57;
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --border-radius: 20px;
  --transition: all 0.2s ease-in-out;
  --added-color: rgb(232, 255, 232);
  --removed-color: rgb(255, 232, 232);
  --modified-color: rgb(255, 251, 224);
  --added-color-solid: #4ade80;
  --removed-color-solid: #f87171;
  --modified-color-solid: #facc15;
}

/* Container principal */
.compare-container {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  border-radius: var(--border-radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  transition: var(--transition);
  overflow: hidden;
  padding: 1.5rem;
}

.compare-container:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Actions buttons */
.action-buttons {
  margin-bottom: 2rem;
}

.action-buttons .button {
  margin: 0 0.5rem;
  transition: var(--transition);
}

.action-buttons .button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* Textarea container with line numbers */
.textarea-container {
  position: relative;
  display: flex;
  overflow: visible; /* Assure que le contenu débordant (comme le curseur) reste visible */
}

.line-numbers {
  font-family: monospace;
  color: #888;
  text-align: right;
  padding: 10px 10px 10px 0;
  background-color: #f5f5f5;
  border-radius: 6px 0 0 6px;
  user-select: none;
  overflow: hidden;
  min-width: 40px;
}

.textarea {
  width: 100%;
  line-height: 1.5;
  font-size: 14px;
  tab-size: 4;
  border-radius: 0 6px 6px 0 !important;
  resize: vertical;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  caret-color: #000; /* Assure que le curseur est visible */
  color: #363636; /* S'assure que le texte est bien visible */
  z-index: 5; /* S'assure que le textarea est au-dessus des autres éléments */
  position: relative; /* Aide avec le z-index */
}

/* Textarea buttons */
.textarea-buttons {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.textarea-buttons:hover {
  opacity: 1;
}

/* Options panel */
.options-panel {
  margin-bottom: 2rem;
}

.options-panel .box {
  border-radius: var(--border-radius);
  transition: var(--transition);
}

/* Results */
.result-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.result-stat-item {
  background: #f5f5f5;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-stat-item .icon {
  margin-right: 5px;
}

/* Diff visualization */
.diff-container {
  margin-top: 20px;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  font-family: monospace;
  line-height: 1.5;
  font-size: 14px;
}

.diff-line {
  display: flex;
  border-bottom: 1px solid #f0f0f0;
}

.diff-line:last-child {
  border-bottom: none;
}

.diff-line-number {
  width: 50px;
  text-align: right;
  padding: 0 10px;
  background-color: #f5f5f5;
  color: #888;
  border-right: 1px solid #ddd;
  user-select: none;
}

.diff-line-content {
  padding: 0 10px;
  white-space: pre;
  overflow-x: auto;
  flex-grow: 1;
}

/* Highlighting styles */
.diff-equal {
  background-color: transparent;
}

.diff-added {
  background-color: var(--added-color);
}

.diff-removed {
  background-color: var(--removed-color);
}

.diff-modified {
  background-color: var(--modified-color);
}

.diff-char-added {
  background-color: rgba(74, 222, 128, 0.4);
  text-decoration: none;
  padding: 0 1px;
  border-radius: 2px;
}

.diff-char-removed {
  background-color: rgba(248, 113, 113, 0.4);
  text-decoration: line-through;
  padding: 0 1px;
  border-radius: 2px;
}

/* Notification */
.notification {
  transition: all 0.3s;
  z-index: 1000;
}

.notification.is-hidden {
  display: none;
}

/* Chars counter */
.chars-count {
  font-size: 0.8rem;
  vertical-align: middle;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .action-buttons .button {
    margin: 0.5rem;
  }
  
  .columns {
    margin-left: 0;
    margin-right: 0;
  }
  
  .column {
    padding: 0.5rem;
  }
  
  .result-stats {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}
