/* assets/css/frontend-style.css */

/* ============================================================
   DESIGN TOKENS
   ============================================================
   Colors are NOT hardcoded: the accent tokens resolve to the theme-panel
   variables (--cwlc-primary / --cwlc-primary-glow / --cwlc-primary-soft /
   --cwlc-btn-text) injected by evmp_cwlc_theme_colors_css(), so every card
   matches the site design. Card surface tokens (--vx-card-*) switch per
   theme: light, dark, or morph (follows the site theme).
   ============================================================ */

.vx-items-container,
.vx-table-wrapper {
    --vx-accent: var(--cwlc-primary, #ff6a00);
    --vx-accent-soft: var(--cwlc-primary-soft, rgba(255, 106, 0, 0.12));
    --vx-accent-glow: var(--cwlc-primary-glow, rgba(255, 106, 0, 0.5));
    --vx-btn-text: var(--cwlc-btn-text, #ffffff);
    --vx-radius: var(--cwlc-radius, 16px);
    --vx-transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --vx-card-bg: var(--cwlc-light-card, #ffffff);
    --vx-card-bg-alt: #f4f5f7;
    --vx-card-text: #1a1d21;
    --vx-card-muted: #6b7280;
    --vx-card-border: rgba(0, 0, 0, 0.08);
}

/* THEME: LIGHT (explicit) */
.vx-theme-light {
    --vx-card-bg: var(--cwlc-light-card, #ffffff);
    --vx-card-bg-alt: #f4f5f7;
    --vx-card-text: #1a1d21;
    --vx-card-muted: #555555;
    --vx-card-border: rgba(0, 0, 0, 0.08);
}

/* THEME: DARK (explicit) */
.vx-theme-dark {
    --vx-card-bg: var(--cwlc-dark-card, #1a1d21);
    --vx-card-bg-alt: #14181c;
    --vx-card-text: #ffffff;
    --vx-card-muted: #8a949d;
    --vx-card-border: rgba(255, 255, 255, 0.1);
}

/* THEME: MORPH - adapts to the site theme (Velox dark-skin class) */
html.dark-skin .vx-theme-morph {
    --vx-card-bg: var(--cwlc-dark-card, #1a1d21);
    --vx-card-bg-alt: #14181c;
    --vx-card-text: #ffffff;
    --vx-card-muted: #8a949d;
    --vx-card-border: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   ITEMS GRID & SLIDER CONTAINERS
   ============================================================ */
.vx-items-container {
    width: 100%;
    margin: 30px 0;
}

.vx-items-grid {
    display: grid;
    gap: 20px;
}

.vx-cols-1 .vx-items-grid { grid-template-columns: 1fr; }
.vx-cols-2 .vx-items-grid { grid-template-columns: repeat(2, 1fr); }
.vx-cols-3 .vx-items-grid { grid-template-columns: repeat(3, 1fr); }
.vx-cols-4 .vx-items-grid { grid-template-columns: repeat(4, 1fr); }
.vx-cols-5 .vx-items-grid { grid-template-columns: repeat(5, 1fr); }

/* ============================================================
   ITEM CARD (base + classic skin)
   ============================================================ */
.vx-item-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--vx-card-bg);
    border: 1px solid var(--vx-card-border);
    border-radius: var(--vx-radius);
    overflow: hidden;
    transition: var(--vx-transition);
    color: var(--vx-card-text);
}

.vx-item-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 15px var(--vx-accent-glow);
    border-color: var(--vx-accent);
    z-index: 5;
}

.vx-card-media {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: var(--vx-card-bg-alt);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--vx-transition);
}

.vx-item-card:hover .vx-card-media { transform: scale(1.04); }

.vx-card-initial {
    font-size: 42px;
    font-weight: 800;
    color: var(--vx-card-muted);
    opacity: 0.6;
}

.vx-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.85);
    color: var(--vx-accent);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 900;
    border: 1px solid var(--vx-accent);
}

.vx-card-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.vx-item-title {
    font-size: 16px;
    margin: 0 0 8px 0;
    font-weight: 600;
    color: var(--vx-card-text);
}

.vx-item-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 8px 0;
    font-size: 13px;
    color: var(--vx-card-muted);
}

.vx-item-link {
    margin-top: auto;
    display: block;
    padding: 12px 16px;
    background: var(--vx-accent);
    color: var(--vx-btn-text) !important;
    border-radius: 12px;
    text-decoration: none;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    box-shadow: 0 4px 15px var(--vx-accent-glow);
    transition: var(--vx-transition);
}

.vx-item-link:hover {
    filter: brightness(1.2);
    transform: scale(1.03);
    color: var(--vx-btn-text) !important;
}

/* ============================================================
   SKINS (visual variants, all driven by the accent tokens)
   ============================================================ */

/* OVERLAY: media covers the whole card, content slides over it */
.vx-skin-overlay {
    min-height: 320px;
    background-size: cover;
    background-position: center;
    border: none;
}

.vx-skin-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 10%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
}

.vx-skin-overlay .vx-card-body {
    position: relative;
    z-index: 2;
    justify-content: flex-end;
    padding: 25px;
}

.vx-skin-overlay .vx-item-title { color: #ffffff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
.vx-skin-overlay .vx-item-meta { color: #cfd6dc; }

/* HIGHLIGHT: dark jewel with accent border + glowing title */
.vx-skin-highlight {
    background: linear-gradient(145deg, #0f1215 0%, #232a31 100%) !important;
    border: 2px solid var(--vx-accent) !important;
}

.vx-skin-highlight .vx-item-title {
    color: #ffffff !important;
    font-size: 1.4rem;
    text-shadow: 0 0 10px var(--vx-accent-glow);
}

.vx-skin-highlight .vx-card-badge { color: var(--vx-accent); }

/* NEON: like classic but with a strong glow around the whole card */
.vx-skin-neon .vx-item-link { box-shadow: 0 0 22px var(--vx-accent-glow), 0 4px 14px rgba(0, 0, 0, 0.35); }

.vx-skin-neon:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 26px var(--vx-accent-glow);
    border-color: var(--vx-accent);
}

/* GLASS: translucent surface with blur */
.vx-skin-glass {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.vx-skin-glass:hover { border-color: var(--vx-accent); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18), 0 0 24px var(--vx-accent-glow); }

html.dark-skin .vx-theme-morph .vx-skin-glass,
.vx-theme-dark .vx-skin-glass {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* SOFT: tinted surface with the accent color */
.vx-skin-soft {
    background: var(--vx-accent-soft);
    border: 1px solid var(--vx-accent-soft);
}

.vx-skin-soft:hover {
    border-color: var(--vx-accent);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18), 0 0 24px var(--vx-accent-glow);
}

/* ============================================================
   SLIDER
   ============================================================ */
.vx-layout-slider {
    padding: 0 50px !important;
    position: relative;
}

.vx-items-swiper {
    padding: 10px 0 40px;
}

.vx-items-swiper .swiper-slide {
    height: auto;
}

.vx-items-swiper .swiper-button-next,
.vx-items-swiper .swiper-button-prev {
    color: var(--vx-accent) !important;
    background: var(--vx-card-bg) !important;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.vx-items-swiper .swiper-pagination-bullet-active {
    background: var(--vx-accent);
}

/* ============================================================
   TABLE (theme: light | dark | morph)
   ============================================================ */
.vx-table-wrapper {
    margin: 25px 0;
    overflow-x: auto;
    --vx-tbl-head-bg: #f0f0f0;
    --vx-tbl-head-text: #1a1d21;
    --vx-tbl-border: #eeeeee;
    --vx-tbl-alt: #fafafa;
    --vx-tbl-hover: #f5f5f5;
    --vx-tbl-text: #333333;
}

.vx-theme-light.vx-table-wrapper {
    --vx-tbl-head-bg: #f0f0f0;
    --vx-tbl-head-text: #1a1d21;
    --vx-tbl-border: #eeeeee;
    --vx-tbl-alt: #fafafa;
    --vx-tbl-hover: #f5f5f5;
    --vx-tbl-text: #333333;
}

.vx-theme-dark.vx-table-wrapper,
html.dark-skin .vx-theme-morph.vx-table-wrapper {
    --vx-tbl-head-bg: #1a1a1a;
    --vx-tbl-head-text: #ffffff;
    --vx-tbl-border: #333333;
    --vx-tbl-alt: #222222;
    --vx-tbl-hover: #2a2a2a;
    --vx-tbl-text: #dddddd;
}

.vx-dynamic-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: var(--vx-tbl-text);
}

.vx-dynamic-table th {
    background: var(--vx-tbl-head-bg);
    color: var(--vx-tbl-head-text);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--vx-tbl-border);
}

.vx-dynamic-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--vx-tbl-border);
}

.vx-dynamic-table tbody tr:hover {
    background: var(--vx-tbl-hover);
}

.vx-dynamic-table tbody tr:nth-child(even) {
    background: var(--vx-tbl-alt);
}

/* ============================================================
   ITEM TOP CARD (legacy component)
   ============================================================ */
.vx-item-top {
    display: grid;
    grid-template-columns: 200px 1fr 2fr 200px;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background: var(--cwlc-dark-card, #1a1a1a);
    border-radius: 12px;
    margin: 15px 0;
    border: 1px solid var(--cwlc-dark-card, #333333);
}

.vx-top-logo {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #0a0a0a;
    border-radius: 8px;
    min-height: 80px;
}

.vx-top-logo img {
    max-height: 50px;
    max-width: 100%;
}

.vx-top-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 24px;
    color: #ffd700;
}

.vx-top-bonus {
    text-align: center;
}

.vx-bonus-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--cwlc-primary, #2f9df3);
}

.vx-bonus-title {
    display: block;
    font-size: 14px;
    color: #aaa;
}

.vx-top-description {
    color: #ccc;
    font-size: 14px;
}

.vx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.vx-btn-primary {
    background: linear-gradient(to top, var(--cwlc-primary, #fa4d00), var(--cwlc-primary-glow, #fa5e00));
    color: var(--cwlc-btn-text, #ffffff) !important;
}

.vx-btn-primary:hover {
    transform: scale(1.05);
    color: var(--cwlc-btn-text, #ffffff) !important;
}

.vx-item-top.vx-top {
    border-color: var(--cwlc-primary, #2f9df3);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .vx-cols-4 .vx-items-grid { grid-template-columns: repeat(3, 1fr); }
    .vx-cols-5 .vx-items-grid { grid-template-columns: repeat(3, 1fr); }
}

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

    .vx-layout-slider { padding: 0 40px !important; }

    .vx-item-top {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 15px;
    }

    .vx-top-bonus {
        padding-left: 0;
    }
}

@media (max-width: 480px) {
    .vx-items-grid {
        grid-template-columns: 1fr !important;
    }

    .vx-layout-slider { padding: 0 32px !important; }
}
