/* Transformation Suggestions (v4.5) */

/* Main CTA Button — large, gradient, prominent */
.btn-transform-suggestions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 20px 24px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff6b35, #9b59b6, #3498db);
    background-size: 200% 200%;
    color: white;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s, background-position 0.4s;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
    animation: ts-gradient-shift 4s ease infinite;
}

.btn-transform-suggestions:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.4);
    background-position: 100% 100%;
}

.btn-transform-suggestions:active {
    transform: translateY(0);
}

.btn-transform-suggestions-sm {
    flex-direction: row;
    padding: 8px 14px;
    gap: 6px;
    width: auto;
    border-radius: 10px;
    font-size: 13px;
}

.btn-transform-suggestions-sm .btn-ts-hint {
    display: none;
}

@keyframes ts-gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-ts-icon {
    display: flex;
    align-items: center;
}

.btn-ts-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.btn-transform-suggestions-sm .btn-ts-text {
    font-size: 13px;
    font-weight: 600;
}

.btn-ts-hint {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 400;
}

/* Idle State */
.transform-suggestions-idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    min-height: 200px;
}

/* Loading */
.transform-suggestions-loading {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.ts-skeleton-card {
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-main) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: ts-skeleton-pulse 1.5s ease-in-out infinite;
}

.ts-loading-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

@keyframes ts-skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Error */
.transform-suggestions-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 16px;
    color: var(--text-secondary);
}

/* Suggestions List */
.transform-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
}

.ts-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.ts-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: calc(100vh - 380px);
    padding-right: 4px;
}

/* Suggestion Card */
.ts-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg-card, var(--bg-hover));
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.ts-card:hover {
    border-color: var(--color-orange, #ff6b35);
    background: var(--bg-hover);
    transform: translateX(2px);
}

.ts-card-selected {
    border-color: var(--color-orange, #ff6b35);
    background: rgba(255, 107, 53, 0.08);
}

.ts-card-check {
    flex-shrink: 0;
}

.ts-card-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-orange, #ff6b35);
}

.ts-card-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.ts-card-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1.3;
}

.ts-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ts-card-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.ts-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ts-card-priority {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.ts-priority-high {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
}

.ts-priority-medium {
    background: rgba(255, 107, 53, 0.12);
    color: var(--color-orange, #ff6b35);
}

.ts-priority-low {
    background: rgba(52, 152, 219, 0.12);
    color: #3498db;
}

/* Intensity Badge */
.ts-card-intensity {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Footer with Apply Button */
.ts-footer {
    margin-top: 12px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.ts-footer-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ts-footer .btn {
    width: 100%;
    font-weight: 600;
}

/* ========================================
   Mobile Responsive (v5.8)
   ======================================== */

@media (max-width: 768px) {
    .btn-transform-suggestions {
        padding: 16px 20px;
        border-radius: 12px;
    }

    .btn-ts-text {
        font-size: 15px;
    }

    .ts-cards {
        max-height: calc(100vh - 280px);
        max-height: calc(100dvh - 280px);
        -webkit-overflow-scrolling: touch;
        padding-right: 2px;
    }

    .ts-card {
        padding: 14px 16px;
        min-height: 44px;
        gap: 12px;
    }

    .ts-card:hover {
        transform: none; /* No translateX on mobile — interferes with touch */
    }

    .ts-card-check input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }

    .ts-card-label {
        font-size: 15px;
    }

    .ts-card-desc {
        font-size: 13px;
    }

    .ts-card-priority {
        font-size: 11px;
        padding: 4px 8px;
    }

    .ts-footer {
        margin-top: 8px;
    }

    .ts-footer .btn {
        min-height: 48px;
        font-size: 15px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .transform-suggestions-idle {
        padding: 24px 12px;
        min-height: 150px;
    }

    .transform-suggestions-error {
        padding: 24px 12px;
    }
}

@media (max-width: 480px) {
    .ts-cards {
        max-height: calc(100vh - 240px);
        /* B3: subtract mobile nav height so cards don't extend under nav */
        max-height: calc(100dvh - 240px - var(--mobile-nav-height, 60px));
    }

    .ts-card {
        padding: 12px 14px;
        min-height: 48px;
    }

    .ts-card-check input[type="checkbox"] {
        width: 28px;
        height: 28px;
    }

    .btn-transform-suggestions {
        padding: 14px 16px;
    }
}

/* C6: Swipe hint discovery animation (fires once via JS) */
@keyframes swipeHint {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(18px); }
    75% { transform: translateX(-18px); }
}
.swipe-hint-animate {
    animation: swipeHint 600ms ease-in-out;
}
