/**
 * AI MifA Chat - Chat Interface Styles
 * 个性化珠宝AI聊天界面样式
 */

/* ================================
   Chat Container
   ================================ */
.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    background: linear-gradient(135deg, #faf8f5 0%, #f5f0e8 100%);
    padding-top: 70px; /* Navbar height */
}

/* ================================
   Chat Header
   ================================ */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.ai-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--bg-white);
}

.ai-info h1 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    color: var(--text-light);
    margin: var(--space-xs) 0 0 0;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-header-actions {
    display: flex;
    gap: var(--space-md);
}

.chat-header-actions button {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-reset {
    background: var(--bg-light);
    color: var(--text-medium);
    border: 1px solid var(--border-color);
}

.btn-reset:hover {
    background: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
}

.btn-download {
    background: var(--primary-color);
    color: var(--bg-white);
}

.btn-download:hover {
    background: var(--primary-dark);
}

/* ================================
   Request Counter
   ================================ */
.request-counter {
    padding: var(--space-sm) var(--space-xl);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}

.counter-bar {
    height: 4px;
    background: var(--bg-light);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.counter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.counter-text {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ================================
   Chat Messages Area
   ================================ */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    max-width: 600px;
    margin: auto;
}

.welcome-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: var(--space-lg);
}

.welcome-message h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: var(--space-md);
}

.welcome-message p {
    color: var(--text-medium);
    margin-bottom: var(--space-md);
}

.welcome-features {
    text-align: left;
    display: inline-block;
    margin: var(--space-lg) 0;
}

.welcome-features li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    color: var(--text-medium);
}

.welcome-features li i {
    color: var(--primary-color);
    width: 20px;
}

.welcome-tip {
    font-size: 0.85rem;
    color: var(--primary-color);
    background: rgba(184, 134, 11, 0.1);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    display: inline-block;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: var(--space-md);
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.ai {
    align-self: flex-start;
}

/* Avatar */
.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.message.user .message-avatar {
    background: var(--secondary-color);
    color: var(--bg-white);
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--bg-white);
}

/* Message Content */
.message-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.message-bubble {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: var(--secondary-color);
    color: var(--bg-white);
    border-bottom-right-radius: var(--radius-sm);
}

.message.ai .message-bubble {
    background: var(--bg-white);
    color: var(--text-dark);
    border-bottom-left-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

/* Message Image */
.message-image {
    margin-top: var(--space-sm);
    border-radius: var(--radius-md);
    /* overflow: hidden 改放到 img 上,避免裁切絕對定位的放大按鈕 */
    cursor: pointer;
    max-width: 300px;
    position: relative; /* 讓 .btn-expand-image-card 絕對定位 */
}

.message-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition-fast);
}

.message-image:hover img {
    transform: scale(1.02);
}

/* Timestamp */
.message-time {
    font-size: 0.7rem;
    color: var(--text-light);
}

.message.user .message-time {
    text-align: right;
}

/* ================================
   Image Preview Modal
   ================================ */
.image-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    /* 全屏黑色 overlay(對應 My designs 的 ai-image-modal 黑底)
       原本 CSS 期待 .preview-overlay 子元素,但 ai-mifa.html 的 HTML 結構
       只有 .modal-content 直接放在 .image-preview-modal 下,所以直接在容器上
       設黑底,modal 內的 .modal-content(白底)就會自然疊在黑底上 */
    background: rgba(0, 0, 0, 0.92);
}

.image-preview-modal.active {
    display: flex;
}

/* ============================================================
 * 覆蓋 style.css 的 .modal-content 預設 max-width: 500px
 * AI MifA 的圖片 modal 跟 My designs 一樣要用 90vw 大圖 modal
 * 否則圖片只顯示在中間 500px 區域,不及 My designs 全屏寬度
 * ============================================================ */
.image-preview-modal .modal-content {
    max-width: 90vw;
    width: auto;
    max-height: 90vh;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.image-preview-modal .modal-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

.image-preview-modal .modal-content .download-btn {
    /* 沿用 ai-image-modal-toolbar 的排版:圖下方水平置中 */
    margin-top: 12px;
}

.preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.preview-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    transition: all var(--transition-fast);
}

.preview-close:hover {
    background: var(--primary-color);
    color: var(--bg-white);
}

.preview-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: var(--radius-md);
}

.preview-download {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--primary-color);
    color: var(--bg-white);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: background var(--transition-fast);
}

.preview-download:hover {
    background: var(--primary-dark);
}

/* ================================
   Input Area
   ================================ */
.chat-input-area {
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    /* 確保展開的 prompt 面板(以及 popup)可以溢出顯示,不被裁切 */
    overflow: visible;
    position: relative;
    z-index: 1;
}

/* Image Preview Card (attached) */
.image-preview-container {
    margin-bottom: var(--space-md);
    animation: previewSlideIn 0.3s ease-out;
}

.image-preview-container > .preview-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--bg-white);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: var(--space-sm) var(--space-md);
    box-shadow: 0 4px 14px rgba(184, 134, 11, 0.15);
}

.preview-thumb-wrapper {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    /* overflow 改放到 img 上,讓 .btn-expand-image-card 絕對定位不被裁切 */
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color, #eaeaea);
    position: relative; /* 讓 .btn-expand-image-card 絕對定位 */
}

.preview-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.preview-info-icon {
    color: var(--primary-color);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.preview-info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.preview-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-size {
    font-size: 0.8rem;
    color: var(--text-light);
}

.remove-image-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: var(--bg-light);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast, 0.2s ease);
}

.remove-image-btn:hover {
    background: var(--error-color, #dc3545);
    color: var(--bg-white);
    transform: scale(1.1) rotate(90deg);
}

.remove-image-btn:active {
    transform: scale(0.95);
}

@keyframes previewSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================
   Limit Reached Banner
   ================================ */
.limit-banner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: linear-gradient(135deg, #fff4e6 0%, #ffe8d0 100%);
    border: 2px solid #f39c12;
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.15);
    animation: limitBannerSlide 0.4s ease-out;
}

.limit-banner-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: #f39c12;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.limit-banner-text {
    flex: 1;
    min-width: 0;
}

.limit-banner-text strong {
    display: block;
    font-size: 1.05rem;
    color: #b35900;
    margin-bottom: 2px;
}

.limit-banner-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #8a4a00;
    line-height: 1.4;
}

.limit-banner-btn {
    flex-shrink: 0;
    background: #f39c12;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: all var(--transition-fast, 0.2s ease);
}

.limit-banner-btn:hover {
    background: #d87b00;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.4);
}

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

@keyframes limitBannerSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .limit-banner {
        flex-wrap: wrap;
    }
    .limit-banner-text {
        flex-basis: calc(100% - 64px);
    }
    .limit-banner-btn {
        margin-left: auto;
    }
}

/* Input Wrapper */
.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: var(--space-md);
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    border: 2px solid transparent;
    transition: border-color var(--transition-fast);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
}

/* v17.3.0: input-actions 內含 ➕ 容器和 send，必須是 flex 才能橫排
   用 margin-left: auto 把整個 input-actions 推到 input-wrapper 最右側，
   無論 textarea 寬窄（focus 展開/初始 52px）按鈕永遠釘在右邊 */
.input-actions {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    flex-shrink: 0;
    margin-left: auto;
}

/* Attach Button */

/* v17.3.0: 折疊式 ➕ 工具列容器，包裹 preset + attach，按需彈出 */
.input-tools-wrapper {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.btn-tools-toggle {
    width: 52px;
    height: 52px;
    background: var(--bg-white);
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    transition: all var(--transition-fast, 0.2s ease);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: none;
}
.btn-tools-toggle:hover {
    background: var(--primary-color);
    color: var(--bg-white);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.25);
}
.btn-tools-toggle:active {
    transform: scale(0.95);
}
.btn-tools-toggle.active {
    background: var(--primary-color);
    color: var(--bg-white);
    transform: rotate(45deg);
}
.btn-tools-toggle.active:hover {
    transform: rotate(45deg) scale(1.08);
}

/* 彈出層：preset + attach 橫排
   - 窄屏（移動端）：position: absolute 浮在 ➕ 上方，受 [hidden] 控制
   - 寬屏（PC 端，下方 @media 覆蓋）：position: static 強制 inline 展開，隱藏 ➕ 按鈕 */
.input-tools-popup {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color, #eaeaea);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 20;
    white-space: nowrap;
}

.input-tools-popup[hidden] {
    display: none;
}

/* 彈出層內的 preset wrapper 保留 relative（讓 .prompt-preset-panel 能錨定到 preset 按鈕） */
.input-tools-popup .prompt-preset-wrapper {
    /* 不要改成 static — preset-panel 用 position:absolute，需要 wrapper 為定位祖先 */
}

/* 彈出層內的 btn-attach 加文字 label（PC 端才需要，移動端隱藏） */
.input-tools-popup .btn-attach {
    width: auto;
    height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color, #333);
    background: var(--bg-light);
    box-shadow: none;
}
.input-tools-popup .btn-attach:hover {
    background: var(--primary-color);
    color: var(--bg-white);
}

/* 移動端：彈出層內 attach 按鈕只顯示圖標，不顯示文字 */
@media (max-width: 768px) {
    .input-tools-popup .btn-attach > span {
        display: none;
    }
    .input-tools-popup .btn-attach {
        width: 44px;
        padding: 0;
    }
    /* 移動端 preset 按鈕：圓形圖標，無文字 */
    .input-tools-popup .btn-prompt-preset {
        width: 44px;
        height: 44px;
        padding: 0;
    }
    .input-tools-popup .btn-prompt-preset > span {
        display: none;
    }
}

/* PC 端（>=769px）：popup 強制 inline 展開，➕ 按鈕隱藏，preset + attach 跟 send 平排 */
@media (min-width: 769px) {
    .btn-tools-toggle {
        display: none;
    }
    /* wrapper 變 contents,讓子元素（popup）直接參與父 flex 布局，不佔位 */
    .input-tools-wrapper {
        display: contents;
    }
    .input-tools-popup {
        position: static;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--space-sm);
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
        white-space: nowrap;
    }
    /* 覆蓋 [hidden]：PC 端不折疊，popup 始終展開 */
    .input-tools-popup[hidden] {
        display: flex !important;
    }
    .input-tools-popup .btn-attach > span {
        display: none; /* 跟原本的圓形 attach 一致 */
    }
    .input-tools-popup .btn-attach {
        width: 52px;
        height: 52px;
        padding: 0;
        border-radius: 50%;
        gap: 0;
        font-size: 1.35rem;
        background: var(--bg-white);
    }
}

.btn-attach {
    width: 52px;
    height: 52px;
    background: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition-fast, 0.2s ease);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.btn-attach i {
    font-size: 1.35rem;
    transition: transform var(--transition-fast, 0.2s ease);
}

.btn-attach:hover {
    background: var(--primary-color);
    color: var(--bg-white);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.25);
}

.btn-attach:hover i {
    transform: scale(1.1);
}

.btn-attach:active {
    transform: scale(0.95);
}

/* v17.2.3: Preset prompt dropdown (sits next to attach button) */
.prompt-preset-wrapper {
    position: relative;
    flex-shrink: 0;
}
.btn-prompt-preset {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #f4e4bc 0%, #d4af37 100%);
    color: #1a1a2e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast, 0.2s ease);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(184, 134, 11, 0.25);
    border: none;
    /* Show "Presets" label visible on hover */
    overflow: visible;
}
.btn-prompt-preset:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.4);
}
.btn-prompt-preset:active {
    transform: scale(0.95);
}
.btn-prompt-preset.active {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #fff;
}
.btn-prompt-preset i {
    font-size: 1.15rem;
}
.btn-prompt-preset > span {
    display: none; /* mobile-only label hide; tap-target still 52px */
}
/* On wide screens show the "Presets" label so it's discoverable */
@media (min-width: 481px) {
    .btn-prompt-preset {
        width: auto;
        padding: 0 16px;
        gap: 6px;
    }
    .btn-prompt-preset > span {
        display: inline;
        font-size: 0.85rem;
        font-weight: 600;
    }
}

.prompt-preset-panel {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 40px);
    /* 改為基於視窗高度：自動撐高以容納所有 30 個提示詞選項,
       限制為視窗高度的 80% 防止超出畫面 */
    max-height: min(80vh, 720px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(212, 175, 55, 0.3);
    /* 提高 z-index 確保 prompt 面板永遠蓋在 chat-input-area 等其他元素之上 */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    /* 容器本身不要任何 scrollbar,只讓 body 滾動 */
    overflow: hidden;
    overscroll-behavior: contain;
    animation: presetFadeIn 0.18s ease-out;
}
/* v17.2.4: 明確 hidden 優先,避免被 display:flex 蓋掉 */
.prompt-preset-panel[hidden] {
    display: none !important;
}

/* v17.3.0: 移動端 preset panel 開啟時的全屏 backdrop,點擊關閉 */
.prompt-preset-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    animation: presetFadeIn 0.18s ease-out;
}
.prompt-preset-backdrop[hidden] {
    display: none !important;
}
/* PC 端不顯示 backdrop */
@media (min-width: 769px) {
    .prompt-preset-backdrop {
        display: none !important;
    }
}
@keyframes presetFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.preset-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f4e8 0%, #faf6ea 100%);
    border-bottom: 1px solid #f0e8d4;
    font-size: 0.85rem;
    color: #6b5520;
    font-weight: 600;
}
.preset-clear-btn {
    background: transparent;
    border: none;
    color: #b8860b;
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}
.preset-clear-btn:hover { background: rgba(184, 134, 11, 0.1); }
.preset-panel-body {
    /* 唯一一個有滾動條的區域:垂直滾動以容納所有 30 個提示詞選項 */
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px 0;
    /* 防止滾動穿透到父層 */
    overscroll-behavior: contain;
    /* 改善滾動條外觀 */
    scrollbar-width: thin;
    scrollbar-color: rgba(184, 134, 11, 0.45) transparent;
}

.preset-panel-body::-webkit-scrollbar {
    width: 6px;
}
.preset-panel-body::-webkit-scrollbar-track {
    background: transparent;
}
.preset-panel-body::-webkit-scrollbar-thumb {
    background: rgba(184, 134, 11, 0.35);
    border-radius: 3px;
}
.preset-panel-body::-webkit-scrollbar-thumb:hover {
    background: rgba(184, 134, 11, 0.6);
}
.preset-category {
    margin-bottom: 4px;
}
.preset-category-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 700;
    padding: 4px 16px 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    /* 標題置頂:滾動時保持可見,避免用戶迷失當前類別 */
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.preset-category-title i {
    color: #d4af37;
    font-size: 0.78rem;
}
/* 垂直排列容器:讓 chips 一個一個垂直堆疊,而不是水平換行 */
.preset-category > div:not(.preset-category-title) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 4px 12px 8px;
}
.preset-chip {
    display: flex;             /* 垂直排列:每個 chip 佔滿一行 */
    align-items: center;
    gap: 4px;
    margin: 0;                 /* 由 flex gap 取代 */
    padding: 6px 12px;
    background: #f8f8f8;
    border: 1px solid #e8e0c8;
    border-radius: 10px;
    font-size: 0.82rem;
    color: #4a3f1c;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    text-align: left;          /* 文字靠左對齊 */
    width: 100%;               /* 撐滿容器寬度 */
    line-height: 1.3;
}
.preset-chip:hover {
    background: #faf6ea;
    border-color: #d4af37;
}
.preset-chip.selected {
    background: linear-gradient(135deg, #d4af37 0%, #f4e4bc 100%);
    border-color: #b8860b;
    color: #1a1a2e;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(184, 134, 11, 0.3);
}
.preset-panel-footer {
    padding: 10px 16px;
    border-top: 1px solid #f0e8c4;
    background: #fff;
    text-align: right;
}
.preset-done-btn {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
}
.preset-done-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.4);
}
.preset-done-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
@media (max-width: 480px) {
    .prompt-preset-panel {
        /* v17.3.0: 移動端 panel 撐滿視口寬度,避免從 wrapper right:0 對齊導致
           360px 寬度超出左邊界被裁切。改為 fixed 定位 + 自適應寬度 */
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: auto;
        top: 50%;
        transform: translateY(-50%);
        width: auto;
        max-width: none;
        max-height: 75vh;
    }
}

/* Message Input */
#messageInput {
    /* v17.3.0: textarea 寬度撐滿剩餘空間（按鈕釘在最右側）,
       高度預設 52px 跟 send 按鈕一樣高,輸入多行自動撐高到 max 150px */
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    border: none;
    background: transparent;
    padding: var(--space-md);
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    /* 粗度（高度）: 預設 52px 跟 send 按鈕一樣,輸入多行自動撐高 */
    height: 52px;
    min-height: 52px;
    max-height: 150px;
    overflow-x: hidden;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    transition: height 0.15s ease;
    /* 自定義滾動條樣式 — 視覺上更明顯 */
    scrollbar-width: thin;
    scrollbar-color: rgba(184, 134, 11, 0.55) rgba(0, 0, 0, 0.06);
    outline: none;
}
#messageInput:disabled {
    /* 不可輸入狀態: 高度仍 52px（保持視覺一致）,
       寬度照舊撐開,placeholder 顯示簡潔禁用原因 */
    background: var(--bg-light, #f8f8f8);
    cursor: not-allowed;
}
#messageInput::-webkit-scrollbar {
    width: 8px;
}
#messageInput::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
}
#messageInput::-webkit-scrollbar-thumb {
    background: rgba(184, 134, 11, 0.55);
    border-radius: 4px;
    border: 1px solid transparent;
    background-clip: padding-box;
}
#messageInput::-webkit-scrollbar-thumb:hover {
    background: rgba(184, 134, 11, 0.85);
    background-clip: padding-box;
    border: 1px solid transparent;
}

#messageInput::placeholder {
    color: var(--text-light);
}
#messageInput::-webkit-scrollbar {
    width: 8px;
}
#messageInput::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
}
#messageInput::-webkit-scrollbar-thumb {
    background: rgba(184, 134, 11, 0.55);
    border-radius: 4px;
    border: 1px solid transparent;
    background-clip: padding-box;
}
#messageInput::-webkit-scrollbar-thumb:hover {
    background: rgba(184, 134, 11, 0.85);
    background-clip: padding-box;
    border: 1px solid transparent;
}

#messageInput::placeholder {
    color: var(--text-light);
}

/* Send Button */
.btn-send {
    width: 52px;
    height: 52px;
    background: var(--primary-color);
    color: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: all var(--transition-fast, 0.2s ease);
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(184, 134, 11, 0.4);
}

.btn-send i {
    font-size: 1.35rem;
    margin-left: 2px; /* visual centering of paper-plane icon */
}

.btn-send:hover:not(:disabled) {
    background: var(--primary-dark, #9a6f08);
    transform: scale(1.08) translateX(2px);
    box-shadow: 0 6px 18px rgba(184, 134, 11, 0.5);
}

.btn-send:active:not(:disabled) {
    transform: scale(0.95);
}

.btn-send:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Input Hint */
.input-hint {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: var(--space-sm);
}

/* ================================
   Loading Indicator
   ================================ */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    color: var(--text-light);
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ================================
   Error Message
   ================================ */
.error-message {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.9rem;
}

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 768px) {
    .chat-header {
        padding: var(--space-md);
    }
    
    .chat-header-actions button span {
        display: none;
    }
    
    .chat-header-actions button {
        padding: var(--space-sm);
    }
    
    .ai-chat-container {
        padding-top: 60px;
    }
    
    .chat-messages {
        padding: var(--space-md);
    }
    
    .message {
        max-width: 95%;
    }
    
    .welcome-message {
        padding: var(--space-xl) var(--space-md);
    }
    
    .welcome-features {
        text-align: left;
    }
    
    .chat-input-area {
        padding: var(--space-md);
    }
    
    .input-wrapper {
        padding: var(--space-xs);
    }
    
    #messageInput {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .ai-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .ai-info h1 {
        font-size: 1.1rem;
    }
    
    .welcome-icon {
        font-size: 2.5rem;
    }
    
    .welcome-message h2 {
        font-size: 1.2rem;
    }
}

/* ================================
   Toast Notifications
   ================================ */
.ai-chat-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-lg);
    background: var(--text-dark);
    color: var(--bg-white);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    word-wrap: break-word;
}

.ai-chat-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.ai-chat-toast.error {
    background: var(--error-color);
}

.ai-chat-toast.warning {
    background: var(--warning-color);
    color: var(--text-dark);
}

.ai-chat-toast.success {
    background: var(--success-color);
}

/* ============================================================
   Markdown Table Styles
   ============================================================ */

.md-table-wrapper {
    overflow-x: auto;
    margin: var(--space-md) 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: var(--bg-white);
}

.md-table th {
    background: var(--bg-light);
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--primary-color);
}

.md-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-medium);
}

.md-table tr:last-child td {
    border-bottom: none;
}

.md-table tr:hover td {
    background: var(--bg-light);
}

/* Blockquote styles */
.message-bubble blockquote {
    margin: var(--space-sm) 0;
    padding: var(--space-sm) var(--space-md);
    border-left: 3px solid var(--primary-color);
    background: var(--bg-light);
    color: var(--text-medium);
    font-style: italic;
}

/* Horizontal Rule (---, ***, ___) */
.message-bubble hr {
    border: none;
    border-top: 1px solid var(--border-color, #e0e0e0);
    margin: var(--space-md) 0;
    background: transparent;
}

/* Lists (- item, * item) */
.message-bubble ul {
    margin: var(--space-sm) 0;
    padding-left: 1.6em;
    list-style: disc;
}

.message-bubble ol {
    margin: var(--space-sm) 0;
    padding-left: 1.6em;
    list-style: decimal;
}

.message-bubble li {
    margin: var(--space-xs) 0;
    line-height: 1.5;
}

.message-bubble li::marker {
    color: var(--primary-color, #b8860b);
}

/* Headings */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4 {
    margin: var(--space-md) 0 var(--space-sm);
    color: var(--text-color, #333);
    font-weight: 600;
    line-height: 1.3;
}
.message-bubble h1 { font-size: 1.5em; }
.message-bubble h2 { font-size: 1.3em; }
.message-bubble h3 { font-size: 1.15em; }
.message-bubble h4 { font-size: 1.05em; }

/* Inline code (single backticks) */
.message-bubble code {
    background: var(--bg-light, #f5f5f5);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 3px;
    padding: 1px 6px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: #c7254e;
}

/* =============================================================
   Message Image Toolbar (Download + Save to My Designs)
   ============================================================= */

.message-image-wrapper {
    margin-bottom: var(--space-sm, 8px);
}

.message-image-toolbar {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.image-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: var(--radius-md, 6px);
    background: var(--bg-light, #f5f5f5);
    color: var(--text-color, #333);
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-toolbar-btn:hover {
    background: #e8e8e8;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

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

.image-toolbar-btn .fas {
    font-size: 0.85rem;
}

.message.user .image-toolbar-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.message.user .image-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* =============================================================
   Save Design Modal (11 questions + image preview)
   ============================================================= */

.save-design-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.save-design-modal.active {
    display: flex;
}

.save-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.save-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 720px;
    width: 92%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: saveModalIn 0.25s ease-out;
}

@keyframes saveModalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.save-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.save-modal-close:hover {
    background: #f0f0f0;
    transform: rotate(90deg);
}

.save-modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    max-height: 90vh;
}

.save-modal-header {
    padding: 24px 24px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.save-modal-header h2 {
    margin: 0 0 4px;
    font-size: 1.4rem;
    color: var(--primary-color, #b8860b);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.save-modal-subtitle {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.save-modal-image {
    padding: 16px 24px;
    text-align: center;
    background: var(--bg-light, #f5f5f5);
    position: relative; /* 讓 .btn-expand-image-card 絕對定位(相對於容器,位於 padding 內左下) */
}

.save-modal-image img {
    max-width: 240px;
    max-height: 240px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.save-form {
    padding: 16px 24px 24px;
}

.save-form-question {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.save-form-question:last-of-type {
    border-bottom: none;
}

.save-form-question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.save-form-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color, #b8860b);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.save-form-step-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.save-form-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.save-form-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.save-form-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #fff;
}

.save-form-options-grid .save-form-option {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
    gap: 6px;
    min-height: 70px;
    justify-content: center;
}

.save-form-option-content {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.save-form-options-grid .save-form-option-content {
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

.save-form-option .fas {
    font-size: 1rem;
    color: var(--primary-color, #b8860b);
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.save-form-options-grid .save-form-option .fas {
    font-size: 1.2rem;
    width: 20px;
}

.save-form-option:hover {
    border-color: var(--primary-color, #b8860b);
    background: rgba(184, 134, 11, 0.04);
}

.save-form-option input[type="radio"] {
    accent-color: var(--primary-color, #b8860b);
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.save-form-options-grid .save-form-option input[type="radio"] {
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
}

.save-form-options-grid .save-form-option {
    position: relative;
    padding-right: 32px;
}

.save-form-option input[type="radio"]:checked ~ .save-form-option-content {
    color: var(--primary-color, #b8860b);
    font-weight: 500;
}

.save-form-option:has(input[type="radio"]:checked) {
    border-color: var(--primary-color, #b8860b);
    background: rgba(184, 134, 11, 0.08);
    box-shadow: 0 0 0 1px var(--primary-color, #b8860b);
}

/* Engraving section */
.save-form-engraving {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.save-form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.save-form-field label {
    font-size: 0.85rem;
    color: #555;
    font-weight: 500;
}

.save-form-checkbox-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.save-form-char-count {
    font-size: 0.75rem;
    color: #888;
    text-align: right;
}

/* Custom text input (for Q6/Q8/Q9/Q10 *_custom) */
.save-form-custom-input {
    grid-column: 1 / -1;
    padding: 10px 12px;
    background: #f8f8f8;
    border-radius: 6px;
    border: 1px dashed #d0d0d0;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.save-form-input-hint {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
}

.save-form-empty {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 16px;
}

.save-form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.save-form-input:focus {
    outline: none;
    border-color: var(--primary-color, #b8860b);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.save-form-note {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: #888;
    font-style: italic;
}

.save-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.save-form-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.save-form-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.save-form-btn-cancel {
    background: #f0f0f0;
    color: #555;
}

.save-form-btn-cancel:hover:not(:disabled) {
    background: #e0e0e0;
}

.save-form-btn-submit {
    background: linear-gradient(135deg, #14b8a6 0%, #0891b2 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(20, 184, 166, 0.3);
}

.save-form-btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

@media (max-width: 600px) {
    .save-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    .save-form-options {
        gap: 4px;
    }
    .save-form-actions {
        flex-direction: column-reverse;
    }
    .save-form-btn {
        width: 100%;
        justify-content: center;
    }
}

/* =============================================================
   Toast with action button
   ============================================================= */

.ai-chat-toast.with-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    max-width: 420px;
}

.ai-chat-toast .toast-message {
    flex: 1;
}

.ai-chat-toast .toast-action {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: background 0.15s ease;
    font-family: inherit;
}

.ai-chat-toast .toast-action:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ============================================================
 * Image expand button (複用 My designs 卡片放大按鈕風格)
 * 原本定義在 customize.css 的 .btn-expand-image-card,這裡獨立維護
 * 避免 ai-mifa.html 必須載入 customize.css
 * 樣式需與 customize.css 同步;若改大小/位置,兩邊一起改
 * ============================================================ */
.btn-expand-image-card {
    position: absolute;
    bottom: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3; /* 蓋在 .message-image-toolbar 之上 */
}

.btn-expand-image-card:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: scale(1.1);
}

.btn-expand-image-card:active {
    transform: scale(0.95);
}