/* =========================================
   TeenSTAR Core - Frontend Styles (Unified Background)
   ========================================= */

:root {
    --ts-primary: #e3047e;       /* Magenta Corporativo */
    --ts-primary-dark: #c0036b;
    --ts-secondary: #e09900;     /* Naranja/Dorado */
    --ts-text-main: #1f2937;     /* Gris muy oscuro */
    --ts-text-muted: #6b7280;    /* Gris medio */
    --ts-bg-light: #f3f4f6;      /* Fondo general */
    --ts-white: #ffffff;
    --ts-border: #e5e7eb;
    --ts-radius: 12px;
    --ts-font: 'DM Sans', Helvetica, Arial, sans-serif;
    --ts-shadow-card: 0 20px 40px -5px rgba(0,0,0,0.1);
    --ts-shadow-hover: 0 25px 50px -12px rgba(227, 4, 126, 0.15);
}

/* =========================================
   1. GLOBAL & RESET (NO BULLETS)
   ========================================= */
body { font-family: var(--ts-font); color: var(--ts-text-main); -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
a { text-decoration: none; transition: color 0.2s; }

/* Reset agresivo para eliminar bullets de Divi/WP */
.ts-menu, .ts-menu ul, .ts-menu li,
.ts-mobile-list, .ts-mobile-list li,
.ts-nav-desktop ul, .ts-nav-desktop li { 
    list-style-type: none !important; 
    list-style: none !important;
    margin: 0 !important; 
    padding: 0 !important; 
    padding-left: 0 !important;
}
.ts-menu li::before, .ts-mobile-list li::before { display: none !important; content: none !important; }


/* =========================================
   2. UI COMPONENTS & SHORTCODE CONTAINERS
   ========================================= */

/* Contenedor Full Screen Centrado (Login y Perfil) */
/* Aplica el fondo estandarizado solicitado */
.ts-auth-container {
    min-height: 100vh; 
    width: 100%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    background: url('http://www.teenstar.cl/wp-content/uploads/2024/09/background-signs@2x-scaled.webp') center/cover no-repeat fixed;
    padding: 40px 20px;
}

/* --- BOTONES --- */
.ts-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 48px; padding: 0 24px;
    border-radius: 50px;
    font-weight: 700; font-size: 15px;
    cursor: pointer; transition: all 0.2s ease;
    border: none; text-decoration: none; line-height: 1;
    gap: 8px;
}
.ts-btn-primary { background: var(--ts-primary); color: #fff !important; box-shadow: 0 4px 12px rgba(227, 4, 126, 0.25); }
.ts-btn-primary:hover { background: var(--ts-primary-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(227, 4, 126, 0.35); }

.ts-btn-outline { background: transparent; border: 2px solid var(--ts-border); color: var(--ts-text-muted) !important; }
.ts-btn-outline:hover { border-color: var(--ts-text-muted); color: var(--ts-text-main) !important; background: #fff; }

.ts-btn-external { width: auto; display: inline-flex; }
.ts-btn .dashicons { font-size: 18px; width: 18px; height: 18px; }

/* Spinners */
.btn-spinner { display: none; animation: spin 2s infinite linear; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.ts-btn.loading .btn-text { display: none; }
.ts-btn.loading .btn-spinner { display: block; }

/* --- INPUTS --- */
.ts-form-grid { display: grid; gap: 20px; }
.ts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ts-input-group { position: relative; display: flex; flex-direction: column; text-align: left; }
.ts-input-group label { font-size: 13px; font-weight: 700; color: var(--ts-text-main); margin-bottom: 6px; display: block; }

.ts-input {
    width: 100%; height: 50px; padding: 0 16px;
    background: #fff; border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius);
    font-size: 15px; color: var(--ts-text-main);
    transition: border 0.2s, box-shadow 0.2s;
}
.ts-input:focus { border-color: var(--ts-primary); outline: none; box-shadow: 0 0 0 3px rgba(227, 4, 126, 0.1); }
.ts-input:disabled { background: #f9fafb; cursor: not-allowed; }

/* Iconos en Inputs */
.ts-input-icon-wrap { position: relative; width: 100%; }
.ts-input-icon-wrap .ts-input { padding-right: 45px; }
.ts-input-icon-wrap .dashicons {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    color: #9ca3af; pointer-events: none; font-size: 20px;
}
.ts-input-icon-wrap .ts-pass-toggle { pointer-events: auto; cursor: pointer; transition: color 0.2s; }
.ts-input-icon-wrap .ts-pass-toggle:hover { color: var(--ts-primary); }

.ts-msg-box { padding: 15px; border-radius: var(--ts-radius); margin-bottom: 20px; font-size: 14px; text-align: center; font-weight: 600; }
.ts-msg-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.ts-msg-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }


/* =========================================
   3. LOGIN & PROFILE CARDS
   ========================================= */

/* --- Login Card (Shortcode Version) --- */
.ts-auth-wrapper { width: 100%; max-width: 420px; margin: 0 auto; }
.ts-auth-card {
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px);
    border-radius: 20px; padding: 40px; text-align: center;
    box-shadow: var(--ts-shadow-card); border: 1px solid rgba(255,255,255,0.6);
}
.ts-auth-header h2 { margin: 0 0 8px; color: var(--ts-primary); font-size: 26px; font-weight: 800; }
.ts-auth-header p { margin: 0 0 30px; color: var(--ts-text-muted); font-size: 15px; }
.ts-form { display: flex; flex-direction: column; gap: 18px; }
.ts-form-footer { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.ts-link-small { color: var(--ts-primary); font-weight: 600; }

/* --- Profile Card --- */
.ts-profile-wrapper { width: 100%; max-width: 1000px; margin: 0 auto; }
.ts-profile-card {
    background: #fff; border-radius: 24px;
    box-shadow: var(--ts-shadow-card);
    display: grid; grid-template-columns: 280px 1fr;
    overflow: hidden; min-height: 650px;
    /* Aseguramos que la tarjeta destaque sobre el fondo */
    position: relative; z-index: 10;
}
.ts-profile-sidebar {
    background: #f8fafc; border-right: 1px solid var(--ts-border);
    padding: 40px 25px; display: flex; flex-direction: column; align-items: center;
}
.ts-avatar-ring img {
    width: 120px; height: 120px; border-radius: 50%;
    border: 4px solid #fff; box-shadow: 0 8px 20px -5px rgba(0,0,0,0.1);
    margin-bottom: 15px; object-fit: cover;
}
.ts-user-name { font-size: 20px; font-weight: 700; color: var(--ts-text-main); margin: 0 0 5px; text-align: center; }
.ts-user-role {
    font-size: 11px; font-weight: 700; background: var(--ts-primary); color: #fff;
    padding: 4px 12px; border-radius: 20px; margin-bottom: 30px; text-transform: uppercase;
}
.ts-profile-nav { width: 100%; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.ts-nav-btn {
    display: flex; align-items: center; width: 100%; padding: 12px 15px;
    border-radius: 10px; border: 1px solid transparent; background: transparent;
    color: var(--ts-text-muted); font-weight: 600; font-size: 14px;
    cursor: pointer; text-align: left; transition: all 0.2s;
}
.ts-nav-btn:hover { background: #fff; color: var(--ts-primary); box-shadow: 0 2px 5px rgba(0,0,0,0.03); }
.ts-nav-btn.active { background: #fff; color: var(--ts-primary); box-shadow: 0 4px 12px rgba(0,0,0,0.05); border-color: #fce7f3; }
.ts-nav-btn .dashicons { margin-right: 12px; font-size: 20px; }
.ts-profile-footer { width: 100%; padding-top: 20px; border-top: 1px solid var(--ts-border); }
.ts-nav-btn.logout { color: #ef4444; }
.ts-nav-btn.logout:hover { background: #fef2f2; color: #dc2626; }

/* Contenido Profile */
.ts-profile-content { padding: 40px; background: #fff; overflow-y: auto; }
.ts-tab-pane { display: none; animation: fadeIn 0.3s ease-out; }
.ts-tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.ts-tab-header { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--ts-border); }
.ts-tab-header h3 { font-size: 24px; color: var(--ts-text-main); margin: 0 0 5px; font-weight: 800; }
.ts-tab-header p { font-size: 15px; color: var(--ts-text-muted); margin: 0; }
.ts-divider { height: 1px; background: var(--ts-border); margin: 30px 0; }

/* Grid de Niveles (RESTAURADO ESTILO CARD) */
.ts-levels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.ts-level-item {
    display: flex; align-items: center; 
    background: #fff; border: 1px solid var(--ts-border); border-radius: 12px;
    padding: 20px; text-decoration: none; transition: all 0.3s;
}
.ts-level-item:hover { border-color: var(--ts-primary); transform: translateY(-3px); box-shadow: var(--ts-shadow-hover); }
.ts-level-icon {
    width: 48px; height: 48px; background: #fdf2f8; color: var(--ts-primary);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    margin-right: 15px; flex-shrink: 0;
}
.ts-level-icon .dashicons { font-size: 24px; }
.ts-level-info h4 { margin: 0 0 4px; font-size: 16px; color: var(--ts-text-main); font-weight: 700; }
.ts-level-info span { font-size: 13px; color: var(--ts-text-muted); }
.ts-level-item .dashicons-arrow-right-alt2 { margin-left: auto; color: #d1d5db; }


/* =========================================
   4. TABS & MANUALS
   ========================================= */
.ts-tabs-container { width: 100%; margin: 20px 0; }
.ts-tabs-nav { 
    display: flex; flex-wrap: wrap; gap: 5px; 
    border-bottom: 2px solid #f0f0f0; padding-bottom: 0; margin-bottom: 25px;
}
.ts-tab-link {
    background: transparent; border: none; border-bottom: 3px solid transparent;
    padding: 12px 20px; font-size: 15px; font-weight: 600; color: #666;
    cursor: pointer; transition: all 0.2s;
    margin-bottom: -2px; border-radius: 6px 6px 0 0;
}
.ts-tab-link:hover { color: var(--ts-primary); background: #fdf2f8; }
.ts-tab-link.active { 
    color: var(--ts-primary); border-bottom-color: var(--ts-primary); background: #fff;
}
.ts-tab-content { display: none; }
.ts-tab-content.active { display: block; animation: fadeIn 0.4s; }

.ts-material-header { display: none; } 
.ts-embed-responsive { background: #000; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }


/* =========================================
   5. NAVBAR MENU (Desktop)
   ========================================= */
.ts-navbar { width: 100%; z-index: 9999; font-family: var(--ts-font); position: relative; }
.ts-navbar-dark { background-color: transparent !important; position: absolute; top: 0; left: 0; width: 100%; } 
.ts-nav-container { max-width: 1200px; margin: 0 auto; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; }
.ts-nav-logo img { height: 50px; width: auto; display: block; }

.ts-menu { display: flex; gap: 30px; align-items: center; }
.ts-menu > li > a { 
    font-weight: 600; font-size: 16px; color: #fff; 
    padding: 8px 0; transition: color 0.2s; text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.ts-navbar-light .ts-menu > li > a { color: #333; text-shadow: none; }
.ts-menu > li > a:hover { color: var(--ts-primary); }

/* Dropdowns */
.ts-menu .sub-menu {
    position: absolute; top: 100%; right: 0;
    background: #fff; border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    padding: 20px !important;
    min-width: 320px;
    opacity: 0; visibility: hidden; transform: translateY(15px);
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); 
    z-index: 1000;
}
.ts-menu li:hover .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.ts-menu .sub-menu li { margin-bottom: 8px !important; width: 100%; }
.ts-menu .sub-menu li a {
    display: flex !important; flex-direction: row; align-items: center;
    padding: 12px 15px !important; color: #444 !important; text-shadow: none !important;
    border-radius: 8px; transition: all 0.2s;
    font-weight: 600; border: 1px solid transparent; background-color: #fff;
}
.ts-menu .sub-menu li a:hover { 
    background-color: #fcfcfc !important; border-color: #eee; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); transform: translateY(-2px);
    color: var(--ts-primary) !important;
}

/* Títulos y Descripciones */
.ts-menu-link-card { display: flex; flex-direction: column; align-items: flex-start; }
.ts-menu-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.ts-menu-desc { font-size: 12px; color: #888; font-weight: 400; margin-top: 2px; }

/* Mega Grid */
.ts-menu > li.ts-mega-grid { position: relative; }
.ts-menu > li.ts-mega-grid .sub-menu {
    width: 360px; right: auto; left: 50%; transform: translateX(-50%) translateY(15px);
    display: flex; flex-direction: column; 
}
.ts-menu > li.ts-mega-grid:hover .sub-menu { transform: translateX(-50%) translateY(0); }
.ts-menu > li.ts-mega-grid .sub-menu a::before { display: none !important; }

/* Icons & Colors */
.ts-menu .sub-menu li.ts-level-link a { background: #fdf2f8 !important; color: var(--ts-primary) !important; justify-content: flex-start; }
.ts-menu .sub-menu li.ts-level-link a:hover { background: var(--ts-primary) !important; color: #fff !important; }
.ts-menu .sub-menu li.ts-level-link a::before { content: "\f02d"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 12px; font-size: 16px; }

.ts-menu .sub-menu li.ts-external-highlight a { background-color: #fffbeb !important; color: #d97706 !important; justify-content: center; }
.ts-menu .sub-menu li.ts-external-highlight a::before { content: "\f19d"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 8px; }

.ts-menu .sub-menu li.ts-logout-item { border-top: 1px solid #eee; margin-top: 15px !important; padding-top: 15px !important; }
.ts-menu .sub-menu li.ts-logout-item a { color: #dc2626 !important; justify-content: center; background: transparent !important; }

/* CTA */
.ts-menu > li.ts-cta > a {
    background-color: var(--ts-primary); color: #fff !important;
    padding: 10px 24px; border-radius: 50px;
    box-shadow: 0 4px 10px rgba(227, 4, 126, 0.3); text-shadow: none;
}
.ts-menu > li.ts-cta > a:hover { background-color: var(--ts-primary-dark); transform: translateY(-1px); }


/* =========================================
   6. MOBILE MENU
   ========================================= */
.ts-mobile-trigger { 
    display: none; background: none; border: none; cursor: pointer; 
    flex-direction: column; gap: 6px; z-index: 100005; padding: 10px; 
}
.ts-mobile-trigger span { display: block; width: 30px; height: 3px; border-radius: 3px; transition: 0.3s; }
.ts-navbar-dark .ts-mobile-trigger span { background: #fff; }
.ts-navbar-light .ts-mobile-trigger span { background: #333; }

.ts-navbar.mobile-open .ts-mobile-trigger span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); background: #fff; }
.ts-navbar.mobile-open .ts-mobile-trigger span:nth-child(2) { opacity: 0; }
.ts-navbar.mobile-open .ts-mobile-trigger span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); background: #fff; }

.ts-nav-mobile { 
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; 
    background-color: var(--ts-primary); 
    z-index: 100000; 
    opacity: 0; visibility: hidden; pointer-events: none; 
    transition: all 0.3s ease; 
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    padding: 80px 20px 40px; overflow-y: auto;
}
.ts-navbar.mobile-open .ts-nav-mobile { opacity: 1; visibility: visible; pointer-events: all; }

.ts-mobile-content { width: 100%; max-width: 400px; text-align: center; }
.ts-mobile-list li { margin-bottom: 15px; opacity: 0; transform: translateY(10px); transition: 0.3s; }
.ts-navbar.mobile-open .ts-mobile-list li { opacity: 1; transform: translateY(0); }

.ts-navbar.mobile-open .ts-mobile-list li:nth-child(1) { transition-delay: 0.1s; }
.ts-navbar.mobile-open .ts-mobile-list li:nth-child(2) { transition-delay: 0.15s; }
.ts-navbar.mobile-open .ts-mobile-list li:nth-child(3) { transition-delay: 0.2s; }
.ts-navbar.mobile-open .ts-mobile-list li:nth-child(4) { transition-delay: 0.25s; }
.ts-navbar.mobile-open .ts-mobile-list li:nth-child(5) { transition-delay: 0.3s; }

.ts-mobile-list li a { font-size: 20px; font-weight: 700; color: #fff !important; display: block; padding: 8px; }

.ts-mobile-list .sub-menu {
    background: rgba(255,255,255,0.15); border-radius: 12px;
    padding: 10px !important; margin-top: 5px !important; display: none;
}
.ts-mobile-list .menu-item-has-children > a::after { content: " \f078"; font-family: "Font Awesome 6 Free"; font-size: 14px; margin-left: 8px; vertical-align: middle; }
.ts-mobile-list .sub-menu li { margin-bottom: 5px !important; transform: none; opacity: 1; }
.ts-mobile-list .sub-menu a { font-size: 16px; font-weight: 500; padding: 8px; }
.ts-mobile-list .ts-menu-desc { display: none; }


/* =========================================
   7. RESPONSIVE UTILS
   ========================================= */
@media (max-width: 980px) {
    .ts-nav-desktop { display: none; }
    .ts-mobile-trigger { display: flex; }
    .ts-profile-card { grid-template-columns: 1fr; height: auto; min-height: auto; }
    .ts-profile-sidebar { border-right: none; border-bottom: 1px solid var(--ts-border); }
    .ts-row { grid-template-columns: 1fr; }
}

/* Loader */
#ts-global-loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #fff; z-index: 999999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s ease;
}
#ts-global-loader.hidden { opacity: 0; visibility: hidden; }

/* Popups */
.ts-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 100000; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(4px); }
.ts-popup-card { background: #fff; padding: 40px; border-radius: 20px; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.2); }
.ts-popup-icon.warning { color: #d97706; background: #fff7ed; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 30px; }
.ts-popup-actions { display: flex; gap: 15px; justify-content: center; margin-top: 25px; }