/**
 * Live Casino Demo Frontend Stylesheet
 *
 * Prefix: .csn-* to avoid conflicts.
 * Theme: Luxury dark with gold accents — Live Casino style
 * Responsive: 4 col -> 3 col -> 2 col -> 1 col
 */

/* ─── Full-width & dark background (override GeneratePress theme) ─── */
.grid-container.site:has(.csn-wrapper) {
    max-width: 100% !important;
    width: 100% !important;
}

.page-template-full-width .site-content,
.page-template-full-width .content-area,
.page-template-full-width .inside-article,
.site-content:has(.csn-wrapper),
.content-area:has(.csn-wrapper) {
    max-width: 100% !important;
    width: 100% !important;
    background: #0a0a0a !important;
}

/* Hide theme's default page title (we have our own hero) */
.csn-wrapper ~ .entry-header,
.entry-header:has(+ .entry-content .csn-wrapper),
.inside-article > .entry-header {
    display: none !important;
}

/* Remove theme article padding/border on casino pages */
.inside-article:has(.csn-wrapper) {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    background: #0a0a0a !important;
}

/* ─── Wrapper ─── */
.csn-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 40px;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #e8e0d0;
    line-height: 1.6;
    background: #0a0a0a;
}

/* ─── Hero ─── */
.csn-hero {
    text-align: center;
    padding: 60px 20px 50px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 30%, #16213e 60%, #0a0a0a 100%);
    border-radius: 0;
    margin: 0 -40px 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(212,175,55,0.25);
}

.csn-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 40%, rgba(212,175,55,0.12) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 60%, rgba(139,0,0,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.03) 0%, transparent 40%);
    pointer-events: none;
}

.csn-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.5), transparent);
}

.csn-hero__title {
    font-size: 2.4rem;
    font-weight: 800;
    margin: 0 0 12px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    background: linear-gradient(135deg, #d4af37, #f5d778, #d4af37);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.csn-hero__subtitle {
    font-size: 1rem;
    opacity: 0.8;
    margin: 0;
    position: relative;
    z-index: 1;
    color: #c9b896;
    letter-spacing: 0.5px;
}

/* ─── Sub Navigation ─── */
.csn-subnav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 6px;
    background: rgba(26,26,46,0.8);
    border-radius: 12px;
    overflow-x: auto;
    border: 1px solid rgba(212,175,55,0.15);
}

.csn-subnav__item {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #8a8a9a;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.csn-subnav__item:hover {
    background: rgba(212,175,55,0.1);
    color: #d4af37;
}

.csn-subnav__item--active {
    background: linear-gradient(135deg, #8b0000, #a52a2a);
    color: #f5d778 !important;
    box-shadow: 0 2px 12px rgba(139,0,0,0.4);
    border: 1px solid rgba(212,175,55,0.3);
}

/* ─── Page Header ─── */
.csn-page-header {
    margin-bottom: 24px;
}

.csn-page-header__back {
    margin-bottom: 12px;
}

.csn-page-header__title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #d4af37;
    margin: 0 0 8px;
}

.csn-page-header__desc {
    color: #8a8a9a;
    font-size: 0.95rem;
    margin: 0;
}

/* ─── Section ─── */
.csn-section {
    margin-bottom: 32px;
}

.csn-section__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #d4af37;
    margin: 0 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ─── Provider Grid ─── */
.csn-provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.csn-provider-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.csn-provider-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 1px solid rgba(212,175,55,0.15);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.25s;
    cursor: pointer;
}

.csn-provider-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(212,175,55,0.15), 0 0 20px rgba(139,0,0,0.1);
    border-color: #d4af37;
}

.csn-provider-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.csn-provider-card__name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #c9b896;
    text-align: center;
    word-break: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ─── Hub Links ─── */
.csn-hub-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 32px 0;
}

.csn-hub-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    text-decoration: none;
    color: #e8e0d0;
    transition: all 0.3s;
    border: 1px solid rgba(212,175,55,0.15);
}

.csn-hub-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(212,175,55,0.15);
    border-color: #d4af37;
}

.csn-hub-link__icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.csn-hub-link__title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.csn-hub-link__title {
    color: #d4af37;
}

.csn-hub-link__desc {
    font-size: 0.85rem;
    color: #8a8a9a;
}

/* ─── Stats Bar ─── */
.csn-stats-bar {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 20px;
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e);
    border-radius: 12px;
    margin: 24px 0;
    border: 1px solid rgba(212,175,55,0.15);
}

.csn-stats-bar__item {
    text-align: center;
    font-size: 0.9rem;
    color: #8a8a9a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.csn-stats-bar__item strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #d4af37;
    margin-bottom: 2px;
}

/* ─── Game Grid ─── */
.csn-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.csn-game-card {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 1px solid rgba(212,175,55,0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s;
}

.csn-game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(212,175,55,0.12);
    border-color: rgba(212,175,55,0.3);
}

.csn-game-card__img {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #0d0d1a;
}

.csn-game-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.csn-game-card:hover .csn-game-card__img img {
    transform: scale(1.05);
}

.csn-game-card__img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.csn-game-card__placeholder-text {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    padding: 8px;
}

.csn-game-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.csn-game-card:hover .csn-game-card__overlay {
    opacity: 1;
}

.csn-game-card__info {
    padding: 10px 12px;
}

.csn-game-card__name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e8e0d0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.csn-game-card__provider {
    font-size: 0.75rem;
    color: #8a8a9a;
    margin-top: 2px;
}

/* ─── Play Page ─── */
.csn-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: #6a6a7a;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.csn-breadcrumb a {
    color: #d4af37;
    text-decoration: none;
}

.csn-breadcrumb a:hover {
    text-decoration: underline;
    color: #f5d778;
}

.csn-breadcrumb__sep {
    color: #4a4a5a;
    margin: 0 4px;
}

.csn-play-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.csn-play-header__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #d4af37;
    margin: 0;
}

.csn-play-header__provider {
    font-size: 0.9rem;
    color: #8a8a9a;
}

.csn-play-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #0a0a0a;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid rgba(212,175,55,0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.csn-play-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.csn-play-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    gap: 12px;
}

.csn-play-loading p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.csn-play-error {
    position: absolute;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    gap: 12px;
}

.csn-play-error p {
    margin: 0;
    font-size: 0.95rem;
}

.csn-play-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.csn-play-back {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* ─── Spinner ─── */
.csn-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: csn-spin 0.8s linear infinite;
}

@keyframes csn-spin {
    to { transform: rotate(360deg); }
}

/* ─── Badge ─── */
.csn-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.csn-badge--demo {
    background: linear-gradient(135deg, #d4af37, #b8960c);
    color: #0a0a0a;
}

/* ─── Buttons ─── */
.csn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.csn-btn--sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

.csn-btn--primary {
    background: linear-gradient(135deg, #8b0000, #a52a2a);
    color: #f5d778;
    border: 1px solid rgba(212,175,55,0.3);
}

.csn-btn--primary:hover {
    box-shadow: 0 4px 16px rgba(139,0,0,0.5);
    transform: translateY(-1px);
}

.csn-btn--secondary {
    background: rgba(26,26,46,0.8);
    color: #c9b896;
    border: 1px solid rgba(212,175,55,0.2);
}

.csn-btn--secondary:hover {
    background: rgba(212,175,55,0.15);
    color: #d4af37;
}

.csn-btn--outline {
    background: transparent;
    border: 2px solid rgba(212,175,55,0.3);
    color: #c9b896;
}

.csn-btn--outline:hover {
    border-color: #d4af37;
    color: #d4af37;
}

.csn-btn--play {
    background: linear-gradient(135deg, #d4af37, #b8960c);
    color: #0a0a0a;
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 30px;
    box-shadow: 0 4px 16px rgba(212,175,55,0.4);
    border: none;
}

.csn-btn--play:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(212,175,55,0.6);
}

/* ─── Notice ─── */
.csn-notice {
    padding: 16px 20px;
    background: rgba(26,26,46,0.8);
    border-radius: 10px;
    color: #8a8a9a;
    font-size: 0.9rem;
    text-align: center;
    margin: 16px 0;
    border: 1px solid rgba(212,175,55,0.1);
}

.csn-notice--warning {
    background: rgba(139,0,0,0.15);
    color: #d4af37;
    border: 1px solid rgba(212,175,55,0.3);
}

/* ─── Disclaimer ─── */
.csn-disclaimer {
    margin-top: 24px;
    padding: 16px 20px;
    background: rgba(26,26,46,0.6);
    border: 1px solid rgba(212,175,55,0.15);
    border-radius: 10px;
    font-size: 0.82rem;
    color: #8a8a9a;
    line-height: 1.7;
}

.csn-disclaimer p {
    margin: 0 0 4px;
}

.csn-disclaimer p:last-child {
    margin-bottom: 0;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .csn-wrapper {
        padding: 12px;
    }

    .csn-hero {
        padding: 32px 16px;
    }

    .csn-hero__title {
        font-size: 1.5rem;
    }

    .csn-provider-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .csn-provider-card {
        padding: 14px 8px;
    }

    .csn-provider-card__icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        font-size: 0.9rem;
    }

    .csn-provider-card__name {
        font-size: 0.72rem;
    }

    .csn-game-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .csn-hub-links {
        grid-template-columns: 1fr;
    }

    .csn-stats-bar {
        flex-direction: column;
        gap: 12px;
    }

    .csn-play-header__title {
        font-size: 1.2rem;
    }

    .csn-play-container {
        aspect-ratio: 4/3;
        border-radius: 10px;
    }

    .csn-subnav {
        gap: 4px;
    }

    .csn-subnav__item {
        padding: 8px 14px;
        font-size: 0.82rem;
    }

    .csn-page-header__title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .csn-provider-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .csn-game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .csn-game-card__info {
        padding: 8px;
    }

    .csn-game-card__name {
        font-size: 0.78rem;
    }
}

/* ── CSS Fullscreen fallback (iOS Safari + mobile) ── */
.csn-play-container.csn-css-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    border-radius: 0 !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.csn-play-container.csn-css-fullscreen .csn-play-iframe {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
}
