/* ==========================================================================
   Design tokens - Linear-inspired
   Layered charcoal surfaces, one accent color, soft low-opacity borders,
   generous whitespace, refined typography, subtle motion. Every existing
   variable name, class, and ID selector below is preserved from the
   previous stylesheet - only the values change, so no HTML or JS behavior
   is affected.
   ========================================================================== */
:root {
  --primary: #6366f1;              /* single accent - indigo */
  --primary-light: #9192f5;        /* lighter tint of the same accent */
  --secondary: #818cf8;            /* same accent family, different weight */
  --secondary-light: #a5b4fc;
  --accent: #9192f5;
  --dark-bg: #0b0b0d;              /* page background - charcoal, not pure black */
  --content-bg: #141517;           /* card / surface elevation */
  --surface-2: #1c1d21;            /* secondary elevation (inputs, nested panels) */
  --light-text: #f4f4f5;           /* high-contrast primary text */
  --medium-text: #9a9ba3;          /* soft secondary text */
  --muted-text: #6b6c75;           /* tertiary / least prominent text */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-text: var(--light-text);
  --success: #3fb950;
  --error: #f0665f;
  --warning: #d9a441;
  --gradient: linear-gradient(135deg, var(--primary), #7d7ff6);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --card-radius: 14px;
  --button-radius: 8px;
  --table-header-bg: rgba(255, 255, 255, 0.03);
  --table-row-hover-bg: rgba(99, 102, 241, 0.06);
}

/* --- Light Mode --- */
.light-mode {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --secondary: #6366f1;
  --secondary-light: #818cf8;
  --accent: #6366f1;
  --dark-bg: #f7f7f8;
  --content-bg: #ffffff;
  --surface-2: #f4f4f5;
  --light-text: #18181b;
  --medium-text: #6b6c76;
  --muted-text: #9a9ba3;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --input-bg: #f4f4f5;
  --input-text: #27272a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 24px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --table-header-bg: rgba(0, 0, 0, 0.02);
  --table-row-hover-bg: rgba(79, 70, 229, 0.05);
}

/* --- Global Styles --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-family);
  background-color: var(--dark-bg);
  color: var(--light-text);
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.06) 0%, transparent 35%),
    radial-gradient(circle at 85% 90%, rgba(99, 102, 241, 0.04) 0%, transparent 35%);
  background-attachment: fixed;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 1600px; margin: 0 auto; padding: 2rem; }

/* --- Focus & selection (accessibility) --- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection { background: rgba(99, 102, 241, 0.35); color: var(--light-text); }

/* --- Custom scrollbars (refined, minimal) --- */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--medium-text); }

/* --- Header --- */
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); }
.logo { display: flex; align-items: center; gap: 0.9rem; }
.logo h1 { font-size: 1.35rem; font-weight: 600; color: var(--light-text); letter-spacing: -0.02em; }
.logo-icon { font-size: 1.5rem; color: var(--primary); }
.header-buttons { display: flex; gap: 0.75rem; align-items: center; }
.theme-toggle, .info-button {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--medium-text);
  padding: 0.55rem 1.1rem;
  border-radius: var(--button-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  box-shadow: none;
  text-decoration: none;
}
.theme-toggle:hover, .info-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--light-text);
  transform: translateY(-1px);
}
.theme-toggle i, .info-button i { color: var(--primary); }

/* --- Layout --- */
main { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.75rem; }
.main-content { grid-column: span 7; }
.sidebar { grid-column: span 5; }

/* --- Card --- */
.card {
  background: var(--content-bg);
  border-radius: var(--card-radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}
.card:hover { border-color: var(--border-strong); }
.card h2 { font-size: 1.05rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.7rem; font-weight: 600; color: var(--light-text); letter-spacing: -0.01em; }
.card h2 i { color: var(--primary); font-size: 1em; }

#batchGraphsCard {
  display: none;
}

/* --- Tabs --- */
.tabs { display: flex; margin-bottom: 1.75rem; border-bottom: 1px solid var(--border-color); gap: 0.25rem; }
.tab-button {
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--medium-text);
  font-weight: 500;
  font-size: 0.92rem;
  position: relative;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 6px 6px 0 0;
}
.tab-button:hover { color: var(--light-text); background: var(--surface-2); }
.tab-button.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }
.tab-content { display: none; animation: fadeIn 0.35s var(--ease); }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* --- Forms --- */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.55rem; font-weight: 500; color: var(--medium-text); font-size: 0.87rem; }
.input-group { display: flex; gap: 0.8rem; align-items: center; }
input[type="text"], input[type="password"], textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--button-radius);
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--input-text);
  font-family: var(--font-family);
  transition: var(--transition);
  font-size: 0.92rem;
}
textarea { resize: vertical; min-height: 80px; }
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
input[type="text"]::placeholder, input[type="password"]::placeholder, textarea::placeholder { color: var(--muted-text); }

/* --- File Input --- */
.file-input-wrapper {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--button-radius);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 1rem;
  background-color: var(--input-bg);
}
.file-input-wrapper:hover, .file-input-wrapper.active {
  border-color: var(--primary);
  background-color: rgba(99, 102, 241, 0.06);
}
.file-input-wrapper i { font-size: 1.75rem; color: var(--primary-light); margin-bottom: 0.7rem; display: block; }
.file-input-wrapper p { margin-bottom: 0.3rem; font-size: 0.88rem; color: var(--medium-text); }
.file-input-wrapper .file-info { font-size: 0.78rem; color: var(--muted-text); }
.file-display { display: flex; align-items: center; gap: 0.8rem; margin-top: 1rem; padding: 0.6rem 1rem; background: var(--input-bg); border: 1px solid var(--border-color); border-radius: var(--button-radius); font-size: 0.88rem; }
.file-display i { color: var(--success); }

/* --- Buttons --- */
button {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 0.8rem 1.6rem;
  border-radius: var(--button-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  position: relative;
}
button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35); }
button:active { transform: translateY(0) scale(0.98); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }
button.secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--medium-text);
  box-shadow: none;
  padding: 0.65rem 1.15rem;
}
button.secondary:hover { border-color: var(--border-strong); color: var(--light-text); background: var(--surface-2); transform: translateY(-1px); box-shadow: none; }
button.secondary:active { transform: translateY(0) scale(0.98); }
button.small { padding: 0.45rem 0.75rem; font-size: 0.78rem; gap: 0.35rem; }
button:disabled { background: var(--input-bg); color: var(--muted-text); cursor: not-allowed; box-shadow: none; opacity: 0.55; transform: none; }
.button-group { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* --- Previews & Metrics --- */
.preview-container { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1rem; }
.preview-box { border-radius: var(--card-radius); overflow: hidden; position: relative; box-shadow: var(--shadow-sm); aspect-ratio: 16/10; background: var(--surface-2); border: 1px solid var(--border-color); }
.preview-box img { width: 100%; height: 100%; object-fit: contain; transition: var(--transition); background-color: var(--surface-2); }
.preview-box .label { position: absolute; bottom: 0; left: 0; right: 0; padding: 0.55rem; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); color: white; font-size: 0.82rem; text-align: center; font-weight: 500; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.9rem; margin-top: 1rem; }
.metric-card { background: var(--surface-2); border-radius: var(--button-radius); padding: 1rem; text-align: center; border: 1px solid var(--border-color); transition: var(--transition); }
.metric-card:hover { border-color: var(--border-strong); }
.metric-value { font-size: 1.5rem; font-weight: 700; margin: 0.3rem 0 0.5rem 0; color: var(--primary); letter-spacing: -0.02em; }
.metric-title { font-size: 0.75rem; color: var(--medium-text); text-transform: uppercase; letter-spacing: 0.04em; display: flex; align-items: center; justify-content: center; gap: 0.3rem; }
.metric-title .tooltip { color: var(--primary-light); }
.metric-bar { height: 4px; background: var(--border-color); border-radius: 3px; margin-top: 0.8rem; overflow: hidden; }
.metric-progress { height: 100%; background: var(--primary); border-radius: 3px; width: 0%; transition: width 0.6s var(--ease); }

/* --- Settings --- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2rem; margin-top: 1rem; }
.toggle-group { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; font-size: 0.88rem; color: var(--medium-text); }
.toggle-group span { display: flex; align-items: center; gap: 0.5rem; }
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--input-bg); border: 1px solid var(--border-color); transition: 0.25s var(--ease); border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: var(--medium-text); transition: 0.25s var(--ease); border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); border-color: var(--primary); }
input:checked + .slider:before { transform: translateX(18px); background-color: white; }

/* --- Log & Tooltip --- */
.log-container { margin-top: 1rem; max-height: 250px; overflow-y: auto; border-radius: var(--button-radius); background: var(--surface-2); border: 1px solid var(--border-color); padding: 1rem; font-family: 'Fira Code', 'SF Mono', Consolas, monospace; font-size: 0.82rem; line-height: 1.6; }
.log-entry { margin-bottom: 0.5rem; word-break: break-word; animation: fadeIn 0.25s var(--ease); }
.log-time { color: var(--muted-text); margin-right: 0.5rem; }
.log-info { color: var(--secondary-light); }
.log-error { color: var(--error); font-weight: 500; }
.log-success { color: var(--success); }
.log-warning { color: var(--warning); }
.tooltip { position: relative; display: inline-flex; align-items: center; cursor: help; color: var(--primary-light); }
.tooltip .tooltip-text {
  visibility: hidden;
  width: 220px;
  background-color: var(--surface-2);
  color: var(--light-text);
  text-align: left;
  border-radius: var(--button-radius);
  padding: 10px 12px;
  position: absolute;
  z-index: 10;
  bottom: 135%;
  left: 50%;
  margin-left: -110px;
  opacity: 0;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  font-size: 0.82rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-strong);
  transform: translateY(6px);
  pointer-events: none;
  line-height: 1.4;
}
.tooltip:hover .tooltip-text { visibility: visible; opacity: 1; transform: translateY(0); }

/* --- Progress & Notification --- */
.progress-container { margin-top: 1.5rem; }
.progress-bar { height: 6px; background: var(--input-bg); border-radius: 4px; overflow: hidden; margin-bottom: 0.5rem; border: 1px solid var(--border-color); }
.progress { height: 100%; background: var(--primary); width: 0%; border-radius: 4px; transition: width 0.4s var(--ease); position: relative; overflow: hidden; }
.progress::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmerSweep 1.6s linear infinite;
}
.progress-text { font-size: 0.78rem; text-align: right; color: var(--medium-text); }
.notification {
  position: fixed;
  bottom: 25px; right: 25px;
  padding: 0.95rem 1.4rem;
  border-radius: var(--button-radius);
  color: white;
  box-shadow: var(--shadow);
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  transition: all 0.4s var(--ease);
  display: flex; align-items: center; gap: 0.8rem;
  z-index: 1000; max-width: 400px; font-size: 0.9rem;
  border: 1px solid rgba(255,255,255,0.08);
}
.notification.success { background: var(--success); }
.notification.error { background: var(--error); }
.notification.warning { background: var(--warning); color: #2a2200; }
.notification.info { background: var(--primary); }
.notification.show { transform: translateX(0); opacity: 1; }
.notification i { font-size: 1.1rem; }

/* --- Modal --- */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px); z-index: 1000; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.25s var(--ease); }
.modal.show { display: flex; opacity: 1; }
.modal-content {
  background: var(--content-bg);
  border-radius: var(--card-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: calc(100vw - 2rem);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(6px);
  transition: transform 0.28s var(--ease);
}
.modal.show .modal-content { transform: scale(1) translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.modal-header h2 { margin-bottom: 0; font-size: 1.1rem; }
.close-modal { background: transparent; border: none; font-size: 1.7rem; cursor: pointer; color: var(--medium-text); transition: var(--transition); line-height: 1; }
.close-modal:hover { color: var(--light-text); transform: rotate(90deg); }
.directory-path { padding: 0.7rem 1rem; background: var(--surface-2); border-radius: var(--button-radius); font-family: 'Fira Code', monospace; margin-bottom: 1rem; color: var(--medium-text); font-size: 0.83rem; border: 1px solid var(--border-color); word-break: break-all; }
.directory-list { list-style: none; margin-bottom: 1.5rem; flex-grow: 1; overflow-y: auto; padding-right: 5px; }
.directory-item { padding: 0.65rem 1rem; border-radius: var(--button-radius); margin-bottom: 0.4rem; cursor: pointer; display: flex; align-items: center; gap: 0.8rem; transition: var(--transition); font-size: 0.92rem; }
.directory-item:hover { background: var(--surface-2); color: var(--light-text); }
.directory-item i { color: var(--primary); width: 1.2em; text-align: center; }
.modal-footer { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 1rem; }

/* --- Key Display --- */
.key-display-container { margin-top: 1rem; }
.key-display-wrapper { position: relative; }
.key-display { padding-right: 40px; font-family: 'Fira Code', monospace; }
.key-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
#toggleKeyVisibility { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: var(--medium-text); cursor: pointer; padding: 5px; font-size: 0.95rem; box-shadow: none; }
#toggleKeyVisibility:hover { color: var(--light-text); transform: translateY(-50%); }
.textarea-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; justify-content: flex-end; }

/* --- Info Callout --- */
.info-callout { background: rgba(99, 102, 241, 0.08); border-left: 3px solid var(--primary); padding: 0.8rem 1.2rem; margin: 1rem 0; border-radius: 0 var(--button-radius) var(--button-radius) 0; font-size: 0.87rem; color: var(--medium-text); }
.info-callout i { margin-right: 0.5rem; color: var(--primary); }

/* --- Batch Processing --- */
.batch-section { margin-top: 2rem; border-top: 1px solid var(--border-color); padding-top: 2rem; }
.batch-section h3 { font-size: 1rem; color: var(--light-text); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.batch-section h3 i { color: var(--primary); }
.file-list-container { max-height: 180px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: var(--button-radius); padding: 0.8rem; margin-bottom: 1rem; background: var(--surface-2); }
ul#batchCoverFileList, ul#batchStegoFileList { list-style: none; padding: 0; margin: 0; }
ul#batchCoverFileList li, ul#batchStegoFileList li { padding: 0.45rem 0.65rem; margin-bottom: 0.3rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.83rem; color: var(--medium-text); background-color: var(--input-bg); border-radius: 6px; }
ul#batchCoverFileList li span, ul#batchStegoFileList li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80%; }
ul#batchCoverFileList button.remove-file, ul#batchStegoFileList button.remove-file { background: transparent; border: none; color: var(--error); cursor: pointer; padding: 0.2rem 0.4rem; font-size: 0.78rem; box-shadow: none; }
ul#batchCoverFileList button.remove-file:hover, ul#batchStegoFileList button.remove-file:hover { color: #ff8a85; transform: none; }

/* --- Responsive Tables --- */
.batch-results-container {
  margin-top: 1.5rem;
  max-height: 400px;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--button-radius);
  -webkit-overflow-scrolling: touch;
}
.batch-results-table { width: 100%; border-collapse: collapse; min-width: 1200px; }
.batch-results-table th, .batch-results-table td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 0.83rem; }
.batch-results-table th { background-color: var(--table-header-bg); font-weight: 600; color: var(--medium-text); white-space: nowrap; position: sticky; top: 0; z-index: 1; backdrop-filter: blur(6px); }
.batch-results-table tbody tr { transition: background-color 0.15s var(--ease); }
.batch-results-table tbody tr:hover { background-color: var(--table-row-hover-bg); }
.status-success { color: var(--success); font-weight: 500; }
.status-error { color: var(--error); font-weight: 500; }
.batch-results-table td { word-break: break-word; }
.batch-results-table .message-preview { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; cursor: help; }
.batch-progress-container { margin-top: 1rem; }
#batchProgressText { font-size: 0.88rem; text-align: center; color: var(--medium-text); margin-top: 0.5rem; }

/* --- Graph Display (Slider) --- */
.batch-graphs-content { padding: 1rem 0; }
.graph-slider-container {
  position: relative;
  width: 100%;
  margin: 1rem auto 0;
  background: var(--surface-2);
  border-radius: var(--button-radius);
  box-shadow: none;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}
.graph-slider-wrapper { display: flex; transition: transform 0.5s var(--ease); width: 100%; height: 100%; }
.graph-slider-slide { flex: 0 0 100%; width: 100%; height: 100%; box-sizing: border-box; padding: 1rem; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.graph-slider-slide h4 { margin: 0 0 0.8rem 0; color: var(--medium-text); font-size: 0.88rem; font-weight: 600; text-align: center; }
.graph-image-wrapper { position: relative; width: 100%; flex-grow: 1; display: flex; justify-content: center; align-items: center; background-color: rgba(255,255,255,0.02); border-radius: 6px; aspect-ratio: 16 / 10; margin-bottom: 0.5rem; }
.performance-graph { display: block; max-width: 100%; max-height: 100%; height: auto; border-radius: 6px; transition: opacity 0.4s var(--ease); opacity: 0; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.performance-graph.loaded { opacity: 1; cursor: zoom-in; }

.fullscreen-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.85); z-index: 2000; justify-content: center; align-items: center; padding: 20px; opacity: 0; transition: opacity 0.25s var(--ease); cursor: zoom-out; }
.fullscreen-modal.show { display: flex; opacity: 1; }
#fullscreenGraphImage { display: block; max-width: 95vw; max-height: 95vh; object-fit: contain; box-shadow: 0 0 40px rgba(0, 0, 0, 0.5); cursor: default; }

.close-fullscreen-button { position: absolute; top: 20px; right: 30px; font-size: 2.2rem; font-weight: 300; color: rgba(255, 255, 255, 0.8); background: none; border: none; cursor: pointer; padding: 0 10px; line-height: 1; box-shadow: none; transition: color 0.2s var(--ease); }
.close-fullscreen-button:hover { color: white; transform: none; }

.graph-loading, .graph-error { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--medium-text); text-align: center; padding: 1rem; font-size: 0.88rem; z-index: 1; }
.graph-error i { color: var(--error); margin-right: 0.5rem; }
.graph-loading i { margin-right: 0.5rem; animation: spin 1.2s linear infinite; }
.initial-loading-graphs {
  color: var(--medium-text); font-size: 0.95rem;
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; padding: 2rem 1rem;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmerSweep 1.8s linear infinite;
  justify-content: center;
  border-radius: 6px;
}
.initial-loading-graphs i { animation: spin 1.2s linear infinite; }

.slider-button {
  position: absolute; top: 50%; transform: translateY(-50%);
  background-color: var(--surface-2);
  color: var(--light-text);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.7rem;
  border-radius: 50%; cursor: pointer;
  z-index: 10; font-size: 0.95rem;
  transition: var(--transition);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: none;
}
.slider-button:hover { background-color: var(--primary); color: white; border-color: var(--primary); transform: translateY(-50%) scale(1.05); }
.slider-button.prev { left: 10px; }
.slider-button.next { right: 10px; }
.slider-button:disabled { opacity: 0.35; cursor: not-allowed; background-color: var(--surface-2); color: var(--muted-text); transform: translateY(-50%); }

.slider-pagination { text-align: center; margin-top: 0.5rem; position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 10; background: rgba(0,0,0,0.35); backdrop-filter: blur(4px); padding: 4px 8px; border-radius: 20px; }
.slider-dot { display: inline-block; width: 6px; height: 6px; background-color: var(--medium-text); opacity: 0.6; border-radius: 50%; margin: 0 4px; cursor: pointer; transition: var(--transition); }
.slider-dot.active { background-color: var(--primary); opacity: 1; width: 16px; border-radius: 3px; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  main { grid-template-columns: 1fr; }
  .main-content, .sidebar { grid-column: span 1; }
}

@media (max-width: 768px) {
  .container { padding: 1rem; }
  header { flex-wrap: wrap; justify-content: center; gap: 1rem; }
  .logo h1 { font-size: 1.2rem; }
  .preview-container { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .modal-content { width: 95%; padding: 1.5rem; }
  button { padding: 0.75rem 1.4rem; }
  button.secondary { padding: 0.55rem 1rem; }
  .graph-slider-container { min-height: auto; }
  .graph-image-wrapper { min-height: auto; }
  .performance-graph { max-height: 250px; }
  .card { padding: 1.4rem; }
  .card h2 { font-size: 1rem; }
  .tab-button { padding: 0.65rem 0.9rem; font-size: 0.85rem; }
}

/* --- Animations --- */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes shimmerSweep { 0% { background-position: -100% 0; } 100% { background-position: 100% 0; } }
.loading { animation: spin 1s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

#batchHideResultsBody td:first-child,
#batchExtractResultsBody td:first-child {
  word-break: break-all;
  max-width: 200px;
}

.message-preview {
  cursor: help;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 120px;
}
