/**
 * CIDER (Clinical Data Extractor) styles.
 * Styles for the CIDER page: layout, variable selector, PDF upload, extraction table,
 * settings drawer, FAQ dropdown, and related UI components.
 */

.cider-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    display: flex;
    gap: 20px;
}
.cider-sidebar {
    width: 350px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    overflow-y: auto;
    margin-top: 60px;
    max-height: fit-content;
}
.schema-selector {
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
}
@media (max-width: 1200px) {
    .cider-container {
        flex-direction: column;
    }
    .cider-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
    }
}
button {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.95em;
    margin-right: 8px;
    margin-top: 10px;
}
button:disabled {
    background: #aaa;
    cursor: not-allowed;
}
.refresh-top-right {
    position: absolute;
    top: 0;
    right: 0;
}
.cider-main-content {
    flex: 1;
    min-width: 0;
    position: relative;
}

.results {
    margin-top: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

.pdf-upload-container {
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    background: #f9fafd;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    margin-top: 0;
}

.pdf-upload-container:hover {
    background: #eef6ff;
    border-color: #0056b3;
}

.pdf-upload-container p {
    margin: 0;
    color: #555;
    font-size: 1em;
    font-weight: 500;
}

#selected-pdfs {
    margin-top: 12px;
    text-align: left;
    font-size: 0.9em;
    color: #333;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    display: none;
}

#language-support-img {
    display: block;
    margin: 16px auto;
    max-width: 40%;
    border-radius: 8px;
    height: auto;
}

#language-support-caption {
    margin-top: 8px;
    text-align: center;
    font-size: 0.95em;
    color: #444;
    font-weight: 500;
}

.schema-selector {
    margin-top: 15px;
    padding: 0;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.schema-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.columns-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    min-height: 50px;
}

.columns-box {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: white;
    min-height: 50px;
    overflow: visible;
}

.columns-box-content {
    overflow: visible;
}

.columns-box.unselected {
    border-color: #6c757d;
    background: #f8f9fa;
}

.columns-box.selected {
    border-color: #28a745;
    background: #f0fff4;
}

.columns-box-header {
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 10px;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tag-filter {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-filter select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85em;
    background: white;
    cursor: pointer;
    height: auto;
    line-height: 1.2;
}

.columns-box-content {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
    position: relative;
}

.column-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
    font-size: 0.9em;
    position: relative;
    text-align: center;
}

.column-box:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.column-box.selected {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.column-box.preset {
    border-color: #6c757d;
    border-style: solid;
    background: #e9ecef !important;
    position: relative;
}

.column-box.preset:hover {
    background: #d6d9dc !important;
}

.column-box.preset.selected {
    background: #c8ccd1 !important;
    border-color: #28a745;
}

.column-box.user {
    border-color: #007bff;
    border-style: solid;
}

.column-box.sample-id {
    border-color: #28a745;
    background: #c8ccd1;
    color: #155724;
    cursor: default;
    opacity: 0.9;
}

.column-box.sample-id:hover {
    border-color: #28a745;
    background: #d4edda;
}

/* Schema resizable area: same background as selector, no extra white box */
.schema-resizable {
  position: relative;
  min-height: 140px;
  height: 200px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: transparent;
  padding: 12px 12px 10px 12px;
}
.schema-resizable .schema-header {
  flex-shrink: 0;
  padding: 0 0 10px 0;
  margin-bottom: 0;
  color: #333;
  border: none;
  background: transparent;
}
.schema-resizable .schema-header label { font-weight: 600; color: #212529; }
.schema-resizable .schema-layout-wrapper {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  border-bottom: 1px solid #ced4da;
  padding-bottom: 0;
  box-sizing: border-box;
}

/* Full bottom edge resize strip – below content so bottom border stays visible */
.schema-resize-handle {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 10px;
  cursor: ns-resize;
  z-index: 10;
  flex-shrink: 0;
  margin: 0 -12px 0 -12px;
  background: linear-gradient(to top, #dee2e6 0%, #e9ecef 100%);
  border-radius: 0 0 8px 8px;
}
.schema-resize-handle::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 4px;
  background: repeating-linear-gradient(90deg, #adb5bd 0, #adb5bd 4px, transparent 4px, transparent 8px);
  border-radius: 2px;
  pointer-events: none;
}
.schema-resize-handle:hover { background: linear-gradient(to top, #ced4da 0%, #dee2e6 100%); }
.schema-resize-handle:active { background: #adb5bd; }

/* Stacked layout: two panels with horizontal splitter */
.schema-stacked-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.schema-stacked-panel {
  flex: 1;
  min-height: 80px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.schema-stacked-panel .columns-box {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.schema-stacked-panel .columns-box-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
/* Stacked layout: both panels – content keeps natural height, not fitted to box; scroll if needed */
.schema-stacked-panel.schema-stacked-available .columns-box-content,
.schema-stacked-panel.schema-stacked-selected .columns-box-content {
  align-content: flex-start;
  align-items: flex-start;
  min-height: 0;
}

.schema-splitter {
  flex-shrink: 0;
  background: #dee2e6;
  z-index: 5;
  transition: background 0.15s;
}
.schema-splitter:hover { background: #007bff; }
.schema-splitter-h {
  height: 8px;
  cursor: row-resize;
  min-height: 8px;
}
/* Side-by-side layout: two panels explicitly in a row, no splitter between them */
.schema-layout-new.schema-layout-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.schema-layout-new-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  margin-top: 12px;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  align-items: stretch;
}
.schema-new-available-panel,
.schema-new-selected-panel {
  min-width: 120px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex-shrink: 0;
}
.schema-new-available-panel { flex: 0 0 250px; }
.schema-new-selected-panel { flex: 1 1 0; min-width: 0; }
.schema-layout-new .available-tree-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  min-height: 0;
}

.schema-layout-wrapper { margin-top: 0; }
.tree-disease, .tree-project { margin-bottom: 4px; display: block; }
.tree-disease-header, .tree-project-header {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85em;
  color: #555;
  padding: 4px 8px;
  border-radius: 4px;
  user-select: none;
}
.tree-disease-header:hover, .tree-project-header:hover { background: #e9ecef; }
.tree-toggle { font-size: 0.7em; transition: transform 0.2s; flex-shrink: 0; }
.tree-toggle.collapsed { transform: rotate(-90deg); }
.tree-children { margin-left: 12px; margin-top: 4px; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 4px; }
.tree-disease.collapsed .tree-children, .tree-project.collapsed .tree-children { display: none; }
.tree-variable { display: block; margin: 0 0 4px 0; }
.tree-variable .column-box { width: 100%; box-sizing: border-box; }
.tree-add-all { margin-left: auto; padding: 2px 6px; font-size: 0.7em; cursor: pointer; border-radius: 4px; border: 1px solid #6c757d; background: #6c757d; color: white; white-space: nowrap; flex-shrink: 0; align-self: center; }
.tree-add-all:hover { background: #5a6268; }

.columns-section {
    margin-bottom: 15px;
}

.columns-section-title {
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-indicator {
    margin-top: 15px;
    padding: 12px;
    background: #e9ecef;
    border-radius: 6px;
    font-size: 0.9em;
    display: none;
}

.progress-item {
    margin: 4px 0;
    padding: 6px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.progress-item.error {
    border-left-color: #dc3545;
    color: #dc3545;
}

.progress-item.complete {
    border-left-color: #28a745;
    color: #28a745;
}

.column-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 10px 14px;
    background: #333;
    color: white;
    border-radius: 6px;
    font-size: 0.85em;
    white-space: normal;
    max-width: 400px;
    min-width: 200px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10000;
    word-wrap: break-word;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.column-tooltip.column-tooltip-visible {
    opacity: 1;
    visibility: visible;
}

.column-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}


.table-output {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
}

.table-output th, .table-output td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    vertical-align: middle;
}

.table-output th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.table-output tr:nth-child(even) {
    background-color: #f9f9f9;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #007bff;
}

.no-data {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.faq-dropdown {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.faq-header {
    padding: 12px 16px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: background 0.2s;
    border-bottom: 1px solid #ddd;
}

.faq-header:hover {
    background: #e9ecef;
}

.faq-header.active {
    border-bottom: none;
}

.faq-title {
    font-weight: 600;
    font-size: 0.95em;
    color: #333;
}

.faq-icon {
    font-size: 1.2em;
    color: #666;
    transition: transform 0.3s;
}

.faq-header.active .faq-icon {
    transform: rotate(180deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 16px;
}

.faq-content.active {
    max-height: 1000px;
    padding: 16px;
    border-top: 1px solid #ddd;
}

.faq-content p {
    margin: 0 0 12px 0;
    color: #555;
    line-height: 1.6;
    font-size: 0.9em;
}

.faq-content p:last-child {
    margin-bottom: 0;
}

.faq-content ul {
    margin: 12px 0;
    padding-left: 20px;
    color: #555;
    line-height: 1.6;
    font-size: 0.9em;
}

.faq-content li {
    margin-bottom: 8px;
}

/* Settings drawer (left side) */
.settings-gear {
    position: fixed;
    top: 90px;
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #6c757d;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    user-select: none;
    transition: opacity 0.2s ease-in-out;
}
.settings-gear:hover { background: #5a6268; }
.settings-gear.hidden { opacity: 0; pointer-events: none; }

.settings-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #ddd;
    box-shadow: 2px 0 8px rgba(0,0,0,0.08);
    transform: translateX(-100%);
    transition: transform 0.2s ease-in-out;
    z-index: 1000;
    padding: 16px;
    padding-right: 24px;
    overflow-y: auto;
}
.settings-drawer.open { transform: translateX(0); }
.settings-drawer h3 { margin-top: 0; }
.settings-grid {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px 10px;
    align-items: center;
}
.settings-grid label { font-weight: 600; }
.settings-grid input[type="number"], .settings-grid textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* Info icon styling */
.info-icon {
    color: #6c757d;
    cursor: help;
    font-size: 0.9em;
    margin-left: 4px;
    display: inline-block;
    transition: color 0.2s ease;
    position: relative;
}
.info-icon:hover {
    color: #007bff;
}

/* Custom tooltip */
.info-icon::after {
    content: attr(data-tooltip);
    position: fixed;
    bottom: var(--tooltip-bottom, auto);
    top: var(--tooltip-top, auto);
    left: var(--tooltip-left, 50%);
    right: var(--tooltip-right, auto);
    transform: var(--tooltip-transform, translateX(-50%));
    background: #333;
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.85em;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10000;
    width: 300px;
    white-space: pre-line;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    word-wrap: break-word;
}
.info-icon::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}
.info-icon:hover::after,
.info-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Tooltips inside settings drawer: keep within drawer so they don’t get truncated */
.settings-drawer .info-icon::after {
    left: auto;
    right: 0;
    transform: none;
    max-width: min(300px, calc(100% - 24px));
    width: max-content;
    text-align: left;
}
.settings-drawer .info-icon::before {
    left: auto;
    right: 8px;
    transform: none;
}

.settings-row { grid-column: 1 / -1; }
.temp-row { display: grid; grid-template-columns: 1fr 90px; gap: 8px; align-items: center; }
.settings-help { color: #666; font-size: 0.85em; }

.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 999;
    display: none;
}
.settings-overlay.show { display: block; }

.drawer-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-secondary { background: #6c757d; }
.btn-danger { background: #dc3545; }

/* Report modal */
.report-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.report-modal {
    background: white;
    border-radius: 12px;
    max-width: 840px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.report-modal-header h2 { margin: 0; font-size: 1.25em; }
.report-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5em;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0 6px;
    margin: 0;
}
.report-modal-close:hover { color: #333; }
.report-modal-content {
    overflow-y: auto;
    padding: 20px;
    flex: 1;
}
.report-loading { padding: 24px; text-align: center; color: #666; }
.report-section { margin-bottom: 20px; }
.report-section h3 { margin: 0 0 8px 0; font-size: 1em; color: #444; }
.report-methods {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.95em;
    line-height: 1.5;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}
.report-analysis-date {
    font-size: 0.9em;
    color: #666;
    margin: 8px 0;
    font-style: italic;
}
.report-parameters-wrap { overflow-x: auto; margin-bottom: 8px; }
.report-params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
.report-params-table th,
.report-params-table td { border: 1px solid #ddd; padding: 8px 10px; text-align: left; }
.report-params-table th { background: #f0f0f0; }
.report-reference { padding: 8px 0; font-style: italic; }
.report-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn-report-action { margin: 0; }

/* Tutorial Styles */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tutorial-modal {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 20px;
    max-width: min(450px, calc(100vw - 40px));
    min-width: min(350px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 10001;
    animation: slideIn 0.3s ease-out;
    transform-origin: center;
    box-sizing: border-box;
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tutorial-modal-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
}

.tutorial-modal-top,
.tutorial-modal-bottom {
    transform: translateX(-50%);
}

.tutorial-modal-left,
.tutorial-modal-right {
    transform: translateY(-50%);
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    flex-shrink: 0;
}

.tutorial-drag-handle {
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.tutorial-drag-handle:active {
    cursor: grabbing;
}

.tutorial-header h3 {
    margin: 0;
    color: #007bff;
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutorial-header h3::before {
    content: "⋮⋮";
    color: #ccc;
    font-size: 1.2em;
    letter-spacing: -2px;
    opacity: 0.6;
}

.tutorial-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.tutorial-close:hover {
    background: #f0f0f0;
    color: #333;
}

.tutorial-content {
    margin-bottom: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

.tutorial-content p {
    margin: 0;
    color: #444;
    font-size: 1em;
    line-height: 1.6;
}

/* Custom scrollbar for tutorial content */
.tutorial-content::-webkit-scrollbar {
    width: 6px;
}

.tutorial-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.tutorial-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.tutorial-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.tutorial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    margin-top: auto;
}

.tutorial-progress {
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
}

.tutorial-buttons {
    display: flex;
    gap: 8px;
}

.tutorial-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
}

.tutorial-btn-primary {
    background: #007bff;
    color: white;
}

.tutorial-btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.tutorial-btn-secondary {
    background: #6c757d;
    color: white;
}

.tutorial-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.tutorial-highlight {
    position: absolute;
    border: 3px solid #007bff;
    border-radius: 8px;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease-out;
    opacity: 0;
}

.tutorial-highlight-active {
    opacity: 1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        border-color: #007bff;
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 123, 255, 0.5);
    }
    50% {
        border-color: #0056b3;
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 123, 255, 0.8);
    }
}

.tutorial-btn-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#tutorial-btn {
    background: #28a745;
    padding: 8px 16px;
    font-size: 0.9em;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#tutorial-btn:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

#tutorial-btn::before {
    content: "❓";
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .tutorial-modal {
        max-width: 90vw;
        min-width: auto;
        padding: 20px;
    }
    
    .tutorial-modal-center {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) !important;
    }
    
    .tutorial-modal-top,
    .tutorial-modal-bottom,
    .tutorial-modal-left,
    .tutorial-modal-right {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .tutorial-buttons {
        flex-wrap: wrap;
    }
    
    .tutorial-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}
