/* ==========================================================================
   DARK MODE - PAZZUR RAVNICA (Optimizado para MyAAC)
   ========================================================================== */

/* Se pasa el fondo directamente al body con posición fija para que cubra toda la pantalla sin cortarse */
body.dark-theme {
    background-color: #0e1014 !important;
    background-image: url('images/header/background-artwork02.png') !important;
    background-attachment: fixed !important;
    background-position: top center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    color: #d7d7d7 !important;
}

/* Dejamos transparente el ArtworkHelper para que no limite la altura del fondo */
body.dark-theme #ArtworkHelper {
    background: transparent !important;
}

/* Forzar cambio de bg_top.png a bg_top02.png en el panel de highscores/themeboxes */
body.dark-theme .top_level {
    background-image: url('images/themeboxes/bg_top02.png') !important;
}

/* Colores brillantes con resplandor para diferenciar Online/Offline en fondo oscuro */
body.dark-theme .online {
    color: #00FF00 !important;
    text-shadow: 1px 1px 2px #000, 0px 0px 5px #00FF00 !important;
    font-weight: bold;
}

body.dark-theme .offline {
    color: #FF4D4D !important;
    text-shadow: 1px 1px 2px #000 !important;
}

/* ==========================================================================
   CAJAS Y CONTENEDORES PRINCIPALES
   ========================================================================== */

body.dark-theme .Content .Box {
    background: #111317 !important;
    border-left: 2px solid #2a2e35 !important;
    border-right: 2px solid #2a2e35 !important;
    color: #ddd !important;
}

body.dark-theme .Content .BoxContent {
    background: #17191e !important;
    color: #ddd !important;
}

/* ==========================================================================
   TEXTO GENERAL Y ENLACES (Acotados al bloque central para proteger el menú)
   ========================================================================== */

body.dark-theme .Content p,
body.dark-theme .Content span,
body.dark-theme .Content div:not(.Headline):not(.MainHeadline):not(.CaptionContainer):not(.CaptionInnerContainer) {
    color: #ddd;
}

body.dark-theme .Content a {
    color: #d9b25d !important;
}

body.dark-theme .Content a:hover {
    color: #ffd76a !important;
}

/* Corrección de textos oscuros inyectados o forzados con etiquetas antiguas */
body.dark-theme font[color="black"],
body.dark-theme font[color="#000000"],
body.dark-theme font[color="#5A2800"]:not(.NewsHeadlineText),
body.dark-theme .TickerText,
body.dark-theme .NewsTicker td:not(.NewsTickerTitle),
body.dark-theme .NewsTickerText {
    color: #ddd !important;
}

/* Mantener legibles las clases heredadas del diseño clásico */
body.dark-theme .ff_info,
body.dark-theme .ff_infotext,
body.dark-theme .ff_pagetext,
body.dark-theme .BoxContent td:not([class*="Headline"]):not([class*="Caption"]),
body.dark-theme .BoxContent td .white {
    color: #ddd !important;
}

/* ==========================================================================
   TABLAS, FILAS Y CELDAS (Separación por tonos oscuros sin líneas internas)
   ========================================================================== */

/* Contenedores estructurales */
body.dark-theme .TableContainer,
body.dark-theme .TableContentContainer {
    background: #14161a !important;
    border: 1px solid #2a2e35 !important;
}

/* Quitar cuadrículas y bordes (EXCLUYENDO encabezados nativos) */
body.dark-theme .Content table,
body.dark-theme .Content tr,
body.dark-theme .Content td:not(.NewsHeadlineBackground):not([background]):not([style*="background"]):not([class*="Headline"]):not([class*="Caption"]),
body.dark-theme .Content .Table1,
body.dark-theme .Content .Table2,
body.dark-theme .Content .Table3,
body.dark-theme .Content .Table4,
body.dark-theme .Content .Table5,
body.dark-theme .TableContent,
body.dark-theme .TableData,
body.dark-theme .Table2 .InnerTableContainer td,
body.dark-theme .Table3 .TableContentAndRightShadow td {
    border: none !important;
}

/* Separación intermitente exclusiva usando alternancia de tonos oscuros (EXCLUYENDO encabezados) */
body.dark-theme .Content tr:nth-child(odd) td:not(.NewsHeadlineBackground):not([background]):not([style*="background"]):not([class*="Headline"]):not([class*="Caption"]),
body.dark-theme .TableContainer .Odd,
body.dark-theme .Content .BoxContent .Odd {
    background-color: #1a1c22 !important;
}

body.dark-theme .Content tr:nth-child(even) td:not(.NewsHeadlineBackground):not([background]):not([style*="background"]):not([class*="Headline"]):not([class*="Caption"]),
body.dark-theme .TableContainer .Even,
body.dark-theme .Content .BoxContent .Even {
    background-color: #111317 !important;
}

/* Labels de Formularios e Información Vertical/Horizontal */
body.dark-theme .LabelH,
body.dark-theme .LabelH td,
body.dark-theme .LabelV,
body.dark-theme .LabelV120,
body.dark-theme .LabelV150,
body.dark-theme .LabelV200 {
    background: #23262d !important;
    color: #fff !important;
}

/* ==========================================================================
   CORRECCIÓN FINAL: SECCIÓN SKILLS Y EQUIPAMENTO
   ========================================================================== */

/* 1. Evita que el color de fondo pise los gráficos de progreso (EXCLUYE encabezados) */
body.dark-theme .Content tr td[background]:not(.NewsHeadlineBackground):not([class*="Headline"]):not([class*="Caption"]),
body.dark-theme .Content tr td[style*="background"]:not(.NewsHeadlineBackground):not([class*="Headline"]):not([class*="Caption"]) {
    background-color: transparent !important;
}

/* 2. Forzado estricto del tono oscuro sobre la subtabla interna de Skills y el contenedor de Equipment */
body.dark-theme .Content td[width="30%"] table,
body.dark-theme .Content td[width="30%"] table tr td,
body.dark-theme .Content td[width="70%"] table,
body.dark-theme .Content td[width="70%"] table tr td,
body.dark-theme .Content td[style*="background-color: #F1E0C6"],
body.dark-theme .Content td[style*="background-color: #D4C0A1"],
body.dark-theme .Content td[bgcolor="#F1E0C6"],
body.dark-theme .Content td[bgcolor="#D4C0A1"] {
    background-color: #1a1c22 !important;
    background-image: none !important;
    color: #ddd !important;
}

/* Redireccionar alternancia para las barritas/filas de skills nativas */
body.dark-theme .Content td[width="30%"] table tr:nth-child(odd) td {
    background-color: #1a1c22 !important;
}
body.dark-theme .Content td[width="30%"] table tr:nth-child(even) td {
    background-color: #111317 !important;
}

/* 3. PROTECCIÓN DEL SET / EQUIPMENT */
body.dark-theme .Content .BoxContent td table tr td table tr td,
body.dark-theme .Content td[width="70%"] table tr td table tr td {
    border: 1px solid #3a3f47 !important;
    background-color: #111317 !important;
}

/* ==========================================================================
   PROTECCIÓN ESTRICTA DE ENCABEZADOS Y CAPTIONS (News, News Ticker, Guilds, etc.)
   ========================================================================== */

body.dark-theme .NewsHeadlineBackground,
body.dark-theme .NewsHeadlineBackground td,
body.dark-theme .NewsTicker table td[style*="background-image"],
body.dark-theme .Content td[style*="newsheadline_background"],
body.dark-theme .Headline,
body.dark-theme .MainHeadline,
body.dark-theme .CaptionContainer,
body.dark-theme .CaptionInnerContainer,
body.dark-theme .TableContainer th,
body.dark-theme .Content .Table1 th {
    background-color: transparent !important;
    background-image: inherit !important;
    color: inherit !important;
    border: inherit !important;
}

/* ==========================================================================
   FORMULARIOS E INPUTS
   ========================================================================== */

body.dark-theme input,
body.dark-theme textarea,
body.dark-theme select {
    background: #111317 !important;
    color: white !important;
    border: 1px solid #444 !important;
    padding: 3px !important;
}

body.dark-theme input[type="submit"],
body.dark-theme input[type="button"],
body.dark-theme button {
    cursor: pointer !important;
}

/* ==========================================================================
   MENÚ NAVEGACIÓN IZQUIERDO
   ========================================================================== */

body.dark-theme .Submenu {
    background: #17191e !important;
}

body.dark-theme .SubmenuitemLabel {
    border-bottom: 1px solid #333 !important;
}

/* ==========================================================================
   FOOTER (PIE DE PÁGINA)
   ========================================================================== */

body.dark-theme #Footer {
    color: #888 !important;
}

body.dark-theme #Footer a {
    color: #aaa !important;
}

/* ==========================================================================
   SCROLLBAR PERSONALIZADO
   ========================================================================== */

body.dark-theme ::-webkit-scrollbar {
    width: 12px;
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

body.dark-theme ::-webkit-scrollbar-track {
    background: #0e1014;
}

/* ==========================================================================
   RESTAURACIÓN TOTAL DEL MENÚ LATERAL IZQUIERDO
   ========================================================================== */

body.dark-theme .LeftChain,
body.dark-theme .RightChain,
body.dark-theme .Submenuitem .LeftChain,
body.dark-theme .Submenuitem .RightChain {
    background-image: url('images/general/chain.gif') !important;
}

body.dark-theme #Loginbox,
body.dark-theme #Loginbox .LoginBorder,
body.dark-theme #BorderLeft,
body.dark-theme #BorderRight,
body.dark-theme .LoginWindow .LoginBorder {
    background-image: url('images/general/chain.gif') !important;
}

body.dark-theme #LoginTop,
body.dark-theme #MenuTop,
body.dark-theme .LoginWindow #LoginTop {
    background-image: url('images/general/box-top.gif') !important;
}

body.dark-theme #LoginBottom,
body.dark-theme #MenuBottom,
body.dark-theme .LoginWindow #LoginBottom {
    background-image: url('images/general/box-bottom.gif') !important;
}

body.dark-theme .MenuButton {
    background-image: url('images/menu/button-background.gif') !important;
}
body.dark-theme .MenuButton:hover {
    background-image: url('images/menu/button-background-over.gif') !important;
}

body.dark-theme .light_lu,
body.dark-theme .light_ld,
body.dark-theme .light_ru,
body.dark-theme .light_rd {
    background-image: url('images/menu/green-light.gif') !important;
}