/**
 * Smart Accounting Carousel - Frontend Styles
 */

/* ── Wrapper ─────────────────────────────────────────────────────────── */
.sac-carousel-wrapper {
    background-color: #f5f3f0;
    padding: 80px 0 80px 80px; /* right=0 so track bleeds to screen edge */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.sac-carousel-container {
    width: 100%;
}

/* ── Header row: dots + nav buttons ─────────────────────────────────── */
.sac-carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 48px;
    padding-right: 80px; /* mirror left padding */
    box-sizing: border-box;
}

/* Dots */
.sac-slider-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sac-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #8d8d8d;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.25s ease;
    flex-shrink: 0;
    line-height: 0;
    font-size: 0;
}

.sac-dot.sac-active {
    background-color: #000000;
    transform: scale(1.3);
}

/* Nav buttons */
.sac-slider-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.sac-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #fead01;
    border: 1px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: background-color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.sac-nav-btn:hover {
    background-color: #e69c00;
}

.sac-nav-btn:active {
    transform: scale(0.9);
}

.sac-nav-btn:disabled,
.sac-nav-btn.sac-disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* ── Carousel viewport — clips the track ─────────────────────────────── */
.sac-carousel-viewport {
    width: 100%;
    overflow: hidden;
    /* cursor changes while dragging */
    cursor: grab;
}

.sac-carousel-viewport.sac-dragging {
    cursor: grabbing;
}

/* ── Track — moved via transform (no scroll, no snap) ────────────────── */
.sac-carousel-track {
    display: flex;
    gap: 16px;
    /* translate is set inline by JS */
    will-change: transform;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    user-select: none;
    -webkit-user-select: none;
}

/* No transition while actively dragging */
.sac-carousel-track.sac-no-transition {
    transition: none;
}

/* ── Slide ────────────────────────────────────────────────────────────── */
/*
 * Width is set entirely by JS via --sac-slide-width.
 * Height is driven by a CSS custom property --sac-card-height
 * also set by JS, so it can vary per breakpoint.
 * Fallbacks keep things safe if JS hasn't run yet.
 */
.sac-carousel-slide {
    flex: 0 0 var(--sac-slide-width, 320px);
    width: var(--sac-slide-width, 320px);
    height: var(--sac-card-height, 520px);
    pointer-events: auto;
}

/* ── Card: full-bleed image background ───────────────────────────────── */
.sac-card {
    width: 100%;
    height: 100%;            /* fills the slide entirely */
    border-radius: 16px;
    border: 1px solid #e0e0e0;
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.10);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
    background-color: #6b6b6b;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    -webkit-user-drag: none;
}

/* Dark overlay */
.sac-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

/* ── White panel (bottom of card) ────────────────────────────────────── */
.sac-card-panel {
    position: relative;
    z-index: 1;
    background-color: #ffffff;
    border-radius: 0 0 15px 15px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ── Card header ─────────────────────────────────────────────────────── */
.sac-card-header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 24px;
    cursor: pointer;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
    /* Extend tap target to full panel width */
    -webkit-tap-highlight-color: transparent;
}

/* Icon circle */
.sac-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    background-color: rgba(255, 186, 0, 0.30);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Title group */
.sac-title-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sac-title-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding-top: 3px;
}

.sac-label-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sac-industry-label {
    font-family: 'Satoshi', sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #ffba00;
    display: block;
}

.sac-industry-name {
    font-family: 'Satoshi', sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 22px;
    color: #1a1a1a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.sac-chevron {
    flex-shrink: 0;
    margin-top: 3px;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none; /* click handled by parent header */
}

.sac-card.sac-open .sac-chevron {
    transform: rotate(180deg);
}

.sac-subtitle {
    font-family: 'Satoshi', sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 20px;
    color: #6b7280;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Collapsible body ─────────────────────────────────────────────────── */
.sac-card-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-top: 1px solid #f3f4f6;
    overflow: hidden;
    max-height: 0;
    padding: 0 24px;
    transition: max-height 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                padding    0.4s  cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sac-card.sac-open .sac-card-body {
    max-height: 380px;
    padding: 18px 24px 24px 24px;
}

/* Content sections */
.sac-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sac-section-title {
    font-family: 'Satoshi', sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
    color: #1a1a1a;
    margin: 0;
}

.sac-section-content {
    font-family: 'Satoshi', sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 20px;
    color: #6b7280;
    margin: 0;
}

/* Result highlight */
.sac-result-section {
    background-color: rgba(255, 186, 0, 0.10);
    border-radius: 12px;
    padding: 14px;
    gap: 4px;
}

.sac-result-section .sac-section-content {
    color: #212121;
}

/* ── Responsive padding (matches JS breakpoints) ─────────────────────── */

/* 1600px+ uses 80px padding — default above */

@media (max-width: 1279px) {
    /* 1024–1279: 2 cards + peek, tighter padding */
    .sac-carousel-wrapper     { padding-left: 60px; }
    .sac-carousel-header      { padding-right: 60px; }
}

@media (max-width: 1023px) {
    /* 768–1023: 2 cards + peek */
    .sac-carousel-wrapper     { padding-left: 40px; padding-top: 60px; padding-bottom: 60px; }
    .sac-carousel-header      { padding-right: 40px; }
}

@media (max-width: 767px) {
    /* 480–767: 1 card + peek */
    .sac-carousel-wrapper     { padding-left: 24px; padding-top: 48px; padding-bottom: 48px; }
    .sac-carousel-header      { padding-right: 24px; }

    /* Tighten card panel text at this size */
    .sac-card-header          { padding: 18px 20px; gap: 12px; }
    .sac-card-body            { padding: 0 20px; }
    .sac-card.sac-open .sac-card-body { padding: 16px 20px 20px 20px; }
    .sac-industry-name        { font-size: 15px; }
}

@media (max-width: 479px) {
    /* < 480px: 1 full card, no peek, full-bleed feel */
    .sac-carousel-wrapper     { padding-left: 16px; padding-top: 40px; padding-bottom: 40px; gap: 20px; }
    .sac-carousel-header      { padding-right: 16px; }

    /* Nav buttons slightly smaller on very small screens */
    .sac-nav-btn              { width: 40px; height: 40px; }
}
