/* DiffKop - Custom Premium Styling Sheet */

:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  /* Color Palette - Elegant Charcoal Theme with Teal/Emerald highlights */
  --bg-deep: #050806;
  --bg-card: rgba(8, 18, 14, 0.6);
  --bg-card-hover: rgba(12, 26, 20, 0.75);
  --border-glass: rgba(255, 255, 255, 0.05);
  --border-glass-focused: rgba(16, 185, 129, 0.4);
  
  --primary-start: #10b981; /* Emerald */
  --primary-end: #059669;   /* Deep Emerald */
  --accent: #14b8a6;        /* Teal */
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  /* Diff Highlights Colors */
  --diff-add-bg: rgba(16, 185, 129, 0.12);
  --diff-add-text: #a7f3d0;
  --diff-add-char: rgba(16, 185, 129, 0.35);
  
  --diff-del-bg: rgba(239, 68, 68, 0.12);
  --diff-del-text: #fca5a5;
  --diff-del-char: rgba(239, 68, 68, 0.35);
  
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.15);
  --shadow-glow-large: 0 0 50px rgba(16, 185, 129, 0.25);
  --shadow-card: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Background Blobs */
.glass-bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(125px);
  opacity: 0.16;
  mix-blend-mode: screen;
  animation: float-around 22s infinite alternate ease-in-out;
}

.blob-1 {
  width: 550px;
  height: 550px;
  background: var(--primary-start);
  top: -10%;
  left: 10%;
  animation-duration: 18s;
}

.blob-2 {
  width: 480px;
  height: 480px;
  background: var(--accent);
  bottom: -5%;
  right: 15%;
  animation-duration: 25s;
}

.blob-3 {
  width: 380px;
  height: 380px;
  background: #3b82f6; /* Soft Blue */
  top: 35%;
  left: 45%;
  animation-duration: 20s;
}

@keyframes float-around {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.08); }
  100% { transform: translate(40px, -30px) scale(0.92); }
}

/* App Container */
.app-container {
  max-width: 1100px; /* Wider to handle code grids */
  width: 100%;
  margin: 0 auto;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: space-between;
}

/* Header */
.app-header {
  margin-bottom: 25px;
  text-align: center;
}

.logo-area {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #fff;
  box-shadow: var(--shadow-glow);
  transition: var(--transition-normal);
}

.animate-sway {
  animation: sway 6s infinite ease-in-out;
}

@keyframes sway {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  50% { transform: rotate(3deg) scale(1.04); }
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
}

.gradient-text {
  background: linear-gradient(135deg, #e0f2fe 0%, #a7f3d0 30%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.tagline {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 3px;
  font-weight: 400;
}

/* Privacy Banner */
.privacy-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(16, 185, 129, 0.03);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.privacy-icon {
  font-size: 20px;
  color: var(--primary-start);
  flex-shrink: 0;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.privacy-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: left;
}

.privacy-text strong {
  color: var(--text-primary);
}

/* General Glass Cards */
.card {
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

/* Split Pane Layout Grid */
.main-card-layout {
  display: none;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  width: 100%;
}

.main-card-layout.active {
  display: grid;
}

.panel-editor, .panel-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 520px;
}

.panel-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Side-by-side Code Textareas */
.inputs-grid-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex-grow: 1;
}

.inputs-grid-compare textarea {
  height: 100%;
  min-height: 100px;
}

textarea {
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 14px;
  color: #e2e8f0;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12.5px;
  line-height: 1.5;
  resize: none;
  width: 100%;
  outline: none;
  transition: var(--transition-fast);
}

textarea:focus {
  border-color: var(--border-glass-focused);
  background-color: rgba(0, 0, 0, 0.35);
}

/* Settings Options row */
.editor-settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.editor-settings-row .form-group {
  margin-bottom: 0;
  flex-grow: 1;
  max-width: 250px;
}

/* Select Form */
.form-select {
  background-color: #0a120e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  height: 38px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 0 10px;
  outline: none;
  cursor: pointer;
}

.form-select option {
  background-color: #0a120e;
  color: var(--text-primary);
}

/* Buttons */
.panel-buttons {
  display: flex;
  gap: 12px;
}

.btn-action-text {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition-fast);
}

.btn-action-text:hover {
  color: var(--primary-start);
}

.btn-action-text.text-error:hover {
  color: var(--error);
}

.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1bd296, #048b61);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

/* ==========================================
   Code Comparison Result Grid Rendering
   ========================================== */
.diff-output-container {
  width: 100%;
  flex-grow: 1;
  background-color: #040806;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  overflow-y: auto;
  position: relative;
  min-height: 250px;
}

.diff-output-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.diff-output-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.diff-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  color: var(--text-secondary);
}

.diff-placeholder i {
  font-size: 38px;
  color: var(--text-muted);
}

.diff-placeholder p {
  font-size: 13px;
  max-width: 250px;
  line-height: 1.5;
}

/* Split Diff Table Layout */
.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.diff-table td {
  padding: 2px 10px;
  vertical-align: top;
}

.line-num-col {
  width: 44px;
  color: var(--text-muted);
  text-align: right;
  border-right: 1px solid rgba(255,255,255,0.03);
  user-select: none;
  background: rgba(255,255,255,0.01);
}

.line-content-col {
  word-wrap: break-word;
}

/* Added rows colors */
.row-added {
  background-color: var(--diff-add-bg);
  color: var(--diff-add-text);
}
.row-added .line-num-col {
  color: rgba(16, 185, 129, 0.5);
  background-color: rgba(16, 185, 129, 0.02);
}

.row-added .char-added {
  background-color: var(--diff-add-char);
  border-radius: 2px;
}

/* Deleted rows colors */
.row-deleted {
  background-color: var(--diff-del-bg);
  color: var(--diff-del-text);
}
.row-deleted .line-num-col {
  color: rgba(239, 68, 68, 0.5);
  background-color: rgba(239, 68, 68, 0.02);
}

.row-deleted .char-deleted {
  background-color: var(--diff-del-char);
  border-radius: 2px;
  text-decoration: line-through;
}

/* Unified View block lines list */
.unified-line {
  display: flex;
  width: 100%;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  line-height: 1.6;
  border-bottom: 1px solid rgba(255,255,255,0.01);
}

.unified-num-col {
  width: 40px;
  color: var(--text-muted);
  text-align: right;
  padding-right: 10px;
  user-select: none;
  border-right: 1px solid rgba(255,255,255,0.02);
  background: rgba(255,255,255,0.01);
}

.unified-content-col {
  padding-left: 10px;
  flex-grow: 1;
}

.unified-line.added {
  background-color: var(--diff-add-bg);
  color: var(--diff-add-text);
}
.unified-line.added .char-added {
  background-color: var(--diff-add-char);
}

.unified-line.deleted {
  background-color: var(--diff-del-bg);
  color: var(--diff-del-text);
}
.unified-line.deleted .char-deleted {
  background-color: var(--diff-del-char);
  text-decoration: line-through;
}

/* Footer info */
.app-footer {
  text-align: center;
  margin-top: 25px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.app-footer p {
  color: var(--text-muted);
  font-size: 11.5px;
}

/* Responsive Explorer Layout */
@media (max-width: 900px) {
  .main-card-layout {
    grid-template-columns: 1fr;
  }
  .inputs-grid-compare {
    grid-template-columns: 1fr;
  }
  .panel-editor, .panel-results {
    height: auto;
  }
  .diff-output-container {
    height: 380px;
  }
  .app-container {
    padding: 20px 10px;
  }
}
