/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body, html {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-on-scroll {
    animation: fadeInUp 0.8s ease-out;
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #30383a;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #ffc800;
}

.logo img {
    width: 50px;
    /* height: auto;  */
    display: block; /* 防止圖片受到其他元素影響 */
}

.menu-toggle {
    display: none; /* 默认隐藏，仅在移动端显示 */
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    cursor: pointer;
    width: 30px;
    height: 20px;
    flex-direction: column;
    justify-content: space-between;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #333;
    transition: all 0.3s ease;
}
/* 
.scroll-offset {
    scroll-margin-top: 100px;
} */

.nav-buttons {
    display: flex;
    gap: 20px;
}

.nav-button {
    font-size: 1em;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-button:hover {
    background-color: #ff9407;
    color: white;
}

/* Hero Section */
#home {
    background-image: url('/public/home/restaurant-background.png');
    background-size: cover;
    background-position: center;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    position: relative;
}

#home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
    z-index: 1;
}

#home .slogan {
    font-size: 2.5em;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
    max-width: 90%;
    line-height: 1.4;
}

/* 單個推薦卡片樣式 */
#recommendations {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 80px 20px;
    text-align: center;
}

.section-title {
    font-size: 2.5em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 50px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #ffc800, #ff6337);
    border-radius: 2px;
}

.carousel-container {
    overflow-x: auto; /* 啟用水平滾動 */
    scroll-snap-type: x mandatory; /* 讓元素依序對齊 */
    -webkit-overflow-scrolling: touch; /* iOS 觸控順滑 */
    white-space: nowrap; /* 讓元素排成一行 */
    padding: 10px;
}

/* 確保保留觸摸滑動功能，並隱藏滾動條 */
.carousel {
    display: flex;
    gap: 10px; /* 間距 */
    cursor: grab; /* 顯示可拖曳 */
    user-select: none; /* 禁止選取文字，避免誤選 */
    scroll-snap-align: start;
}

/* 滾動條整體樣式 */
.carousel-container::-webkit-scrollbar {
    width: 8px; /* 調整滾動條寬度 */
    height: 8px; /* 橫向滾動條的高度 */
}

/* 滾動條軌道背景 */
.carousel-container::-webkit-scrollbar-track {
    background: #f0f0f0; /* 滾動條背景顏色 */
    border-radius: 10px; /* 圓角 */
}

/* 滾動條滑塊 */
.carousel-container::-webkit-scrollbar-thumb {
    background: #a1a1a1; /* 滑塊顏色 */
    border-radius: 10px; /* 圓角 */
}

/* 滑鼠懸停時的滾動條滑塊 */
.carousel-container::-webkit-scrollbar-thumb:hover {
    background: hwb(0 35% 65%); /* 滑鼠懸停時的顏色 */
}

/* 單個推薦卡片樣式 */
.recommendation-item {
    max-width: 320px;
    min-width: 320px;
    padding: 25px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    white-space: normal;
    scroll-snap-align: center;
    border: 1px solid rgba(255, 200, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recommendation-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* 引言文字樣式 */
.quote {
    font-size: 1.1em;
    font-style: italic;
    color: #34495e;
    margin-bottom: 15px;
    line-height: 1.6;
    position: relative;
}

.quote::before {
    content: '"';
    font-size: 2em;
    color: #ffc800;
    position: absolute;
    top: -10px;
    left: -10px;
}

.quote::after {
    content: '"';
    font-size: 2em;
    color: #ffc800;
    position: absolute;
    bottom: -20px;
    right: -5px;
}

/* 作者樣式 */
.author {
    font-size: 0.95em;
    color: #7f8c8d;
    font-weight: 600;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #ffc800;
    text-align: right;
}

.big-button {
    display: inline-block;
    padding: 15px 50px;
    font-size: 1.5em;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50px;
    text-align: center;
    text-decoration: none; /* 移除超連結的下劃線 */
    cursor: pointer;
    transition: all 0.3s ease;
}

.big-button:hover {
    background-color: #ff4757;
    transform: scale(1.1);
}

/* 幻燈片區域樣式 */
#restaurant-slices {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #eeeeee 0%, #f8f9fa 100%);
    padding: 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 380px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 幻燈片容器 */
.slider {
    position: relative;
    width: 100%;
    height: 100%; /* 高度固定 */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 幻燈片 */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; /* 預設透明 */
    z-index: -1;
    transition: opacity 0.5s ease-in-out;
    background-size: contain; /* 確保圖片完整顯示 */
    background-repeat: no-repeat; /* 禁止重複 */
    background-position: center; /* 圖片居中 */
}

/* 激活的幻燈片 */
.slide.active {
    opacity: 1; /* 使當前幻燈片可見 */
    z-index: 1;
}

/* 幻灯片控制器 */
.slider-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(5px);
}

/* 圆点样式 */
.slider-dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.slider-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

/* 当前激活的圆点 */
.slider-dot.active {
    background-color: #ffc800;
    border-color: white;
    transform: scale(1.3);
}

/* Service Flow */
#serviceflow {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 80px 20px;
    position: relative;
}

#serviceflow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="rgba(0,0,0,0.05)"/><circle cx="80" cy="40" r="1" fill="rgba(0,0,0,0.05)"/><circle cx="40" cy="80" r="1" fill="rgba(0,0,0,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

#serviceflow img {
    max-height: 450px;
    height: auto;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 懸浮按鈕樣式（使用圖片） */
.floating-line-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    z-index: 2000;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    background: linear-gradient(135deg, #00e676 0%, #00c853 100%);
}

@keyframes pulse {
    0% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(0, 230, 118, 0.7);
    }
    70% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 0 15px rgba(0, 230, 118, 0);
    }
    100% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(0, 230, 118, 0);
    }
}

.floating-line-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.line-icon {
    width: 80%;
    height: 80%;
    object-fit: cover;
    border-radius: 50%;
}

#find-service {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    padding: 80px 0;
}

#find-service::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60"><defs><pattern id="grid" width="60" height="60" patternUnits="userSpaceOnUse"><path d="M 60 0 L 0 0 0 60" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.container {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.block {
    flex: 1;
    border-radius: 15px;
    padding: 30px;
    min-height: 220px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
}

.block:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.block[data-color="primary"] {
    background-color: #004650;
}

.block[data-color="secondary"] {
    background-color: #ff6337;
}

.block[data-color="tertiary"] {
    background-color: #ffc800;
}

.description {
    position: absolute;
    top: 30px;
    left: 30px;
    font-size: 1.2em;
    color: #fff;
    line-height: 1.5;
    font-weight: 500;
    max-width: calc(100% - 60px);
}

.description[data-color="tertiary"] {
    color: #2c3e50;
    font-weight: 600;
}

.action-button {
    position: absolute;
    bottom: 30px;
    left: 30px;
    padding: 12px 25px;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.action-button[data-color="primary"] {
    background-color: #087c86;
}

.action-button[data-color="secondary"] {
    background-color: #f6aa26;
}

.action-button[data-color="tertiary"] {
    background-color: #ffa200;
}

/* Responsive Design */
@media (max-width: 768px) {
    #home .slogan {
        font-size: 1.8em;
        padding: 25px 30px;
        margin: 0 20px;
    }

    .section-title {
        font-size: 2em;
        margin-bottom: 40px;
    }

    #recommendations {
        padding: 60px 20px;
    }

    .recommendation-item {
        max-width: 280px;
        min-width: 280px;
        padding: 20px;
    }

    .container {
        flex-direction: column;
        gap: 25px;
        padding: 40px 20px;
    }

    .block {
        min-height: 180px;
        padding: 25px;
    }

    .description {
        font-size: 1.1em;
        top: 25px;
        left: 25px;
        max-width: calc(100% - 50px);
    }

    .action-button {
        bottom: 25px;
        left: 25px;
        padding: 10px 20px;
        font-size: 0.9em;
    }

    #serviceflow {
        padding: 60px 20px;
    }

    #serviceflow img {
        max-height: 350px;
        padding: 15px;
    }
}

@media (max-width: 540px) {
    .menu-toggle {
        display: flex;
    }

    .nav-buttons {
        position: fixed;
        top: 0;
        right: -100%;
        flex-direction: column;
        background-color: white;
        height: 100vh;
        width: 70%;
        align-items: center;
        padding-top: 50px;
        transition: right 0.3s ease;
        z-index: 1500;
    }

    .nav-buttons.active {
        right: 0;
    }

    .nav-button {
        font-size: 1.5em;
        padding: 15px;
    }

    /* 汉堡菜单动画 */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    #home .slogan {
        font-size: 1.5em;
        padding: 20px 25px;
        margin: 0 15px;
    }

    .section-title {
        font-size: 1.8em;
    }

    #restaurant-slices {
        height: 200px;
        padding: 5px 0;
    }

    .scroll-offset {
        scroll-margin-top: 60px;
    }

    .carousel-container::-webkit-scrollbar {
        display: none;
    }
    
    .carousel-container {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .floating-line-button {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
    }

    .container {
        padding: 0 15px;
    }
}
