﻿/* 滾動區域樣式 - 改為網格佈局 */
.scrolling-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
    position: relative;
    border-radius: 1rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    overflow: visible; /* 改為可見溢出 */
}
.scrolling-cards.dragging {
    cursor: grabbing;
}

.scrolling-cards::-webkit-scrollbar {
    display: none; /* 隱藏滾動條 */
}

/* 卡片樣式 */
.service-card {
    width: auto; /* 改為自動寬度 */
    height: auto; /* 改為自動高度，最小高度保持不變 */
    min-height: 320px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    border-radius: 1.5rem;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    position: relative;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1; /* 確保正常堆疊順序 */
}


    .service-card:hover {
        transform: scale(1.05); /* 減小放大效果，避免過度重疊 */
        z-index: 2; /* 確保懸停時在最上層 */
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2), 0 6px 8px rgba(0, 0, 0, 0.1);
    }

/* 卡片內容樣式 */
.service-card .card-body {
    display: flex; /* 使用 Flexbox */
    flex-direction: column; /* 垂直排列內容 */
    justify-content: center; /* 垂直置中 */
    align-items: center; /* 水平置中 */
    height: 100%; /* 確保內容填滿卡片高度 */
    text-align: center; /* 文字置中 */
}

/* 圖示樣式 */
.service-card .card-icon {
    font-size: 2rem; /* 放大圖示 */
    color: #007bff; /* 藍色 */
    margin-bottom: 1rem; /* 與文字保持間距 */
    text-shadow: none; /* 移除發光效果 */
}

/* 卡片標題 */
.service-card .card-title {
    font-size: 2rem; /* 放大標題字體 */
    font-weight: 700;
    color: #333333; /* 深灰色文字 */
    margin-bottom: 0.5rem;
    text-transform: none; /* 正常大小寫 */
    letter-spacing: normal; /* 正常字距 */
    text-align: center; /* 文字置中 */
}

/* 卡片文字 */
.service-card .card-text {
    font-size: 1.2rem; /* 放大文字字體 */
    color: #666666; /* 中灰色文字 */
    text-align: center; /* 文字置中 */
    margin: 0; /* 移除多餘的外邊距 */
}

/* 新增卡片樣式 */
.add-card {
    border: 2px dashed rgba(0, 0, 0, 0.1); /* Apple風格灰色 */
    background-color: #f9f9f9;
    text-align: center;
    color: #666666;
    justify-content: center;
    align-items: center;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    min-height: 220px;
    min-width: 340px;
    transition: background-color 0.4s ease, transform 0.4s ease;
    border-radius: 1.5rem; /* 圓角 */
}

.add-card:hover {
    background-color: #f0f0f0;
    transform: scale(1.05);
    border-color: #007bff;
    color: #007bff;
}

/* 滑動指示器 */
.scroll-indicator {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: #666666;
    animation: fadeOut 3s forwards;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .service-card {
        width: 300px;
    }

    .add-card {
        min-width: 300px;
    }

    .service-card .card-title {
        font-size: 1.8rem; /* 響應式標題字體 */
    }

    .service-card .card-text {
        font-size: 1rem; /* 響應式文字字體 */
    }
}

/* 動畫效果 */
.service-card:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2), 0 6px 8px rgba(0, 0, 0, 0.1); /* 更強的陰影 */
    animation: rainbowBorder 2s linear infinite !important; /* 套用彩色流動動畫 */
    border-width: 3px !important; /* 增加邊框寬度 */
    border-style: solid !important; /* 確保邊框樣式為實線 */
}
@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* 修正彩色流動邊框動畫 */
@keyframes rainbowBorder {
    0% {
        border-color: #ff0000; /* 紅色 */
    }
    25% {
        border-color: #ff7f00; /* 橙色 */
    }
    50% {
        border-color: #ffff00; /* 黃色 */
    }
    75% {
        border-color: #00ff00; /* 綠色 */
    }
    100% {
        border-color: #0000ff; /* 藍色 */
    }
}

.carousel img {
    height: auto;
    max-height: 480px;
    object-fit: contain;
    background-color: #f8f9fa;
}

