/*
Theme Name: MediaTheme
Theme URI: https://serenotv.com/
Author: Serenotv
Author URI: https://serenotv.com
Description: Tema minimalista y potente para plataformas de medios. Diseñado para ser contenedor limpio con soporte total para plugins.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mediatheme
Tags: responsive, custom-menu, custom-logo, featured-images, full-width-template, pwa, accessibility-ready
*/

/* ============================================================
   CSS CUSTOM PROPERTIES — Editables desde Panel del Tema
   ============================================================ */
:root {
  /* Colores principales */
  --mt-bg:           #0c3d54;
  --mt-header-bg:    #335163;
  --mt-menu-bg:      #335163;
  --mt-footer-bg:    #1a1a2e;
  --mt-text:         #ffffff;
  --mt-heading:      #dd9933;
  --mt-link:         #ffffff;
  --mt-link-hover:   #dd9933;
  --mt-btn-bg:       #0d6efd;
  --mt-btn-text:     #ffffff;
  --mt-btn-hover:    #0b5ed7;
  --mt-btn-active:   #0a58ca;
  --mt-accent:       #dd9933;

  /* Tipografía */
 /* --mt-font-body:    'Nunito', 'Segoe UI', sans-serif;
  --mt-font-heading: 'Oswald', 'Segoe UI', sans-serif;*/
  --mt-font-size:    16px;
  --mt-line-height:  1.6;

  /* Dimensiones */
  --mt-header-h:     64px;
  --mt-footer-h:     auto;
  --mt-menu-w:       260px;
  --mt-menu-w-icons: 58px;
  --mt-content-pad:  24px;
  --mt-radius:       6px;
  --mt-transition:   0.25s ease;

  /* Z-index */
  --z-header:  1000;
  --z-menu:    999;
  --z-modal:   1100;
  --z-overlay: 1090;
  --z-toast:   1200;
}

/* ============================================================
   RESET MÍNIMO
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: var(--mt-font-size);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: var(--mt-font-body);
  background: var(--mt-bg);
  color: var(--mt-text);
  line-height: var(--mt-line-height);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--mt-font-heading);
  color: var(--mt-heading);
  line-height: 1.2;
}
option  {
  background:var(--mt-bg);color:#fff;}
  
select#mta-post-status{
    padding: 4px;
}  

/* Links */
a { color: var(--mt-link); text-decoration: none; transition: color var(--mt-transition); }
a:hover { color: var(--mt-link-hover); }

/* Imágenes */
img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   LAYOUT BASE — Sidebar + Main
   ============================================================ */
#mt-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/*computadores / tv */
#mt-body-wrap {
  display: flex;
  flex: 1;
}

/* Modo plantilla fija (sin scroll — usado por plugin) */
body.mt-fixed-template #mt-body-wrap {
  height: calc(100vh - var(--mt-header-h));
  overflow: hidden;
}

/* ============================================================
   HEADER
   ============================================================ */
#mt-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--mt-header-h);
  background: var(--mt-header-bg);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  box-shadow: 0 6px 20px rgb(0 0 0 / 55%), 0 2px 4px rgb(0 0 0 / 40%), inset 0 1px 0 rgb(255 255 255 / 18%), inset 0 -8px 4px rgb(0 0 0 / 30%);

}

/* Hook Pre-Header */
#mt-pre-header { width: 100%; }

.mt-header-logo { flex-shrink: 0; }
.mt-header-logo a { display: flex; align-items: center; gap: 10px; }
.mt-header-logo img { height: 60px; width: auto; margin-top: -10px;}
@media(max-width:768px){
.mt-header-logo img { height: 40px;}}

.mt-header-spacer { flex: 1; }

.mt-header-actions { display: flex; align-items: center; gap: 12px; }

/* ============================================================
   SIDEBAR MENU — Desktop/TV
   ============================================================ */
#mt-sidebar {
  width: var(--mt-menu-w);
  min-width: var(--mt-menu-w);
  background: var(--mt-menu-bg);
  position: sticky;
  top: var(--mt-header-h);
  height: calc(100vh - var(--mt-header-h));
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 6px 0 20px rgb(0 0 0 / 55%), 2px 0 4px rgb(0 0 0 / 40%), inset 1px 0 0 rgb(255 255 255 / 18%), inset -8px 0 4px rgb(0 0 0 / 30%);
  z-index: 2;
}

#mt-sidebar.collapsed {
  width: var(--mt-menu-w-icons);
  min-width: var(--mt-menu-w-icons);
}

/* Botón toggle sidebar */
#mt-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 14px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--mt-text);
  font-size: 1.2rem;
  width: 100%;
}
#mt-menu-toggle:hover { background: rgba(255,255,255,0.08); }

/* Menú nav items */
#mt-sidebar .mt-nav-menu { list-style: none; padding: 8px 0; flex: 1; }

#mt-sidebar .mt-nav-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  color: var(--mt-text);
  white-space: nowrap;
  overflow: hidden;
  border-left: 3px solid transparent;
}
#mt-sidebar .mt-nav-menu li a:hover,
#mt-sidebar .mt-nav-menu li.current-menu-item > a {
  background: rgba(255,255,255,0.1);
  border-left-color: var(--mt-accent);
  color: var(--mt-accent);
}

#mt-sidebar .mt-nav-menu .mt-menu-icon {
  font-size: 1.00rem;
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.mt-menu-label { transition: opacity var(--mt-transition); }
#mt-sidebar.collapsed .mt-menu-label { opacity: 0; pointer-events: none; width: 0; }

/* Submenus */
#mt-sidebar .mt-nav-menu ul {
  list-style: none;
  padding-left: 36px;
  max-height: 0;
  overflow: hidden;
}
#mt-sidebar .mt-nav-menu li.open > ul { max-height: 500px; }

/* TV: foco navegación */
#mt-sidebar .mt-nav-menu li a:focus {
  outline: 2px solid var(--mt-accent);
  outline-offset: -2px;
}

/* ============================================================
   CONTENT AREA
   ============================================================ */
#mt-content {
  flex: 1;
  padding: var(--mt-content-pad);
  min-width: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
#mt-footer {
  background: var(--mt-footer-bg);
  color: var(--mt-text);
  padding: 16px 24px;
  width: 100%;
}
/* Hook Pre-Footer */
#mt-pre-footer { width: 100%; }

/* ============================================================
   BOTONES 3D
   ============================================================ */
.mt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 1rem;
  font-family: var(--mt-font-body);
  font-weight: 600;
  color: var(--mt-btn-text);
  background: var(--mt-btn-bg);
  border: none;
  border-radius: var(--mt-radius);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3), 0 6px 10px rgba(0,0,0,0.25);
  user-select: none;
}
.mt-btn:hover {
  background: var(--mt-btn-hover);
  transform: translateY(-1px);
  box-shadow: 0 5px 0 rgba(0,0,0,0.3), 0 8px 14px rgba(0,0,0,0.3);
  color: var(--mt-btn-text);
}
.mt-btn:active {
  background: var(--mt-btn-active);
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
}
.mt-btn .mt-btn-icon { color: #fff; font-size: 1.1em; }

/* ============================================================
   MODAL / POP-UP LOGIN
   ============================================================ */
#mt-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: var(--z-overlay);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
}
#mt-modal-overlay.active { display: flex; }

.mt-modal {
  background: var(--mt-header-bg);
  border-radius: 10px;
  width: 90%;
  max-width: 420px;
  position: relative;
  z-index: var(--z-modal);
  box-shadow: 
    0 6px 20px rgb(0 0 0 / 55%), 
    0 2px 4px rgb(0 0 0 / 40%), 
    inset 0 0 0 1px rgb(255 255 255 / 18%), 
    inset 0 0 10px 2px rgb(0 0 0 / 30%);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

.mt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mt-modal-title { 
  font-family: var(--mt-font-heading); 
  color: var(--mt-heading); 
  font-size: 1.2rem; 
}

.mt-modal-close { 
  background: none; 
  border: none; 
  color: var(--mt-text); 
  font-size: 1.4rem; 
  cursor: pointer; 
  padding: 4px 8px; 
}
.mt-modal-close:hover { color: var(--mt-accent); }

.mt-modal-body { padding: 20px; }

.mt-modal-tabs { 
  display: flex; 
  margin-bottom: 20px; 
  border-bottom: 1px solid rgba(255,255,255,0.1); 
  gap: 4px;
}

.mt-tab-btn {
  flex: 1; 
  padding: 12px 5px; 
  background: rgba(255,255,255,0.03); 
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer; 
  font-size: 0.85rem; 
  font-weight: 600;
  border-radius: 8px 8px 0 0;
  margin-bottom: -1px; 
 /* transition: all var(--mt-transition);*/
}

.mt-tab-btn.active { 
  color: var(--mt-accent); 
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  border-bottom: 2px solid var(--mt-accent);
}

.mt-tab-btn:hover:not(.active) {
  background: rgba(255,255,255,0.06);
  color: var(--mt-text);
}

.mt-tab-panel { display: none; }
.mt-tab-panel.active { display: block; }

.mt-tab-panel p { margin-bottom: 15px; }
.mt-tab-panel label { color: var(--mt-text); display: block; margin-bottom: 5px; font-size: 0.9rem; }

.mt-tab-panel input[type="text"],
.mt-tab-panel input[type="password"],
.mt-tab-panel input[type="email"],
.mt-tab-panel select {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--mt-text);
  border-radius: var(--mt-radius);
  width: 100%;
  padding: 10px 12px;
  outline: none;
}

.mt-tab-panel input:focus {
  border-color: var(--mt-accent);
}

.mt-btn {
  background: var(--mt-btn-bg);
  color: #fff;
  border: none;
  border-radius: var(--mt-radius);
  padding: 12px;
  cursor: pointer;
  font-weight: 600;
  width: 100%;
 /* transition: background var(--mt-transition);*/
}
.mt-btn:hover { background: var(--mt-btn-hover); }

select#mt-account-type{
    background: var(--mt-header-bg);}

.mt-google-login-wrap {
  margin: 15px 0;
  text-align: center;
  width: 100%;
}

.mt-form-error { 
  color: #ff6b6b; 
  font-size: 0.85rem; 
  margin-top: 10px; 
  text-align: center; 
}

/* ============================================================
   AVATAR / USER MENU
   ============================================================ */
.mt-user-btn {
  position: relative;
  cursor: pointer;
}
.mt-user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  object-fit: cover;
  transition: border-color var(--mt-transition);
}
.mt-user-avatar:hover { border-color: var(--mt-accent); }

.mt-user-icon { font-size: 1.6rem; color: var(--mt-text); }

.mt-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: var(--mt-header-bg);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--mt-radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: var(--z-modal);
  overflow: hidden;
  font-size: 17px;
}
.mt-user-dropdown.open { display: block; animation: mt-modal-in 0.2s ease; }
.mt-user-dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--mt-text); transition: background var(--mt-transition);
}
.mt-user-dropdown a:hover { background: rgba(255,255,255,0.1); color: var(--mt-accent); }

/* ============================================================
   HAMBURGUER — Mobile
   ============================================================ */
#mt-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
  z-index: calc(var(--z-header) + 1);
}
#mt-hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--mt-text);
 /* transition: transform 0.3s, opacity 0.3s;*/
}
#mt-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
#mt-hamburger.open span:nth-child(2) { opacity: 0; }
#mt-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile overlay */
#mt-sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: calc(var(--z-menu) - 1);
}
#mt-sidebar-overlay.active { display: block; }

/* ============================================================
   LOADER / SPINNER
   ============================================================ */
.mt-loader {
  display: none; position: fixed; inset: 0;
  background: rgba(12,61,84,0.7); z-index: 9999;
  align-items: center; justify-content: center; flex-direction: column; gap: 12px;
}
.mt-loader.active { display: flex; }
.mt-spinner {
  width: 42px; height: 42px;
  border: 4px solid rgba(255,255,255,0.15);
  border-top-color: var(--mt-accent);
  border-radius: 50%;
  animation: mt-spin 0.75s linear infinite;
}
@keyframes mt-spin { to { transform: rotate(360deg); } }
.mt-loader-text { color: var(--mt-text); font-size: 0.9rem; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#mt-toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px; z-index: var(--z-toast);
}
.mt-toast {
  padding: 12px 18px; border-radius: var(--mt-radius);
  color: #fff; font-size: 0.9rem; min-width: 220px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: mt-toast-in 0.3s ease;
}
@keyframes mt-toast-in { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }
.mt-toast-success { background: #198754; }
.mt-toast-error   { background: #dc3545; }
.mt-toast-info    { background: #0d6efd; }

/* ============================================================
   MAINTENANCE / COMING SOON
   ============================================================ */
body.mt-maintenance {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; text-align: center;
}
.mt-maintenance-wrap { max-width: 480px; padding: 40px; }
.mt-maintenance-wrap h1 { color: var(--mt-heading); font-size: 2rem; margin-bottom: 16px; }

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  #mt-hamburger { display: flex; }
  #mt-sidebar {
  	position: absolute; 
    top: var(--mt-header-h);
    left: -100%;
    height: calc(100vh - var(--mt-header-h));
    z-index: var(--z-menu);
    /*transition: left 0.3s ease;*/
    width: 280px;
    min-width: 280px;
    
  }
  #mt-sidebar.mobile-open { left: 0; }
  #mt-sidebar.collapsed {
    width: 280px;
    min-width: 280px;
  }
  #mt-sidebar.collapsed .mt-menu-label { opacity: 1; width: auto; }

  #mt-menu-toggle { display: none; }

  #mt-header .mt-header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

 /* #mt-content { padding: 16px; }*/
}

/* ============================================================
   FULL SCREEN PAGES (sin zoom)
   ============================================================ */
html, body { width: 100%; max-width: 100%; }

/* ============================================================
   SCROLLBAR PERSONALIZADO
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.35); }

/* ============================================================
   ACCESSIBILITY / TV FOCUS
   ============================================================ */
:focus-visible { outline: 2px solid var(--mt-accent); outline-offset: 3px; }

/* ============================================================
   UTILIDADES
   ============================================================ */
.mt-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.mt-hidden   { display: none !important; }
.mt-flex     { display: flex; }
.mt-gap-8    { gap: 8px; }
