/* assets/css/style.css */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #007bff; /* Biru */
    --secondary-color: #6c757d; /* Abu-abu */
    --accent-color: #ffc107; /* Kuning */
    --background-dark: #1a1a1a; /* Hitam gelap */
    --background-light: #2c2c2c; /* Abu-abu gelap */
    --text-color: #f8f9fa; /* Putih */
    --border-color: #444; /* Abu-abu tua */
    --red-alert: #dc3545;
    --yellow-alert: #ffc107;
    --green-alert: #28a745;
    --card-bg: #343a40; /* Darker card background */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Header --- */
.main-header {
    background-color: var(--background-light);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--border-color);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.logo-wrapper {
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.site-logo {
    max-height: 50px; /* Adjust as needed */
    width: auto;
}

.main-header h1 {
    font-size: 2.2em;
    color: var(--accent-color);
    margin: 0;
    text-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
}

.header-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-daftar {
    background-color: var(--primary-color);
    color: #fff;
    border: 1px solid var(--primary-color);
}

.btn-daftar:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-login {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-login:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* --- Sections --- */
section {
    padding: 60px 0;
    background-color: var(--background-dark);
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 40px;
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Section Providers */
.section-providers {
    background-color: var(--background-dark); /* Hitam untuk section provider */
    padding: 40px 0;
}

.provider-swiper {
    width: 100%;
    padding: 20px 0; /* Add padding for prev/next buttons */
}

.provider-card-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.provider-card {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 150px; /* Fixed width for card */
    height: 150px; /* Fixed height for card */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.provider-card:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 15px var(--primary-color);
    background-color: var(--background-light);
}

.provider-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg at 50% 50%, var(--primary-color) 0%, transparent 25%, transparent 75%, var(--primary-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.8s linear;
    animation: rotateFrame 4s linear infinite paused; /* Paused by default */
    z-index: -1;
}

.provider-card:hover::before {
    opacity: 0.2;
    animation-play-state: running;
}

@keyframes rotateFrame {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.provider-icon {
    width: 80px; /* Adjust size of icons */
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.provider-name {
    font-size: 1.1em;
    font-weight: 600;
    text-transform: uppercase;
}

/* Swiper navigation buttons */
.swiper-button-next,
.swiper-button-prev {
    color: var(--primary-color) !important;
    font-size: 2em !important;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Section Game Grid (Featured & Provider Pages) */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* 5 game per baris */
    gap: 30px;
    padding-bottom: 20px;
}

@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* 3 game per baris for mobile */
        gap: 20px;
    }
}

.game-card {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.game-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg at 50% 50%, var(--accent-color) 0%, transparent 25%, transparent 75%, var(--accent-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.8s linear;
    animation: rotateFrame 4s linear infinite paused;
    z-index: 1; /* Above image, below overlay */
}

.game-card:hover::before {
    opacity: 0.15;
    animation-play-state: running;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 15px var(--accent-color);
}

.game-image {
    width: 100%;
    height: 180px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    filter: brightness(0.8) contrast(1.1); /* Slightly darken and enhance */
}

.game-info {
    padding: 15px;
    position: relative;
    z-index: 2; /* Above the frame effect */
}

.game-title {
    font-size: 1.1em;
    margin-bottom: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

.rtp-bar-container {
    width: 100%;
    background-color: #555;
    border-radius: 5px;
    height: 25px;
    overflow: hidden;
    position: relative;
}

.rtp-bar {
    height: 100%;
    background: linear-gradient(to right, #00d2ff, #3a7bd5); /* Blue gradient */
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9em;
    transition: width 0.5s ease-out, background 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

/* RTP Bar Colors based on percentage */
.rtp-bar.red { background: linear-gradient(to right, #e0534c, #b31a1a); } /* 0-49% */
.rtp-bar.yellow { background: linear-gradient(to right, #ffd700, #ffa500); } /* 50-69% */
.rtp-bar.green { background: linear-gradient(to right, #28a745, #009688); } /* 70-100% */


.rtp-percentage {
    position: absolute;
    width: 100%;
    text-align: center;
    color: #fff;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3; /* Above everything */
}

.game-card:hover .game-overlay {
    opacity: 1;
}

.btn-check-rtp {
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4);
}

.btn-check-rtp:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

/* Section What is RTP */
.section-what-is-rtp {
    background-color: var(--background-light);
    padding: 60px 0;
}

.rtp-content {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    text-align: justify;
    line-height: 1.8;
}

.rtp-content p {
    margin-bottom: 15px;
    color: var(--text-color);
}

.rtp-content strong {
    color: var(--primary-color);
}

/* Section Dynamic Content (Section 4) */
.section-dynamic-content {
    padding: 60px 0;
    background-color: var(--background-dark);
}

.dynamic-content {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    text-align: justify;
    color: var(--text-color);
}

/* Provider Detail Page specific styles */
.section-provider-detail .section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.provider-title-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.6));
}

/* --- RTP Pop-up --- */
.rtp-popup {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000; /* Over everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.rtp-popup.show {
    opacity: 1;
    visibility: visible;
}

.rtp-popup-content {
    background-color: var(--card-bg);
    margin: auto;
    padding: 40px;
    border: 3px solid var(--primary-color);
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 20px var(--primary-color);
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.rtp-popup-content.red-border { border-color: var(--red-alert); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 20px var(--red-alert); }
.rtp-popup-content.yellow-border { border-color: var(--yellow-alert); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 20px var(--yellow-alert); }
.rtp-popup-content.green-border { border-color: var(--green-alert); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 20px var(--green-alert); }


.rtp-popup-content .close-button {
    color: var(--text-color);
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.rtp-popup-content .close-button:hover,
.rtp-popup-content .close-button:focus {
    color: var(--red-alert);
}

.rtp-popup-content h3 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: var(--accent-color);
    text-align: center;
}

.popup-rtp-bar-container {
    width: 80%;
    background-color: #555;
    border-radius: 5px;
    height: 30px;
    margin: 20px auto;
    overflow: hidden;
    position: relative;
}

.popup-rtp-bar {
    height: 100%;
    background: linear-gradient(to right, #00d2ff, #3a7bd5); /* Blue gradient */
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1em;
    transition: width 0.5s ease-out, background 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

.popup-rtp-bar.red { background: linear-gradient(to right, #dc3545, #8b0000); }
.popup-rtp-bar.yellow { background: linear-gradient(to right, #ffc107, #cc9900); }
.popup-rtp-bar.green { background: linear-gradient(to right, #28a745, #006400); }

.popup-rtp-percentage {
    position: absolute;
    width: 100%;
    text-align: center;
    color: #fff;
}

#popup-tips-content {
    background-color: var(--background-light);
    padding: 20px;
    border-radius: 8px;
    margin-top: 25px;
    font-size: 1.1em;
    line-height: 1.6;
    color: var(--text-color);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--secondary-color);
    text-align: center;
}

/* --- Footer --- */
footer {
    background-color: var(--background-light);
    padding: 20px 0;
    text-align: center;
    border-top: 2px solid var(--border-color);
    color: var(--secondary-color);
    font-size: 0.9em;
}

.no-data {
    text-align: center;
    font-style: italic;
    color: var(--secondary-color);
    margin-top: 30px;
    font-size: 1.2em;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .section-title {
        font-size: 2em;
    }
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    .main-header h1 {
        font-size: 1.8em;
    }
    .header-buttons {
        width: 100%;
        justify-content: center;
    }
    .btn {
        flex: 1;
        padding: 10px 15px;
    }
    section {
        padding: 40px 0;
    }
    .section-title {
        font-size: 1.8em;
    }
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* 3 game on mobile */
        gap: 15px;
    }
    .game-image {
        height: 150px;
    }
    .game-card {
        padding: 0; /* Remove internal padding on mobile to save space */
    }
    .game-info {
        padding: 10px;
    }
    .game-title {
        font-size: 1em;
    }
    .rtp-bar-container {
        height: 20px;
    }
    .rtp-popup-content {
        padding: 25px;
        width: 95%;
    }
    .rtp-popup-content h3 {
        font-size: 1.5em;
    }
    .popup-rtp-bar-container {
        height: 25px;
    }
    #popup-tips-content {
        font-size: 1em;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .provider-card {
        width: 120px;
        height: 120px;
        padding: 10px;
    }
    .provider-icon {
        width: 60px;
        height: 60px;
    }
    .provider-name {
        font-size: 0.9em;
    }
}