:root {
    /* Sunset Boulevard Theme Variables */
    --primary: #e76f51;
    /* Burnt Orange */
    --primary-dark: #c3553a;
    /* Darker Orange for hover */
    --secondary: #f4a261;
    /* Coral */
    --accent: #e9c46a;
    /* Warm Sand */
    --text-dark: #264653;
    /* Deep Purple/Blue */
    --text-light: #ffffff;
    --bg-light: #fff8f5;
    /* Very pale warm white */
    --bg-white: #ffffff;

    /* Brand identity red - reserved for header/nav only, not a content accent */
    --brand-red: #952B32;
    --brand-red-light: #c13e44;
    --brand-red-rgb: 149, 43, 50;

    /* Modern UI Variables */
    --glass: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 2px 4px rgba(38, 70, 83, 0.05);
    /* Tinted subtle shadow */
    --shadow-md: 0 4px 6px rgba(38, 70, 83, 0.1);
    --shadow-lg: 0 10px 15px rgba(38, 70, 83, 0.1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
}

/* Common Components */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--text-light);
}

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

.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.badge.bg-primary {
    background-color: var(--primary) !important;
}

/* Bring stray Bootstrap defaults (blue focus rings, blue breadcrumb links) into the brand palette */
.form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(244, 162, 97, 0.25);
}

.breadcrumb-item a {
    color: var(--primary);
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
}

.breadcrumb-item.active {
    color: var(--text-dark);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #ccc;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

/* Animation Utilities */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* 輪播圖動畫效果 */
#carouselExampleCaptions {
    transition: all 0.3s ease-in-out;
    transform: translateY(0);
    opacity: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

#carouselExampleCaptions:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* 標題區塊樣式 - 移除動畫效果 */
.title {
    position: relative;
    font-family: var(--font-heading);
    color: var(--text-dark);
}

/* RWD 優化的行區塊 */
.row.mt-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

/* 菜單圖片基本樣式 */
.menuPicture {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.HomeURLImage img {
    width: 100%;
    height: auto;
    display: block;
}

/* 最新消息表格動畫 */
#NEWS tr {
    transition: all 0.2s ease-in-out;
}

#NEWS tr:hover {
    background-color: rgba(231, 111, 81, 0.05);
    /* Primary color low opacity */
    transform: translateX(5px);
}

/* RWD 響應式設計 */
@media (max-width: 768px) {
    .row.mt-3 {
        grid-template-columns: repeat(1, 1fr);
        gap: 1rem;
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .row.mt-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.menu-container {
    padding: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

.menu-item {
    margin-bottom: 16px;
    transition: transform 0.3s ease;
    /* 設定固定寬高且防止覆寫 */
    width: 280px !important;
    height: 200px !important;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    padding: 0 !important;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.menu-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.menu-item a {
    width: 280px !important;
    height: 200px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.menu-item img {
    /* 固定圖片尺寸且防止任何覆寫 */
    width: 210px !important;
    height: 200px !important;
    object-fit: cover !important;
    border-radius: 10px;
    transition: transform 0.5s ease;
    /* 防止任何形式的縮放 */
    max-width: none !important;
    flex-shrink: 0 !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.menu-item:hover img {
    transform: scale(1.05) !important;
}

/* 確保 col-auto 不會影響固定寬度 */
.col-auto {
    padding: 10px !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
}

/* 移除可能影響固定寬度的樣式 */
.row {
    margin: 0 !important;
}

/* News styles */
.news-sidebar {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.btn-news {
    background: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid #eee;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-news:hover,
.btn-news.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 10px;
}

/* Enhanced News Card Styles */
.news-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.news-image {
    position: relative;
    overflow: hidden;
    padding-top: 60%;
}

.news-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.news-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(231, 111, 81, 0.3);
    /* Primary color overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
}

.read-more {
    color: white;
    font-size: 1.1rem;
    padding: 10px 24px;
    border: 2px solid white;
    border-radius: 30px;
    transform: translateY(20px);
    transition: all 0.4s ease;
    background: rgba(38, 70, 83, 0.7);
    /* Dark text color bg */
    backdrop-filter: blur(4px);
}

.news-card:hover .news-overlay {
    opacity: 1;
}

.news-card:hover .read-more {
    transform: translateY(0);
}

.news-card:hover .news-image img {
    transform: scale(1.1);
}

.news-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-title {
    margin: 0 0 12px 0;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    font-family: var(--font-heading);
}

.news-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-title a:hover {
    color: var(--primary);
}

.news-date {
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.news-excerpt {
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
    margin-top: auto;
}

/* Back to Top Button */
.back-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Improved Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 50px 0;
}

.paginationjs .paginationjs-pages li>a {
    border-radius: 50%;
    min-width: 45px;
    height: 45px;
    line-height: 45px;
    padding: 0;
    text-align: center;
    background: var(--bg-white);
    color: var(--text-dark);
    font-weight: 600;
    border: 1px solid #eee;
    transition: all 0.3s ease;
    margin: 0 4px;
    box-shadow: var(--shadow-sm);
}

.paginationjs .paginationjs-pages li.active>a {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.paginationjs .paginationjs-pages li:hover>a {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
    transform: translateY(-2px);
}

/* Title underline animation */
.title-underline {
    width: 100px;
    height: 4px;
    background: var(--primary);
    margin: 20px auto;
    position: relative;
    border-radius: 2px;
}

/* News Filter and Search Styles */
.search-box {
    position: relative;
}

.search-box input {
    padding: 12px 20px;
    padding-right: 45px;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    background: #f1f3f5;
    transition: all 0.3s ease;
}

.search-box input:focus {
    box-shadow: none;
    background: white;
    border-color: var(--secondary);
}

.search-box .search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dark, #6c757d);
    opacity: 0.5;
    pointer-events: none;
}

.category-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    padding-bottom: 12px;
    border-bottom: 2px solid #eee;
}

.news-filter {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

/* Main Menu Fixes */
.home-menu-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    padding: 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.home-menu-item {
    flex: 0 1 auto;
    /* Sized so all 7 items fit in a single centered row on desktop */
    width: 140px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
}

.home-menu-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.home-menu-item a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.home-menu-item img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.home-menu-item:hover img {
    transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .home-menu-grid {
        gap: 12px;
    }

    .home-menu-item {
        width: 85px;
        /* Still 1 row of 7 on tablets */
    }
}

@media (max-width: 768px) {
    .home-menu-grid {
        gap: 14px;
        padding: 10px;
    }

    .home-menu-item {
        width: 22%;
        /* 4 per row */
        min-width: 90px;
    }
}

@media (max-width: 480px) {
    .home-menu-item {
        width: 28%;
        /* 3 per row */
        min-width: 80px;
    }
}

/* Beautified Home News Section */
.home-news-section {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    position: relative;
}

.home-news-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.home-news-item {
    display: flex;
    align-items: center;
    background: var(--bg-white);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.home-news-item:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: var(--shadow-md);
    border-color: rgba(231, 111, 81, 0.2);
}

/* Add a subtle accent bar on the left */
.home-news-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    transform-origin: center;
}

.home-news-item:hover::before {
    transform: scaleY(1);
}

.home-news-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    margin-right: 20px;
    padding-right: 20px;
    border-right: 1px solid #eee;
    color: var(--secondary);
    font-family: var(--font-heading);
    line-height: 1;
}

.home-news-date span:first-child {
    font-size: 0.8rem;
    font-weight: 500;
}

.home-news-date .day {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.home-news-title {
    flex-grow: 1;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1.05rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.3s;
}

.home-news-item:hover .home-news-title {
    color: var(--primary-dark);
}

.home-news-item i {
    color: #ccc;
    transition: transform 0.3s, color 0.3s;
}

.home-news-item:hover i {
    color: var(--primary);
    transform: translateX(5px);
}

/* More News Button */
.btn-more-news {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    margin-top: 10px;
}

.btn-more-news:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 111, 81, 0.3);
}

.btn-more-news i {
    transition: transform 0.3s ease;
}

.btn-more-news:hover i {
    transform: translateX(5px);
}

/* Native Language Switcher Styling */
.translate-wrapper-dropdown {
    margin-left: 15px;
}

.btn-language {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 15px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    color: white !important;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.btn-language:hover,
.btn-language:focus,
.btn-language:active,
.btn-language.show {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: white !important;
}

.btn-language::after {
    margin-left: 10px;
    vertical-align: middle;
}

.language-menu {
    background: #ffffff;
    /* White background */
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    margin-top: 10px;
    min-width: 160px;
    overflow: hidden;
    /* Centering logic */
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
}

.language-menu .dropdown-item {
    color: #333333;
    /* Black text */
    border-radius: 8px;
    padding: 8px 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.language-menu .dropdown-item:hover,
.language-menu .dropdown-item:focus {
    background: #f0f0f0;
    color: #000000;
    transform: translateX(3px);
}

.translate-icon {
    margin-right: 8px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    color: white;
}