/* GO食專用樣式 */

/* 頂部搜尋區 */
.gofood-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 15px 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 480px;
    margin: 0 auto;
}

.back-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

.back-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.search-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 25px;
    padding: 0 15px;
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 10px;
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    padding: 12px 0;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-secondary);
    font-size: 16px;
}

.clear-search {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.clear-search:hover {
    background-color: var(--light-bg);
}

/* 主要內容區 */
.gofood-main {
    padding: 20px;
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 100px; /* 為底部CTA留空間 */
}

/* 餐廳容器 */
.restaurants-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 餐廳卡片 */
.restaurant-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.restaurant-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.restaurant-card:active {
    transform: translateY(-1px);
}

/* 餐廳照片輪播區 */
.restaurant-photos {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.photo-carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.photo-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.photo-slide.active {
    opacity: 1;
}

.photo-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* 圖片載入失敗的佔位符 */
.photo-slide .image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--light-bg) 0%, var(--secondary-color) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    gap: 10px;
}

.photo-slide .image-placeholder::before {
    content: '🍽️';
    font-size: 48px;
}

.photo-slide .image-placeholder::after {
    content: attr(data-restaurant-name);
    font-size: 16px;
    opacity: 0.8;
}

.photo-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.photo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.photo-dot.active {
    background: var(--white);
}

/* 營業狀態徽章 */
.status-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    backdrop-filter: blur(10px);
}

.status-badge.open {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.status-badge.closed {
    background: linear-gradient(135deg, #F44336, #EF5350);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.4);
}

/* 收藏按鈕 */
.favorite-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.favorite-btn:hover {
    background: var(--white);
    transform: scale(1.1);
}

.favorite-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.favorite-btn.favorited svg {
    color: #E91E63;
}

/* 餐廳資訊 */
.restaurant-info {
    padding: 20px;
}

.restaurant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.restaurant-name {
    font-size: 20px; /* 增大字型 */
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.restaurant-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.restaurant-tags::-webkit-scrollbar {
    display: none;
}

.tag {
    background: var(--light-bg);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 14px; /* 增大字型 */
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.restaurant-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px; /* 增大字型 */
}

.detail-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.detail-text {
    color: var(--text-primary);
    flex: 1;
    line-height: 1.4;
}

.hours-text {
    font-weight: 500;
}

.distance-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s;
}

.distance-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 載入指示器 */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 30px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--light-bg);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator span {
    font-size: 16px; /* 增大字型 */
    font-weight: 500;
}

/* 無結果提示 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 20px; /* 增大字型 */
    margin-bottom: 10px;
    color: var(--text-primary);
}

.no-results p {
    font-size: 16px; /* 增大字型 */
}

/* 底部固定CTA */
.gofood-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--white);
    border-top: 1px solid rgba(46, 139, 139, 0.2);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.bottom-cta {
    display: flex;
    justify-content: center;
    max-width: 480px;
    margin: 0 auto;
    padding: 15px 20px;
    gap: 15px;
}

.cta-btn {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    padding: 15px 10px;
    color: var(--white);
    font-size: 16px; /* 增大字型 */
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    min-height: 70px;
}

.cta-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 139, 139, 0.3);
}

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

.cta-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cta-btn span {
    font-size: 14px; /* 增大字型 */
    text-align: center;
    line-height: 1.2;
}

/* 收藏模式樣式 */
.favorites-mode .cta-btn:last-child {
    background: linear-gradient(135deg, #E91E63, #F06292);
}

.favorites-mode .cta-btn:last-child:hover {
    background: linear-gradient(135deg, #F06292, #F48FB1);
}

/* 響應式設計 */
@media (min-width: 481px) and (max-width: 768px) {
    .gofood-main {
        max-width: 600px;
        padding: 25px;
        padding-bottom: 120px;
    }
    
    .search-container {
        max-width: 600px;
        padding: 0 25px;
    }
    
    .restaurant-photos {
        height: 240px;
    }
    
    .restaurant-name {
        font-size: 22px;
    }
    
    .restaurant-info {
        padding: 25px;
    }
    
    .detail-row {
        font-size: 17px;
    }
    
    .cta-btn {
        padding: 18px 12px;
        font-size: 17px;
        min-height: 80px;
    }
    
    .bottom-cta {
        padding: 20px 25px;
    }
}

@media (min-width: 769px) {
    .gofood-main {
        max-width: 800px;
        padding: 30px;
        padding-bottom: 140px;
    }
    
    .search-container {
        max-width: 800px;
        padding: 0 30px;
    }
    
    .restaurant-photos {
        height: 280px;
    }
    
    .restaurant-name {
        font-size: 24px;
    }
    
    .restaurant-info {
        padding: 30px;
    }
    
    .detail-row {
        font-size: 18px;
    }
    
    .cta-btn {
        padding: 20px 15px;
        font-size: 18px;
        min-height: 90px;
    }
    
    .bottom-cta {
        padding: 25px 30px;
        gap: 20px;
    }
}

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

.restaurant-card {
    animation: slideInUp 0.5s ease-out;
}

/* 水平滾動優化 */
.restaurant-tags {
    -webkit-overflow-scrolling: touch;
}

/* 觸控友善 */
@media (hover: none) and (pointer: coarse) {
    .restaurant-card:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
    
    .cta-btn:hover {
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        transform: none;
        box-shadow: none;
    }
}

/* 高對比度支援 */
@media (prefers-contrast: high) {
    .status-badge.open {
        background: #2E7D32;
    }
    
    .status-badge.closed {
        background: #D32F2F;
    }
    
    .restaurant-card {
        border: 2px solid var(--primary-color);
    }
}
