/*
 * 非關鍵CSS - 延遲載入
 * 包含進階樣式、動畫和裝飾效果
 */

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* 動畫類別 */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* 特色功能網格 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid #dee2e6;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    position: relative;
    z-index: 1;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* 遊戲區塊樣式 */
.game-section {
    margin: 3rem 0;
    padding: 2.5rem;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
    position: relative;
}

.game-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.game-section h3 {
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.game-section h4 {
    color: var(--text-color);
    margin: 2rem 0 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.game-section ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.game-section li {
    padding: 1rem 0;
    border-bottom: 1px solid #dee2e6;
    transition: var(--transition);
    position: relative;
    padding-left: 2rem;
}

.game-section li::before {
    content: '▶';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    top: 1rem;
    font-size: 0.8rem;
}

.game-section li:last-child {
    border-bottom: none;
}

.game-section li:hover {
    background: rgba(102, 126, 234, 0.05);
    padding-left: 2.5rem;
}

.game-section strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* 安全指南樣式 */
.safety-checklist {
    background: linear-gradient(135deg, #fff 0%, #f8fff8 100%);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid #d4edda;
    margin: 2rem 0;
}

.safety-checklist h3 {
    color: #28a745;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
}

.safety-checklist h3::before {
    content: '🛡️';
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.safety-checklist ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.safety-checklist li {
    padding: 1rem 0;
    border-bottom: 1px solid #e8f5e8;
    position: relative;
    padding-left: 2.5rem;
    transition: var(--transition);
}

.safety-checklist li::before {
    content: '✓';
    color: #28a745;
    font-weight: bold;
    font-size: 1.2rem;
    position: absolute;
    left: 0;
    top: 1rem;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.safety-checklist li:hover {
    background: rgba(40, 167, 69, 0.05);
    padding-left: 3rem;
}

.safety-checklist li:last-child {
    border-bottom: none;
}

.safety-checklist strong {
    color: #28a745;
    font-weight: 600;
}

/* FAQ樣式 */
.faq-container {
    max-width: 800px;
    margin: 2rem auto;
}

details {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: var(--transition);
}

details:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    list-style: none;
    position: relative;
}

summary::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

details[open] summary::after {
    content: '-';
    transform: translateY(-50%) rotate(180deg);
}

summary:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

details[open] summary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

details[open] summary::after {
    color: white;
}

details p {
    padding: 2rem;
    margin: 0;
    border-top: 1px solid var(--border-color);
    background: #fafafa;
    line-height: 1.7;
}

/* 頁腳樣式 */
.footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 3rem 0 2rem;
    text-align: center;
    margin-top: 4rem;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content p {
    margin: 0.8rem 0;
    opacity: 0.8;
    line-height: 1.6;
}

/* 特殊效果 */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.highlight-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

/* 表格樣式（如果需要） */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
}

tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* 工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
}

/* 印刷樣式 */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .header,
    .footer,
    .nav,
    .cta-button {
        display: none !important;
    }
    
    .main-content {
        padding: 0 !important;
        max-width: none !important;
    }
    
    .casino-card {
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8rem;
        color: #666;
    }
}

/* 暗色主題支援 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e0e0e0;
        --text-secondary: #b0b0b0;
        --bg-color: #1a1a2e;
        --bg-light: #16213e;
        --border-color: #333;
        --shadow: 0 4px 20px rgba(0,0,0,0.3);
    }
    
    .casino-card,
    .feature-card,
    .game-section,
    .safety-checklist {
        background: var(--bg-light);
        border-color: var(--border-color);
    }
    
    details p {
        background: var(--bg-light);
    }
    
    summary {
        background: var(--bg-light);
    }
}

/* 進階網格系統 */
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* 實用工具類別 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden { display: none; }
.visible { display: block; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* 圓角工具 */
.rounded { border-radius: 4px; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-full { border-radius: 50%; }

/* 陰影工具 */
.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: 0 8px 30px rgba(0,0,0,0.15); }

/* 邊框工具 */
.border { border: 1px solid var(--border-color); }
.border-top { border-top: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }

/* 顏色工具 */
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: #28a745; }
.text-warning { color: #ffc107; }
.text-danger { color: #dc3545; }

.bg-primary { background: var(--primary-color); }
.bg-light { background: var(--bg-light); }
.bg-white { background: white; }

/* 彈性布局工具 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* 響應式顯示工具 */
.mobile-only { display: none; }
.desktop-only { display: block; }

@media (max-width: 768px) {
    .mobile-only { display: block; }
    .desktop-only { display: none; }
}

/* 載入動畫 */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

/* 進度條 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 徽章樣式 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #333;
}

/* 卡片變體 */
.card-premium {
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
    border: 2px solid var(--accent-color);
    position: relative;
}

.card-premium::before {
    content: '推薦';
    position: absolute;
    top: -1px;
    right: 1rem;
    background: var(--accent-color);
    color: #333;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 0 0 4px 4px;
}

/* 滾動條樣式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* 選擇文字樣式 */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}
