/* ==========================================================================
   SAWA888 Premium UI/UX Styles
   ========================================================================== */

:root {
    /* Color Palette */
    --primary: #ffab1a;          /* Vibrant Gaming Red */
    --primary-dark: #cc8100;
    --primary-glow: rgba(255, 152, 26, 0.4);
    
    --bg-dark: #01273c;          /* Deep rich black/slate */
    --bg-surface: #4c4c4c2b;       /* Slightly elevated surface */
    --bg-card: #4388ff5e;          /* Card background */
    --bg-hover: #331000;         /* Card hover */
    
    --text-main: #ffffff;
    --text-muted: #ffffff;
    
    --border: #302b23;
    
    /* Glassmorphism */
    --glass-bg: rgba(16, 19, 77, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6cbaff 0%, #004cff 100%);
    
    /* Animations */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 80px; /* Space for FAB */
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
}

.logo img {
    height: 42px;
    max-width: 200px;
    object-fit: contain;
    transition: var(--transition);
}

.logo:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.auth-btns {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.btn-login {
    background: #a490ff;
    border: 2px outset #ffffff;
    color: #000000;
}

.btn-login:hover {
    background: rgba(159, 218, 243, 0.847);
    border-color: var(--text-muted);
}

.btn-register {
    background: var(--gradient-primary);
    border: 2px outset #ffffff;
    color: rgb(0, 0, 0);
    box-shadow: 0 4px 15px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.btn-register::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(30deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

/* ==========================================================================
   Category Navigation
   ========================================================================== */
.cat-nav {
    background: #01448d;
    border-bottom: 1px solid #ffffff;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.cat-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.cat-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    padding: 12px 15px;
    gap: 15px;
}

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    min-width: 80px;
    padding: 8px;
    border-radius: 12px;
}

.cat-item img {
    height: 28px;
    filter: grayscale(100%) opacity(0.6);
    transition: var(--transition);
}

.cat-item:hover,
.cat-item.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.cat-item.active {
    background: #ffeaa472;
    box-shadow: inset 0 -2px 0 #fdfffd;
}

.cat-item:hover img,
.cat-item.active img {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    max-width: 1200px;
    margin: 20px auto;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 0 15px;
}

.hero img {
    width: 100%;
    display: block;
    border-radius: 16px;
}

/* ==========================================================================
   Sections & Titles
   ========================================================================== */
.section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 15px;
}

.sec-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 25px;
    position: relative;
    padding-left: 15px;
}

.sec-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 24px;
    background: var(--gradient-primary);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* ==========================================================================
   Game Cards Grid
   ========================================================================== */
.grid-games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.game-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.game-card:hover {
    border-color: #ffffff;
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(255, 26, 43, 0.15);
}

.game-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.game-card:hover img {
    filter: brightness(0.6);
    transform: scale(1.05);
}

.game-info {
    padding: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    background: var(--bg-card);
    position: relative;
    z-index: 2;
}

.play-btn {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: var(--gradient-primary);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 20px var(--primary-glow);
    z-index: 3;
    font-size: 18px;
    padding-left: 4px; /* visually center play triangle */
}

.game-card:hover .play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ==========================================================================
   Top Providers Grid
   ========================================================================== */
.grid-providers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
}

.prov-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    white-space: nowrap;
    transition: var(--transition);
    font-weight: 500;
    color: var(--text-muted);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.prov-card img {
    transition: var(--transition);
    filter: grayscale(100%) opacity(0.7);
}

.prov-card:hover {
    background: #004cff;
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.prov-card:hover img {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

/* ==========================================================================
   Banks Section
   ========================================================================== */
.banks-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    background: var(--bg-card);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.bank-item {
    background: #ffffff;
    padding: 6px;
    border-radius: 8px;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.bank-item:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(255,255,255,0.1);
}

.bank-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   SEO Article (Editorial Style)
   ========================================================================== */
.seo-article {
    color: #b0b5c9;
    line-height: 1.8;
    padding: 35px;
    background: var(--bg-surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    max-width: 1200px;
    margin: 40px auto;
    font-size: 1.05rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.seo-article h1,
.seo-article h2,
.seo-article h3 {
    color: var(--text-main);
    margin-top: 35px;
    margin-bottom: 15px;
    font-weight: 600;
}

.seo-article h1 {
    font-size: 2.2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 15px;
    margin-top: 0;
    position: relative;
}

.seo-article h1::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: var(--primary);
}

.seo-article h2 {
    font-size: 1.7rem;
    color: var(--text-main);
}

.seo-article h3 {
    font-size: 1.3rem;
    color: var(--primary);
}

.seo-article p {
    margin-bottom: 20px;
}

.seo-article ul,
.seo-article ol {
    margin-bottom: 25px;
    padding-left: 20px;
}

.seo-article li {
    margin-bottom: 15px;
    line-height: 1.7;
    position: relative;
    padding-left: 10px;
}

.seo-article ul li::marker {
    color: var(--primary);
}

.seo-article li strong {
    color: var(--text-main);
}

/* Editorial TOC */
.toc-box {
    background: var(--bg-card);
    border-left: 4px solid var(--primary);
    padding: 25px;
    border-radius: 0 12px 12px 0;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.toc-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-main);
}

.toc-box ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.toc-box ul li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 20px;
}

.toc-box ul li::before {
    content: 'â–¶';
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 10px;
    color: var(--primary);
}

.toc-box ul li a {
    color: var(--text-muted);
}

.toc-box ul li a:hover {
    color: var(--primary);
}

/* Editorial Table */
.seo-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 30px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.seo-table th,
.seo-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.seo-table th {
    background: var(--bg-card);
    color: var(--text-main);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.seo-table tr:last-child td {
    border-bottom: none;
}

.seo-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* Step Boxes */
.step-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    padding: 18px 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    transition: var(--transition);
}

.step-box:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.step-box strong {
    color: var(--text-main);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 5px;
}

/* ==========================================================================
   Author Profile
   ========================================================================== */
.author-profile {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    padding: 30px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.author-text {
    flex: 1;
    min-width: 250px;
}

.author-text h3 {
    color: var(--text-main);
    font-size: 1.4rem;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.author-text p {
    color: var(--text-muted);
    margin-bottom: 10px;
    font-size: 1rem;
    line-height: 1.6;
}

.author-text strong {
    color: var(--text-main);
}

.author-image img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
    transition: var(--transition);
}

.author-image img:hover {
    transform: scale(1.05) rotate(5deg);
}

/* ==========================================================================
   Mobile Floating Action Bar (FAB)
   ========================================================================== */
.fab-mobile {
    display: none;
    position: fixed;
    bottom: 15px;
    left: 15px;
    right: 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 10px;
    z-index: 100;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

/* ==========================================================================
   Footer Bottom
   ========================================================================== */
.footer {
    background: #020252;
    padding: 40px 15px 20px;
    margin-top: 60px;
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.table-responsive { 
    overflow-x: auto; 
    width: 100%; 
}

.prov-card img { 
    max-height: 35px; 
    max-width: 100%; 
    object-fit: contain; 
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 768px) {
    .header-container {
        justify-content: center;
    }

    .cat-container {
        justify-content: flex-start;
        padding-left: 20px;
        padding-right: 20px;
    }

    .auth-btns {
        display: none;
    }

    .fab-mobile {
        display: flex;
        gap: 10px;
    }

    .fab-mobile .btn {
        flex: 1;
        padding: 12px;
        font-size: 15px;
        border-radius: 50px;
    }

    .hero-text h1 {
        font-size: 1.8rem;
    }

    .grid-games {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 15px;
    }
    
    .grid-providers {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .seo-article {
        padding: 20px;
    }
    
    .author-profile {
        flex-direction: column-reverse;
        text-align: center;
    }
    
    .author-text h3 {
        text-align: center;
    }
}


/* ==========================================================================
   Popup Overlay
   ========================================================================== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.popup-content {
    background: #000000;
    border: 1px outset rgb(255, 149, 0);
    border-radius: 20px;
    padding: 0; /* Edge to edge */
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,0.8);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; /* Clips image corners to match radius */
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.popup-img-wrapper {
    width: 100%;
    position: relative;
}

.popup-image {
    width: 100%;
    
    display: block;
    margin: 0;

    aspect-ratio: 1 / 1;
    object-fit: cover;}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(255, 174, 0, 0.807);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px outset rgb(255, 255, 255);
    border-radius: 50%;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: var(--transition);
    z-index: 10;
}

.popup-close:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1) rotate(90deg);
}

.popup-actions {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-surface);
}

.popup-auth-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-login-popup, .btn-register-popup, .btn-line-popup {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    text-decoration: none;
}

/* Login - Outline */
.btn-login-popup {
    background: rgba(255, 255, 255, 0.05);
    border: 2px outset #ffab1a;
    color: var(--text-main);
}
.btn-login-popup:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ff0000;
}

/* Register - Solid Primary */
.btn-register-popup {
    background: var(--gradient-primary);
    color: white;
    border: 2px outset #ffab1a;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-register-popup:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

/* Line - Solid Green */
.btn-line-popup {
    background: #00c300;
    color: white;
    border: 2px outset #fff;
    box-shadow: 0 4px 15px rgba(0, 195, 0, 0.2);
    gap: 8px; /* For icon */
}
.btn-line-popup:hover {
    background: #00a000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 195, 0, 0.4);
}


/* ==========================================================================
   Provider Platform Section (Merged from provider.css)
   ========================================================================== */
/* Provider Platform Section */
.provider-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background: #0d0d0d;
    border-radius: 8px;
    border: 1px solid #222;
}

.footer-section-title {
    color: var(--primary, #e50914);
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.provider-container {
    margin-bottom: 35px;
}

.provider-container:last-child {
    margin-bottom: 0;
}

.provider-container h5 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-left: 12px;
    border-left: 4px solid var(--primary, #e50914);
}

.hover-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

.hover-list li {
    width: 130px;
    height: 60px;
    background: #151515;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    border: 1px solid #333;
    transition: all 0.3s ease;
    cursor: pointer;
}

.hover-list li picture {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

.hover-list li picture:nth-child(2) {
    display: none;
}

.hover-list li:hover picture:first-child:not(:last-child) {
    display: none;
}

.hover-list li:hover picture:nth-child(2) {
    display: flex;
}

.hover-list li img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.hover-list li:hover {
    border-color: var(--primary, #e50914);
    background: #1a1a1a;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.15);
}

.hover-list li:hover img {
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
    .provider-section {
        padding: 20px;
        margin: 30px 15px;
    }
    
    .hover-list {
        justify-content: center;
        gap: 10px;
    }
    
    .hover-list li {
        width: 105px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .hover-list li {
        width: 85px;
        height: 45px;
    }
}


/* ==========================================================================
   Cleanup Extracted Styles
   ========================================================================== */
.hero-banner-section {
    max-width: 1200px;
    margin: 20px auto;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 0 15px;
}

.hero-banner-img {
    width: 100%;
    aspect-ratio: 1170 / 450;
    display: block;
    border-radius: 16px;
    object-fit: cover;
    object-position: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.footer-copyright {
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 20px;
    padding-bottom: 80px;
    color: var(--text-muted);
    font-size: 0.9rem;
}


@media (max-width: 576px) {
    .grid-games, .grid-providers {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .game-card .game-info {
        font-size: 13px;
        padding: 8px;
    }
    .prov-card span {
        font-size: 13px;
    }
    .hero-banner-section {
        padding: 0 10px;
        margin: 10px auto;
    }
}
