/*
Theme Name: GamifyJW
Theme URI: https://www.juegawin.com/gamifyjw
Author: JuegaWin
Author URI: https://www.juegawin.com
Description: Theme modular completo para plataformas de afiliación iGaming con sistema de Tikitokens (gamificación). Incluye sistema de reclamos, foro propio, big wins, SEO programático, anti-fraude y panel de monetización. NO permite apuestas ni transacciones reales. GEO por defecto: Chile. Nicho: Slots y Live Casino.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: casinopulse
Tags: affiliate, igaming, community, gamification, forum, reviews, rtl-language-support, translation-ready
*/

/* ====== CSS VARIABLES (dynamic from admin panel) ====== */
:root {
    /* Las siguientes 9 variables son inyectadas dinámicamente por cp_inline_css_vars
       (admin panel + customizer). Esos valores son los reales del esquema activo.
       Los fallbacks aquí solo aplican si el inline style falta por alguna razón.
       Mantenemos solo las variables que NO dependen del esquema de color. */
    --cp-success: #2ea043;
    --cp-danger: #da3633;
    --cp-warning: #d29922;
    --cp-radius: 8px;
    --cp-radius-lg: 14px;
    --cp-shadow: 0 6px 24px rgba(0,0,0,.25);
    --cp-container: 1240px;
}

/* ====== RESET ====== */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--cp-font-body);
    background-color: var(--cp-bg);
    color: var(--cp-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cp-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4,h5,h6 { font-family: var(--cp-font-heading); font-weight: 700; line-height: 1.25; margin: 0 0 .6em; }
button { cursor: pointer; font-family: inherit; }

/* ====== LAYOUT ====== */
.cp-container { max-width: var(--cp-container); margin: 0 auto; padding: 0 20px; }
.cp-grid { display: grid; gap: 24px; }
.cp-grid-2 { grid-template-columns: repeat(2, 1fr); }
.cp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.cp-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media(max-width: 900px){ .cp-grid-2,.cp-grid-3,.cp-grid-4{grid-template-columns:1fr;} }

/* ====== HEADER ====== */
.cp-header {
    background: var(--cp-surface);
    border-bottom: 1px solid var(--cp-border);
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(10px);
}
.cp-header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.cp-logo { font-family: var(--cp-font-heading); font-weight: 800; font-size: 24px; color: var(--cp-text); text-decoration: none; }
.cp-logo span { color: var(--cp-primary); }
.cp-nav { display: flex; gap: 24px; align-items: center; }
.cp-nav a { color: var(--cp-text); font-weight: 500; font-size: 15px; }
.cp-header-actions { display: flex; gap: 12px; align-items: center; }

/* ====== BUTTONS ====== */
.cp-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: var(--cp-radius);
    font-weight: 600; font-size: 14px; text-decoration: none;
    border: none; transition: transform .15s ease, box-shadow .15s ease, background .15s;
}
.cp-btn:hover { transform: translateY(-1px); text-decoration: none; }
.cp-btn-primary { background: var(--cp-primary); color: #fff; }
.cp-btn-primary:hover { background: #c92a37; color:#fff; }
.cp-btn-secondary { background: var(--cp-secondary); color: #fff; }
.cp-btn-outline { background: transparent; border: 1px solid var(--cp-border); color: var(--cp-text); }
.cp-btn-lg { padding: 14px 28px; font-size: 16px; }
.cp-btn-sm { padding: 6px 12px; font-size: 13px; }

/* ====== CARDS ====== */
.cp-card {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius-lg);
    padding: 20px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.cp-card:hover { transform: translateY(-3px); box-shadow: var(--cp-shadow); }

/* ====== HERO ====== */
.cp-hero {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--cp-secondary) 0%, var(--cp-bg) 100%);
    text-align: center;
}
.cp-hero h1 { font-size: clamp(32px, 5vw, 56px); margin-bottom: 16px; }
.cp-hero p { font-size: 18px; color: var(--cp-text-muted); max-width: 720px; margin: 0 auto 28px; }

/* ====== SECTIONS ====== */
.cp-section { padding: 60px 0; }
.cp-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.cp-section-title h2 { font-size: 28px; margin: 0; }

/* ====== CASINO CARD ====== */
.cp-casino-card { display: flex; flex-direction: column; gap: 12px; position: relative; }
.cp-casino-card .cp-badge-sponsored { position: absolute; top: 10px; right: 10px; background: var(--cp-warning); color: #000; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.cp-casino-logo { width: 100%; height: 120px; background: #fff; border-radius: var(--cp-radius); display: flex; align-items: center; justify-content: center; padding: 14px; }
.cp-casino-logo img { max-height: 80px; width: auto; }
.cp-casino-meta { display:flex; gap:8px; align-items:center; flex-wrap: wrap; font-size: 13px; color: var(--cp-text-muted); }
.cp-rating { display: flex; gap: 4px; align-items: center; color: var(--cp-accent); font-weight: 700; }
.cp-rating .stars { letter-spacing: 2px; }

/* ====== RECLAMO ====== */
.cp-reclamo { border-left: 4px solid var(--cp-warning); }
.cp-reclamo[data-status="resolved"] { border-left-color: var(--cp-success); }
.cp-reclamo[data-status="rejected"] { border-left-color: var(--cp-danger); }
.cp-reclamo-status { display: inline-block; padding: 3px 10px; font-size: 12px; border-radius: 999px; font-weight: 600; text-transform: uppercase; }
.cp-status-pending { background: rgba(210,153,34,.15); color: var(--cp-warning); }
.cp-status-resolved { background: rgba(46,160,67,.15); color: var(--cp-success); }
.cp-status-rejected { background: rgba(218,54,51,.15); color: var(--cp-danger); }
.cp-status-investigating { background: rgba(56,139,253,.15); color: #58a6ff; }

/* ====== FORUM ====== */
.cp-thread { display: flex; gap: 14px; padding: 16px; border-bottom: 1px solid var(--cp-border); }
.cp-thread-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--cp-primary); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex-shrink: 0; }
.cp-thread-body { flex: 1; }
.cp-thread-title { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.cp-thread-meta { font-size: 13px; color: var(--cp-text-muted); }
.cp-like-btn { background: transparent; border: 1px solid var(--cp-border); color: var(--cp-text-muted); padding: 4px 10px; border-radius: 6px; font-size: 13px; }
.cp-like-btn.liked { color: var(--cp-primary); border-color: var(--cp-primary); }

/* ====== BIG WIN ====== */
.cp-bigwin-card { position: relative; overflow: hidden; }
.cp-bigwin-card .amount { font-size: 28px; font-weight: 800; color: var(--cp-accent); }
.cp-bigwin-card .reactions { display: flex; gap: 10px; margin-top: 12px; }
.cp-react-btn { background: rgba(255,255,255,.06); border: none; color: var(--cp-text); padding: 4px 10px; border-radius: 6px; font-size: 13px; }

/* ====== GAMIFICATION ====== */
.cp-level-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: linear-gradient(135deg, var(--cp-primary), var(--cp-accent)); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; }
.cp-xp-bar { height: 8px; background: var(--cp-border); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.cp-xp-bar > div { height: 100%; background: linear-gradient(90deg, var(--cp-primary), var(--cp-accent)); transition: width .4s ease; }

/* ====== FOOTER ====== */
.cp-footer { background: var(--cp-surface); border-top: 1px solid var(--cp-border); padding: 60px 0 30px; margin-top: 80px; }
.cp-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
@media(max-width:900px){ .cp-footer-grid{grid-template-columns:1fr 1fr;} }
.cp-footer h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--cp-text-muted); margin-bottom: 16px; }
.cp-footer ul { list-style: none; padding: 0; margin: 0; }
.cp-footer li { margin-bottom: 8px; }
.cp-footer a { color: var(--cp-text); font-size: 14px; }
.cp-disclaimer { font-size: 12px; color: var(--cp-text-muted); border-top: 1px solid var(--cp-border); padding-top: 20px; line-height: 1.7; }

/* ====== FORMS ====== */
.cp-form-row { margin-bottom: 16px; }
.cp-form-row label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.cp-input, .cp-textarea, .cp-select {
    width: 100%; padding: 10px 14px;
    background: var(--cp-bg); color: var(--cp-text);
    border: 1px solid var(--cp-border); border-radius: var(--cp-radius);
    font-family: inherit; font-size: 14px;
}
.cp-textarea { min-height: 110px; resize: vertical; }

/* ====== NOTICES ====== */
.cp-notice { padding: 12px 16px; border-radius: var(--cp-radius); margin-bottom: 16px; font-size: 14px; }
.cp-notice-info { background: rgba(56,139,253,.1); border-left: 3px solid #58a6ff; color: #58a6ff; }
.cp-notice-success { background: rgba(46,160,67,.1); border-left: 3px solid var(--cp-success); color: var(--cp-success); }
.cp-notice-warning { background: rgba(210,153,34,.1); border-left: 3px solid var(--cp-warning); color: var(--cp-warning); }
.cp-notice-error { background: rgba(218,54,51,.1); border-left: 3px solid var(--cp-danger); color: var(--cp-danger); }

/* ====== AGE GATE / GEO ====== */
.cp-geo-bar { background: var(--cp-secondary); padding: 8px 0; text-align: center; font-size: 13px; }
.cp-geo-bar select { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.2); padding: 2px 8px; border-radius: 4px; }

/* ====== ALIGNMENT (WP) ====== */
.alignleft { float: left; margin: 0 1em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1em; }
.aligncenter { display: block; margin: 0 auto 1em; }
.screen-reader-text { position: absolute; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

/* ====== UTIL ====== */
.cp-mt-0{margin-top:0}.cp-mt-1{margin-top:8px}.cp-mt-2{margin-top:16px}.cp-mt-3{margin-top:24px}.cp-mt-4{margin-top:32px}
.cp-flex{display:flex}.cp-flex-between{display:flex;justify-content:space-between;align-items:center}.cp-gap-2{gap:16px}
.cp-text-muted{color:var(--cp-text-muted)}.cp-text-center{text-align:center}
