/**
 * SlotSandbox - Pure HTML Version
 * Simple, Clean, Responsive
 */

/* ===== CSS Variables ===== */
:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-secondary: #10b981;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #0f172a;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-white: #ffffff;
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* ===== Container ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== Header ===== */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.nav a {
    color: var(--text-secondary);
    font-weight: 500;
}

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

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-white);
    padding: 3rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.hero .warning {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-top: 1.5rem;
    display: inline-block;
    max-width: 600px;
}

/* ===== Section ===== */
.section {
    padding: 3rem 0;
}

.stats-section,
.education-section {
    background: var(--bg-primary);
}

.games-section {
    background: var(--bg-primary);
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
}

/* ===== Game Grid ===== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ===== Game Card ===== */
.game-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.game-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.game-card-content {
    padding: 1rem;
}

.game-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.game-card-provider {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.game-card-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.game-card-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-rtp {
    background: #dbeafe;
    color: #1e40af;
}

.badge-volatility {
    background: #fef3c7;
    color: #92400e;
}

.badge-volatility.high {
    background: #fee2e2;
    color: #991b1b;
}

.badge-volatility.low {
    background: #d1fae5;
    color: #065f46;
}

.badge-volatility.very-high {
    background: #fed7aa;
    color: #9a3412;
    font-weight: 600;
    border: 1px solid #fb923c;
}

.badge-volatility.insane {
    background: #e9d5ff;
    color: #6b21a8;
    font-weight: 600;
    border: 1px solid #a855f7;
}

.game-card-button {
    width: 100%;
    padding: 0.75rem;
    background: var(--color-primary);
    color: var(--text-white);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.game-card-button:hover {
    background: var(--color-primary-dark);
}

/* ===== Providers Grid ===== */
.providers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.provider-card {
    background: var(--bg-primary);
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    font-weight: 600;
}

/* ===== Info Grid ===== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.info-box {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.info-box h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.info-box p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===== Warning Box ===== */
.warning-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1.5rem;
    border-radius: 8px;
}

.warning-box h3 {
    margin-bottom: 1rem;
    color: #92400e;
}

.warning-box p {
    color: #78350f;
    line-height: 1.8;
}

.warning-box strong {
    color: #92400e;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--bg-secondary);
}

.modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
}

.modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.hidden {
    display: none !important;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-dark);
    color: var(--text-white);
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.footer-section a:hover {
    color: var(--text-white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

/* ===== Responsive ===== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .modal-content {
        height: 92vh;
        max-width: 95%;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .game-card-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .modal-content {
        height: 95vh;
        max-width: 100%;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 0.75rem;
    }
    
    .modal-title {
        font-size: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: 1fr;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .section {
        padding: 2rem 0;
    }
}


/* ===== Sponsor Section ===== */
.sponsor-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.sponsor-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.sponsor-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.sponsor-header .section-title {
    color: var(--text-white);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.sponsor-header .section-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125rem;
}

.sponsor-carousel-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4rem;
}

.sponsor-carousel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.carousel-btn:hover {
    background: var(--text-white);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.carousel-btn-prev {
    left: 0;
}

.carousel-btn-next {
    right: 0;
}

.carousel-btn svg {
    color: var(--color-primary);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--text-white);
    width: 32px;
    border-radius: 6px;
}

/* Sponsor Game Card - สุดหรู! */
.game-card.sponsor {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border: 3px solid transparent;
    background-clip: padding-box;
}

.game-card.sponsor::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF6347, #FFD700);
    background-size: 300% 300%;
    border-radius: var(--border-radius);
    z-index: -1;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.game-card.sponsor::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

.game-card.sponsor:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.4);
}

.game-card.sponsor:hover::after {
    opacity: 1;
}

/* Sponsor Badge */
.sponsor-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: var(--text-primary);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

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

.sponsor-badge::before {
    content: '⭐';
    margin-right: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sponsor-carousel {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .sponsor-carousel-wrapper {
        padding: 0 3rem;
    }
}

@media (max-width: 768px) {
    .sponsor-section {
        padding: 3rem 0;
    }
    
    .sponsor-header .section-title {
        font-size: 2rem;
    }
    
    .sponsor-carousel {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .sponsor-carousel-wrapper {
        padding: 0 2.5rem;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .sponsor-header .section-title {
        font-size: 1.75rem;
    }
    
    .sponsor-header .section-subtitle {
        font-size: 1rem;
    }
    
    .sponsor-carousel-wrapper {
        padding: 0 2rem;
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
    }
}
