/* ==========================================================================
   Lucky Logistics Platform - Master Template Stylesheet
   ==========================================================================

   Version: 1.0.0
   Last Updated: 2025-09-30
   Architecture: Mobile-First + Progressive Enhancement

   CSS Layers:
   1. Base (Reset, Variables, Typography)
   2. Layout (Header, Main, Footer)
   3. Components (Logo, Navigation, Loading, Notifications)
   4. Utilities (Responsive, Helpers)
   5. Themes (Luxury Purple Gradient)

   Breakpoints:
   - Mobile: 0-767px (default)
   - Tablet: 768-1023px
   - Desktop: 1024px+
   - Large Desktop: 1440px+

   ========================================================================== */

/* === 1. Base Layer === */

@import url('1-base/reset.css');
@import url('1-base/variables.css');
@import url('1-base/typography.css');

/* === 2. Layout Layer === */

@import url('2-layout/header.css');
@import url('2-layout/main-content.css');
@import url('2-layout/footer.css');

/* === 3. Components Layer === */

@import url('3-components/logo.css');
@import url('3-components/navigation.css');
@import url('3-components/mobile-nav.css');
@import url('3-components/loading.css');
@import url('3-components/notifications.css');

/* === 4. Utilities Layer === */

@import url('4-utilities/responsive.css');
@import url('4-utilities/helpers.css');

/* === 5. Themes Layer === */

@import url('5-themes/luxury-theme.css');

/* ==========================================================================
   Global Overrides (if needed)
   ========================================================================== */

/* Focus Visible for Accessibility */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove focus outline for mouse users */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .mobile-bottom-nav,
  .notification-container,
  .loading-screen {
    display: none !important;
  }

  .main-content {
    min-height: auto;
    padding: 0;
  }

  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* ========================================
   語言切換器完整樣式 - v3版本
   修復: 移除所有 !important，使用正確的CSS優先級
   ======================================== */

/* 容器 */
.lang-switcher {
    position: relative;
    display: inline-block;
    z-index: 100;
    margin-left: 12px;
}

/* 觸發按鈕 - 白色背景，紫色邊框 */
.lang-switcher__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffffff;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.lang-switcher__trigger:hover {
    background: #f8f9fa;
    border-color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.lang-switcher__trigger:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.lang-switcher__trigger[aria-expanded="true"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-color: #764ba2;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.lang-switcher__trigger[aria-expanded="true"] .lang-switcher__name {
    color: #ffffff;
}

.lang-switcher__trigger[aria-expanded="true"] .lang-switcher__arrow {
    color: #ffffff;
}

/* 按鈕元素 */
.lang-switcher__flag {
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.lang-switcher__name {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.lang-switcher__arrow {
    color: #667eea;
    transition: transform 0.3s ease;
}

.lang-switcher__trigger[aria-expanded="true"] .lang-switcher__arrow {
    transform: rotate(180deg);
}

/* 下拉選單 - 預設隱藏 */
.lang-switcher__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 240px;
    max-width: 320px;
    background: transparent;
    border: 2px solid #667eea;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2),
                0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    overflow: hidden;
}

/* 展開時顯示 */
.lang-switcher__dropdown[aria-hidden="false"] {
    display: block;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 選項列表 */
.lang-switcher__list {
    padding: 8px;
    max-height: 420px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 10px;
}

/* 自定義滾動條 */
.lang-switcher__list::-webkit-scrollbar {
    width: 8px;
}

.lang-switcher__list::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.lang-switcher__list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

.lang-switcher__list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #764ba2 0%, #667eea 100%);
}

/* 選項項目 - 白色背景，漸層 hover */
.lang-switcher__option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin: 4px 0;
    background: #ffffff;
    color: #2d3748;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.lang-switcher__option:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e9ecff 100%);
    border-color: #667eea;
    transform: translateX(4px);
    text-decoration: none;
}

.lang-switcher__option:focus {
    outline: none;
    background: linear-gradient(135deg, #e9ecff 0%, #dce3ff 100%);
    border-color: #764ba2;
    text-decoration: none;
}

.lang-switcher__option--active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-weight: 600;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    text-decoration: none;
}

.lang-switcher__option--active:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateX(4px);
    text-decoration: none;
}

/* 選項元素 */
.lang-switcher__option-flag {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    text-decoration: none;
}

.lang-switcher__option-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.lang-switcher__option--active .lang-switcher__option-name {
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
}

.lang-switcher__option-check {
    color: #ffffff;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* ===== 響應式設計 ===== */

/* 桌面版 (>768px) - 顯示完整語言名稱 */
@media (min-width: 769px) {
    .lang-switcher__name {
        display: inline-block;
    }
}

/* 平板和手機版 (≤768px) - 只顯示旗幟 */
@media (max-width: 768px) {
    .lang-switcher {
        margin-left: 8px;
    }

    .lang-switcher__trigger {
        padding: 8px 12px;
        font-size: 13px;
    }

    .lang-switcher__name {
        display: none;
    }

    .lang-switcher__flag {
        font-size: 22px;
    }

    .lang-switcher__dropdown {
        position: fixed;
        top: 70px;
        right: 10px;
        left: auto;
        min-width: 280px;
        max-width: calc(100vw - 20px);
        border-radius: 16px;
    }

    .lang-switcher__list {
        max-height: calc(100vh - 180px);
    }

    .lang-switcher__option {
        padding: 14px 16px;
    }

    .lang-switcher__option-flag {
        font-size: 26px;
    }

    .lang-switcher__option-name {
        font-size: 16px;
    }
}

/* 小手機版 (≤480px) */
@media (max-width: 480px) {
    .lang-switcher__dropdown {
        top: 65px;
        right: 8px;
        min-width: 260px;
    }

    .lang-switcher__list {
        max-height: calc(100vh - 150px);
        padding: 6px;
    }

    .lang-switcher__option {
        padding: 12px 14px;
    }
}

/* 深色模式支援 - 已停用，強制使用白色背景 */
/* 如需啟用深色模式，請取消註釋以下代碼 */
/*
@media (prefers-color-scheme: dark) {
    .lang-switcher__trigger {
        background: #1a202c;
        border-color: #667eea;
        color: #f7fafc;
    }

    .lang-switcher__trigger:hover {
        background: #2d3748;
        border-color: #764ba2;
    }

    .lang-switcher__trigger[aria-expanded="true"] {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #ffffff;
    }

    .lang-switcher__name {
        color: #f7fafc;
    }

    .lang-switcher__dropdown {
        background: transparent;
        border-color: #667eea;
    }

    .lang-switcher__list {
        background: #1a202c;
    }

    .lang-switcher__option {
        background: #2d3748;
        color: #f7fafc;
        border-color: #4a5568;
    }

    .lang-switcher__option:hover {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
        border-color: #667eea;
    }

    .lang-switcher__option--active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #ffffff;
    }

    .lang-switcher__list::-webkit-scrollbar-track {
        background: #2d3748;
    }

    .lang-switcher__list::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    }
}
*/

