/* 
 * 關鍵渲染路徑 CSS
 * 這個檔案包含首屏顯示必需的樣式
 */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #ffd700;
    --text-color: #333;
    --text-secondary: #666;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 4px 20px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* 基礎重置和字體 */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', 'PingFang TC', 'Noto Sans TC', sans-serif;
    margin: 0;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    font-display: swap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 標題層次 */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
}

/* 連結樣式 */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* 頁面頂部 */
.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-color);
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    color: var(--accent-color);
}

.nav {
    display: flex;
    align-items: center;
}

.nav a {
    color: white;
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: var(--transition);
}

.nav a:hover {
    background: rgba(255, 215, 0, 0.1);
    color: var(--accent-color);
}

/* 英雄區塊 */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 4rem 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::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><radialGradient id="g"><stop offset="20%" stop-color="%23ffffff" stop-opacity="0.1"/><stop offset="50%" stop-color="%23ffffff" stop-opacity="0.05"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><rect width="100" height="100" fill="url(%23g)"/></svg>');
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero h1 {
    margin: 0 0 1rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2rem;
    margin: 0 0 2rem;
    opacity: 0.9;
    color: white;
}

/* CTA按鈕 */
.cta-button {
    background: var(--accent-color);
    color: #1a1a2e;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    color: #1a1a2e;
}

/* 主要內容容器 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

/* 區塊標題 */
.section-title {
    font-size: 2rem;
    text-align: center;
    margin: 3rem 0 2rem;
    color: var(--text-color);
    font-weight: 600;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* 娛樂城卡片網格 */
.casino-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.casino-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.casino-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

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

.casino-card h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.rating {
    color: #ffa500;
    font-weight: bold;
    margin: 0.5rem 0 1rem;
    font-size: 1.1rem;
}

.casino-card p {
    margin: 0.75rem 0;
    line-height: 1.5;
}

.casino-card strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* 按鈕樣式 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    margin-top: 1rem;
    width: 100%;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .hero h1 { 
        font-size: 2rem; 
    }
    
    .main-content { 
        padding: 2rem 1rem; 
    }
    
    .casino-grid { 
        grid-template-columns: 1fr; 
        gap: 1.5rem; 
    }
    
    .hero { 
        padding: 2rem 0; 
    }
    
    .nav {
        display: none; /* 移動版隱藏導航，可實作漢堡選單 */
    }
    
    .header-container {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero h1 { 
        font-size: 1.8rem; 
    }
    
    .hero p { 
        font-size: 1rem; 
    }
    
    .cta-button { 
        padding: 0.8rem 1.5rem; 
        font-size: 1rem; 
    }
    
    .casino-card {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

/* 載入狀態 */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.5) 37%, transparent 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 可訪問性優化 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦點樣式 */
button:focus,
a:focus,
input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 高對比度模式支援 */
@media (prefers-contrast: high) {
    :root {
        --text-color: #000;
        --bg-color: #fff;
        --border-color: #000;
    }
    
    .casino-card {
        border: 2px solid var(--text-color);
    }
    
    .btn-primary {
        border: 2px solid white;
    }
}

/* 減少動畫偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
