/*itsrlabs/apps/platform/static/css/_shared/cards.css*/
/* ========= GENERIC CARD BASE ==================================== */
/* Use as: <div class="itsr-card itsr-card--analysis"> ... */

.itsr-card {
    border-radius: 1rem;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Optional extra elevation */
.itsr-card--elevated {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

/* Legacy base shapes from components */
.card-base,
.card-base-animated {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Keep as alias to itsr-card if you still use .card-base in HTML */
.card-base,
.card-base-animated {
    background-color: #ffffff;
}

/* Disabled card variant */
.itsr-card--disabled,
.disabled-card {
    opacity: 0.4;
    pointer-events: none;
}

/* ========= ANALYSIS CARD VARIANT ================================ */
/* DE / controls / plots side panel */

.itsr-card--analysis {
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 1.5rem;
    min-height: 0;
}

/* Body stacks nav + content */
.itsr-card--analysis .card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Nav row stays compact */
.itsr-card--analysis .nav {
    flex: 0 0 auto;
}

/* Collapsed state for analysis card (used by chevron) */
.itsr-card--analysis.is-collapsed {
    padding: 0 !important;
    min-height: 60px;
    max-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.itsr-card--analysis.is-collapsed #controlContent,
.itsr-card--analysis.is-collapsed #deControlContent {
    display: none;
}

/* Chevron button positioning */
#toggleChevronBtn {
    transition: transform 0.2s ease;
    z-index: 10;
}

.itsr-card--analysis:not(.is-collapsed) #toggleChevronBtn {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.itsr-card--analysis.is-collapsed #toggleChevronBtn {
    position: static;
    margin: 0 auto;
}

/* Control column width constraints */
#controlCol.col-lg-1,
#deControlCol.col-lg-1 {
    max-width: 80px;
}

/* Chevron circle styling */
.chevron-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #f1f3f5;
    transition: background-color 0.2s ease;
}

.chevron-circle:hover {
    background-color: #e2e6ea;
}

.chevron-circle i {
    font-size: 1rem;
}

/* Summary content inside analysis card */
.summary-content-box {
    padding: 0.5rem 1rem;
    border-top: 1px dashed #ccc;
    opacity: 0;
    animation: summaryFadeInStatic 0.25s ease-in forwards;
}

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

#expandedSummary {
    transition: height 0.3s ease;
}

#expandedSummary.collapse:not(.show) {
    display: none;
}

#expandedSummary.collapse.show {
    display: block;
    animation: summaryFadeIn 0.25s ease-in;
}

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

/* Placeholder message for empty states inside cards */
.placeholder-message {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 1rem;
    margin: 0;
}

/* ========= FILE CARD VARIANT ==================================== */
/* Use: <div class="itsr-card itsr-card--file"> ... */

.itsr-card--file {
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
}

/* Strong hover for file cards */
.itsr-card--file:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
}

/* Empty / ‘no files yet’ state */
.itsr-card--file-empty {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    box-shadow: none;
    text-align: center;
    color: #6c757d;
    font-weight: 500;
}

.itsr-card--file-empty:hover {
    transform: none;
    box-shadow: none;
    cursor: default;
}

/* Tag chip palette */
.tag-badge {
    font-size: 0.75rem;
    margin-left: 0.25rem;
    text-transform: uppercase;
    font-weight: 500;
}

.tag-raw        { background-color: #6c757d; }
.tag-processed  { background-color: blue; }
.tag-seurat     { background-color: purple; }
.tag-scanpy     { background-color: cyan; }
.tag-error      { background-color: red; }
.tag-itsr       { background-color: green; }
.tag-anndata    { background-color: orange; }

.itsr-card--file .file-name {
    line-height: 1.2;
}

/* Responsive tag wrapping */
@media (max-width: 576px) {
  .itsr-card--file .d-flex.align-items-start > .flex-grow-1 > .d-flex {
      flex-wrap: wrap;
      row-gap: 0.75rem;
  }
}

/* File name marquee (scrolling when overflow) */
.file-name-scroll {
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    max-width: 100%;
}

/* Inner span injected when overflowing */
.file-name-scroll .marquee-inner {
    display: inline-block;
    will-change: transform;
    white-space: inherit;
}

/* Active marquee */
.file-name-scroll.marquee .marquee-inner {
    animation-name: marquee-x;
    animation-duration: var(--marquee-duration, 8s);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-delay: 0.75s;
}

/* Pause on hover/focus */
.file-name-scroll.marquee:hover .marquee-inner,
.file-name-scroll.marquee:focus-within .marquee-inner {
    animation-play-state: paused;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .file-name-scroll.marquee .marquee-inner {
        animation: none;
    }
}

@keyframes marquee-x {
    0%   { transform: translateX(0); }
    90%  { transform: translateX(calc(-1 * var(--marquee-distance, 0px))); }
    100% { transform: translateX(0); }
}

/* Keep meta/tags/actions rigid; let name shrink */
.meta-line,
.tag-col,
.action-col { flex: 0 0 auto; }

.min-w-0 { min-width: 0 !important; }

/* ========= PLATFORM CARD HIGHLIGHT (shared with visibility-chip, subs-about-card) ========= */
.platform-card-highlight {
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.platform-card-highlight:hover {
  background-color: #eef2ff;
  border-color: #c7d2fe;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}
.platform-card-highlight.is-selected {
  border-color: #4f46e5;
  background-color: #eef2ff;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.4), 0 8px 20px rgba(15, 23, 42, 0.12);
}

/* ========= INPUT CARD VARIANT =================================== */

.itsr-card--input,
.input-card {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    transition: opacity 0.3s ease;
}

/* ========= PROFILE CARD VARIANT ================================ */

.itsr-card--profile,
.profile-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.itsr-card--profile:hover,
.profile-card:hover {
    transform: translateY(-2px);
}
