/* --- IDENTIDADE CORPORATIVA USC (FINAL REFINED) --- */
/* Importamos fontes con soporte para Cursiva (Italic) */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Serif:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    /* Paleta Oficial USC */
    --usc-blue: #000066; /* Azul USC máis vivo */
    --usc-dark-blue: #000066; /* Variable duplicada intencionalmente para uso futuro */
    --usc-gold: #c59b25;
    --usc-bg: #efeff9; /* Fondo Lavanda Suave */
    --usc-gray: #ccc;
    --usc-light-blue: #e1f4f1;
    --text-main: #121212;
    --white: #ffffff;
    --border-light: #e0e0e0;
}

h3, h4, h5, h6 {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 700;
    color: var(--usc-blue);
}

/* 1. RESET E BASE */
* { box-sizing: border-box; }

body {
    background-color: var(--usc-blue);
    color: var(--text-main);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* 2. CONTENEDOR PRINCIPAL (BOXED LAYOUT) */
#punwrap {
    background-color: var(--white);
    width: 90%; 
    max-width: 1100px;
    margin: 40px auto; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-top: none; 
    border-radius: 4px;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    body { margin: 0; }
    #punwrap { width: 100%; margin: 0; border-radius: 0; border-top: none; box-shadow: none; }
}

/* 3. CABECERA TIPO "HERO" */
#brdheader {
    background: 
        url('/img/usc-negativo-azul.png') no-repeat,
        linear-gradient(to bottom, rgba(0, 76, 147, 0.65), rgba(0, 0, 102, 0.75) 80%, rgb(0, 0, 102)),
        url('https://assets.usc.gal/sites/default/files/singular-sites/headers/2023-04/banner-g_1.jpg') no-repeat;
    
    background-size: 200px auto, cover, cover;
    background-position: right 20px bottom 20px, center center, center center;
    
    color: var(--white);
    padding: 3rem 2rem 5rem 2rem; 
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

#brdheader h1 {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 700;
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02rem;
    line-height: 1.1;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#brdheader h1 a { color: var(--white); text-decoration: none; }
#brdheader h1 i { font-style: italic; font-weight: 400; }

#brdheader .usc-subtitle {
    font-family: 'IBM Plex Serif', serif;
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 0.2rem;
    font-weight: 400;
}

/* CUADRADITO FLOTANTE (LOGIN/STATUS) */
#brdwelcome {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: var(--usc-blue); 
    padding: 10px 15px;
    border-radius: 0; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.5); 
    text-align: right;
    font-size: 0.8rem;
    color: var(--white); 
    z-index: 10;
    border-left: none; 
}

#brdwelcome .conl { 
    margin: 0; 
    font-weight: 600; 
    display: block; 
    margin-bottom: 5px; 
    color: var(--white); 
}

#brdwelcome ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; justify-content: flex-end; font-size: 0.75rem; }
#brdwelcome li { display: inline-block; }

#brdwelcome a { 
    color: var(--white);
    font-weight: 500; 
    text-decoration: none; 
}
#brdwelcome a:hover { 
    color: var(--usc-gold);
    text-decoration: underline; 
}

#brdwelcome span { color: var(--white); }

@media (max-width: 1280px) {
    #brdheader { 
        padding: 2rem 1rem; 
        background: 
            linear-gradient(to bottom, rgba(0, 76, 147, 0.65), rgba(0, 0, 102, 0.75) 80%, rgb(0, 0, 102)),
            url('https://assets.usc.gal/sites/default/files/singular-sites/headers/2023-04/banner-g_1.jpg') no-repeat;
        background-size: cover, cover;
        background-position: center, center;
    }
}

@media (max-width: 1120px) {
    #brdheader { padding: 2rem 1rem; }
    #brdwelcome {
        position: relative; 
        top: auto; right: auto;
        
        width: auto;
        max-width: max-content;  /* Asegura que el ancho solo sea el de su contenido */
        align-self: center;      
        margin-left: auto; margin-right: auto;
        background-color: var(--usc-blue); 
        text-align: center;
        border-radius: 0; 
        border-left: none; 
        border-bottom: 1px solid var(--white); 
        box-shadow: none; 
        margin-bottom: 0;
    }
    #brdwelcome ul { justify-content: center; }
    
    #brdwelcome a, #brdwelcome .conl, #brdwelcome span {
        color: var(--white) !important;
    }
    #brdwelcome a:hover {
        color: var(--usc-gold) !important;
    }
}

/* 4. MENÚ DE NAVEGACIÓN */
#brdmenu {
    background-color: transparent;
    border-bottom: none;
    padding: 0;
    position: relative;
    z-index: 5;
}

#brdmenu ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

#brdmenu li { margin: 0; }

#brdmenu a {
    display: block;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'IBM Plex Serif', serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    border-bottom: 4px solid transparent; 
    transition: all 0.2s ease;
}

#brdmenu a:hover, 
#brdmenu li.isactive a {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-bottom-color: #ffffff;
}

/* 5. ÁREA DE CONTIDO PRINCIPAL */
#brdmain { padding: 2rem 3rem; flex: 1; background-color: var(--usc-bg);}
@media (max-width: 768px) { #brdmain { padding: 1.5rem 1rem; } }

.block .hd h2, h2 {
    color: var(--usc-blue);
    font-family: 'IBM Plex Serif', serif;
    font-weight: 700;
    font-size: 1.4rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 15px;
    margin-top: 0;
}

/* 6. LISTA DE TEMAS (TABLAS) */
.block { margin-bottom: 2rem; }
.box { padding: 0; }

table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 1rem; 
    border: 1px solid #ddd; 
}

th {
    text-align: left;
    background-color: var(--usc-light-blue);
    color: var(--usc-blue);
    font-family: 'IBM Plex Serif', serif;
    font-weight: 700;
    padding: 12px 15px;
    border-bottom: 2px solid #bce0dd;
    font-size: 0.85rem;
    text-transform: uppercase;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #f0f0f0;
    vertical-align: middle;
    background-color: #fff;
}

tr:nth-child(even) td { background-color: #fcfcfc; }
tr:hover td { background-color: #f2f8fc; }

/* Celdas TCL (Título del tema) */
td.tcl { vertical-align: middle; padding: 12px 15px; }

td.tcl .intd {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100%;
}

td.tcl .icon {
    float: left !important;
    width: 45px !important;
    margin-right: 10px !important;
    display: block !important;
    text-align: center;
}

td.tcl .icon .nosize {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--usc-blue);
    float: none !important;
    width: auto !important;
}

td.tcl .tclcon {
    display: block !important;
    margin-left: 55px !important;
    width: auto !important;
    float: none !important;
}

.tclcon h3 { margin: 0; font-size: 1.15rem; font-weight: 700; display: inline-block;}
.tclcon .forumdesc { display: block; color: #666; font-size: 0.9rem; margin-top: 3px; }
.tclcon .byuser { display: block; font-size: 0.85rem; color: #888; margin-top: 3px; }

@media (max-width: 600px) {
    td.tcl .icon { width: 30px !important; }
    td.tcl .tclcon { margin-left: 40px !important; }
}

td.tc2, td.tc3 { text-align: center; width: 10%; color: #666; }
td.tcl { width: 55%; }

/* --- 7. FORMULARIOS E ENQUISAS (OPTIMIZADO) --- */
fieldset {
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    background-color: #fcfcfc;
    margin-bottom: 20px;
}

legend { 
    color: var(--usc-blue); 
    font-family: 'IBM Plex Serif', serif;
    font-weight: 700; 
    padding: 0 10px; 
    font-size: 1.1rem; 
}

/* Corrección Visual: Títulos vs Opciones */
/* Títulos (Labels sin inputs directos o con strong) */
.infldset .rbox > label,
.infldset label:has(strong) {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 8px !important;
    margin-top: 15px !important;
    color: var(--usc-blue) !important;
    font-size: 1.05rem;
    cursor: default !important;
}

/* Opciones seleccionables (Labels con inputs) */
.infldset label:has(input),
.infldset .rbox div label {
    background-color: var(--white) !important;
    border: 1px solid var(--border-light) !important;
    padding: 10px 15px !important;
    margin-bottom: 5px !important;
    margin-top: 5px !important;
    cursor: pointer !important;
    border-radius: 2px;
    display: block !important;
}

/* Hover solo en opciones */
.infldset label:has(input):hover,
.infldset .rbox div label:hover {
    background-color: #f0f7fd !important;
    border-color: var(--usc-blue) !important;
}

.infldset { display: flex; flex-direction: column; }

/* Scroll para lista de grupos */
.rbox div[style*="overflow-y"] {
    max-height: 250px !important;
    min-height: 150px;
    border: 1px solid #ccc !important;
    background: #fff;
    padding: 10px;
    border-radius: 2px;
}

/* Inputs generales */
input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    max-width: 100%; 
    padding: 10px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1rem;
    border: 1px solid #ced4da;
    background-color: #fff;
    border-radius: 0;
}
textarea { height: auto; min-height: 120px; }

/* Botóns */
input[type="submit"] {
    background-color: var(--usc-blue);
    color: var(--white);
    border: 1px solid transparent;
    padding: 0.6rem 2.5rem;
    font-family: 'IBM Plex Serif', serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 10px 20px 10px 0; /* Margen simplificado */
}
input[type="submit"]:hover {
    background-color: #fff;
    color: var(--usc-blue);
    border-color: var(--usc-blue);
}

/* BBCode Links */
.infldset .bblinks {
    list-style: none; padding: 0; margin: 10px 0 0 0;
    display: flex; flex-wrap: wrap; gap: 20px;
    font-size: 0.85rem; color: #666;
}
.infldset .bblinks a { font-weight: 600; text-decoration: none; margin-right: 5px; }

/* --- 8. VISTA DE HILOS (POSTS) --- */
.blockpost {
    border: 1px solid var(--border-light);
    margin-bottom: 15px;
    background: #fff;
    border-radius: 4px;
}

.blockpost h2 {
    background-color: #f4f6f9;
    padding: 10px 15px;
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
    margin: 0;
    color: #666;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: normal;
}
.blockpost h2 a { text-decoration: none; color: #444; }

.blockpost .postbody {
    display: flex; flex-direction: row; min-height: 150px;
}

.blockpost .postleft {
    width: 220px; background-color: #fafafa; border-right: 1px solid #eee;
    padding: 20px; flex-shrink: 0;
}

.blockpost .postright {
    flex-grow: 1; padding: 20px 30px; overflow: hidden;
}

.postleft dl { margin: 0; font-size: 0.9rem; }
.postleft dt { font-size: 1.1rem; margin-bottom: 5px; font-family: 'IBM Plex Serif', serif; font-weight: 700; }
.postleft dt a { color: var(--usc-blue); text-decoration: none; }
.postleft dd { margin: 0; color: #555; margin-bottom: 2px; }

.postmsg {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 400; font-size: 1.05rem; line-height: 1.6; color: #222; margin-top: 10px;
}

.postfoot {
    padding: 10px 15px; background-color: #fff; border-top: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
.postfootright ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.postfootright li { display: inline-block; }
.postfootright a {
    font-size: 0.85rem; font-weight: 600; color: var(--usc-blue);
    text-transform: uppercase; text-decoration: none;
}

@media (max-width: 768px) {
    .blockpost .postbody { flex-direction: column; }
    .blockpost .postleft { width: 100%; border-right: none; border-bottom: 1px solid #eee; }
}

/* Attachment Box */
.attachment-box {
    margin-top: 15px;
    padding: 10px;
    border: 1px dashed #000;
    background: #f4f4f4;
    border-radius: 0;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.95rem;
}

.attachment-info { margin: 0; display: inline-flex; align-items: center; color: #333; }
.attachment-info a { font-weight: bold; color: var(--usc-blue); margin-left: 5px; text-decoration: underline; }
.attachment-icon { font-size: 1.2em; margin-right: 8px; color: #333; }
.attachment-metadata { font-size: 0.8em; color: #555; text-align: right; }

@media (max-width: 600px) {
    .attachment-box { flex-direction: column; align-items: flex-start; }
    .attachment-metadata { margin-top: 5px; }
}

/* --- 9. NAVEGACIÓN INFERIOR (MIGAS E PAGINACIÓN) --- */
.linkst .inbox, .postlinksb .inbox {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid var(--border-light);
    padding: 15px 0;
    margin-bottom: 20px;
}
.linkst .inbox .clearer, .postlinksb .inbox .clearer { display: none; }

ol.crumbs {
    order: 1; margin-right: auto;
    list-style: none; padding: 0; margin-top: 12px; margin-bottom: 0;
    display: flex; flex-wrap: wrap; align-items: center;
}
ol.crumbs li {
    display: inline-flex; align-items: center;
    font-family: 'IBM Plex Serif', serif; font-weight: 700;
    font-size: 1.1rem; color: var(--usc-blue); margin-right: 5px;
}
ol.crumbs a { text-decoration: none; color: var(--usc-blue); }
ol.crumbs li span { margin: 0 8px; color: #999; font-weight: 400; }

.pagepost { order: 2; display: flex; align-items: center; gap: 15px; }
.pagelink { margin: 0; font-size: 0.95rem; color: #444; }
.pagelink strong { background: #f0f0f0; padding: 2px 8px; color: var(--usc-blue); font-weight: 700; }

.postlink { margin: 0; }
.postlink a {
    color: var(--usc-blue); font-family: 'IBM Plex Serif', serif; font-weight: 700;
    text-transform: uppercase; font-size: 0.9rem; border: 2px solid var(--usc-blue);
    padding: 8px 20px; text-decoration: none; display: inline-block; transition: all 0.2s;
}
.postlink a:hover { background-color: var(--usc-blue); color: var(--white); }
.subscribelink { order: 3; width: 100%; text-align: right; margin-top: 5px; }

@media (max-width: 600px) {
    .linkst .inbox, .postlinksb .inbox { flex-direction: column; align-items: flex-start; gap: 15px; }
    ol.crumbs { margin-right: 0; }
    .pagepost { width: 100%; justify-content: space-between; }
}

/* --- 10. LAYOUT DE ADMINISTRACIÓN (GRID) --- */
@media (min-width: 992px) {
    .block2col {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 30px;
        align-items: start;
    }
    .blockmenu, #adminmenu {
        grid-column: 1 / 2; width: 100% !important; margin-bottom: 0 !important;
    }
    .blockmenu .box {
        position: sticky; top: 20px;
        background: #fff; border: 1px solid var(--border-light);
        box-shadow: 0 2px 5px rgba(0,0,0,0.05); padding: 0;
    }
    .blockmenu h2 {
        font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px;
        background: #f4f6f9; color: var(--usc-blue); padding: 12px 15px;
        border-bottom: 1px solid #eee; margin: 0; font-family: 'IBM Plex Sans', sans-serif;
    }
    .blockmenu ul { list-style: none; padding: 0; margin: 0; }
    .blockmenu li { border-bottom: 1px solid #f0f0f0; margin: 0; }
    .blockmenu a {
        display: block; padding: 10px 15px; color: #444; text-decoration: none;
        font-weight: 500; border-left: 3px solid transparent; font-size: 0.95rem;
    }
    .blockmenu a:hover, .blockmenu li.isactive a {
        background: #fff; color: var(--usc-blue); border-left-color: var(--usc-gold); padding-left: 18px;
    }
    .block2col > div:not(.blockmenu):not(#adminmenu) {
        grid-column: 2 / 3; width: 100% !important; margin-left: 0 !important; margin-bottom: 20px;
    }
    .block2col > div h2 { margin-top: 0; }
}
#punprofile .blockmenu ul, #punadmin .blockmenu ul, #punmod .blockmenu ul { padding-left: 0; list-style: none; }

/* --- 11. PÉ DE PÁXINA, MODERACIÓN E ESTATÍSTICAS (OPTIMIZADO) --- */

#brdfooter {
    background-color: var(--usc-blue);
    color: var(--white);
    padding: 1.5rem;
    text-align: center;
    margin-top: auto;
    font-size: 0.85rem;
}
#brdfooter a { color: var(--white); text-decoration: underline; }
#brdfooter h2 { display: none !important; }

/* Navegación Inferior (Flexbox para alineación) */
#brdfooternav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-top: 10px;
    width: 100%;
}

/* Reset de Floats antiguos */
#brdfooter .conl, #brdfooter .conr {
    float: none !important;
    text-align: left;
    width: auto;
}
#brdfooter .conr { text-align: right; }

/* Formulario "Ir a" (QJump) */
#qjump div { display: flex; align-items: center; }
#qjump label { margin: 0; }
#qjump label span { margin-right: 15px; font-weight: 600; white-space: nowrap; }
#qjump label span br { display: none; }
#qjump select { width: auto !important; max-width: 250px; display: inline-block; height: auto; }
#qjump input[type="submit"] { margin: 0; padding: 0.4rem 1rem; font-size: 0.9rem; height: auto; }

/* Controles de Moderador (Centrados) */
#modcontrols { margin-bottom: 15px; display: flex; justify-content: center; }
#modcontrols dl { display: flex; flex-direction: column; align-items: center; width: 100%; margin: 0; }
#modcontrols dt { margin: 0 0 5px 0 !important; color: #fff; font-weight: bold; padding: 0; text-align: center;}
#modcontrols dd { margin: 0 !important; padding: 0; text-align: center; }
#modcontrols dd a { background: rgba(255,255,255,0.1); padding: 5px 10px; border-radius: 4px; text-decoration: none; }

/* Estadísticas (Grid compacta) */
#brdstats h2 {
    color: var(--usc-blue); font-family: 'IBM Plex Serif', serif; font-weight: 700;
    font-size: 1rem; border-bottom: 2px solid #eee; padding: 8px 15px; margin: 0; display: block !important;
}
#brdstats .box .inbox {
    padding: 10px 15px; display: flex; justify-content: space-between;
    align-items: flex-start; flex-wrap: wrap;
    background-color: #f9f9f9; border: 1px solid #e0e0e0; font-size: 0.85rem; color: #666;
}
#brdstats dl {
    width: 48%; margin: 0; padding: 0; float: none !important;
    display: flex; flex-direction: column;
}
#brdstats dt {
    font-weight: 700; color: var(--usc-blue); font-family: 'IBM Plex Serif', serif;
    border-bottom: 1px dashed #ccc; margin-bottom: 5px; padding-bottom: 2px;
}
#brdstats dd { display: flex; justify-content: space-between; margin: 0; line-height: 1.4; }
#brdstats .clearer { display: none; }

@media (max-width: 768px) {
    #brdfooternav { flex-direction: column; justify-content: center; gap: 15px; }
    #brdfooter .conr { text-align: center; }
    #brdstats { display: none !important; }
}

/* UTILS */
.clearer { clear: both; }
a { color: var(--usc-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- BBCODE TOOLBAR --- */
.bbcode-toolbar {
    margin-bottom: 5px; display: flex; gap: 5px; flex-wrap: wrap;
    background: #f1f3f5; padding: 5px; border: 1px solid #ddd;
    border-bottom: none; border-radius: 3px 3px 0 0;
}
.bbcode-btn {
    background-color: #fff; border: 1px solid #ccc; color: var(--usc-blue);
    font-family: 'IBM Plex Serif', serif; font-weight: 700; font-size: 0.9rem;
    padding: 4px 10px; cursor: pointer; min-width: 30px; text-align: center;
    border-radius: 2px; transition: all 0.2s;
}
.bbcode-btn:hover, .bbcode-toolbar button:hover {
    background-color: var(--usc-blue); color: #fff; border-color: var(--usc-blue);
}
.txtarea textarea {
    margin-top: 0 !important; border-top-left-radius: 0 !important; border-top-right-radius: 0 !important;
}

/* --- ANUNCIO / ALERTA --- */
#announce.block {
    background-color: var(--usc-blue) !important; 
    color: var(--white);
    border-radius: 0; 
    border: none !important; 
    margin: -32px auto -10px auto; 
    padding: 0;
    display: flex !important; 
    align-items: center; 
    height: auto;
}

#announce .hd, #announce h2 { display: none !important; }

#announce .box, #announce-block.inbox {
    border: none !important; 
    background: transparent !important; 
    margin: 0 !important;
    padding: 10px !important; /* Un poco de aire arriba/abajo */
    box-shadow: none !important; 
    display: flex !important; 
    width: 100%;
    
    /* MODIFICACIÓN CLAVE: Centrado */
    justify-content: center; 
    align-items: center;
}

#announce-block.inbox::before {
    content: "ⓘ"; 
    font-size: 1.6rem; 
    color: var(--white);
    /* Ajuste de espacio: solo margen a la derecha para separar del texto */
    padding: 0; 
    margin-right: 15px; 
    
    flex-shrink: 0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    line-height: 1;
    transform: translateY(-1px);
}

#announce .usercontent {
    display: block !important; 
    padding: 0; 
    margin: 0;
    font-family: 'IBM Plex Serif', serif; 
    font-size: 1.05rem; 
    line-height: 1.4;
    font-weight: 400; 
    color: var(--white);
    
    /* MODIFICACIÓN CLAVE: Evitar que se estire */
    flex-grow: 0;  /* Antes era 1 */
    width: auto;   /* Se adapta al tamaño del texto */
    text-align: left; /* El texto en sí se lee de izq a der, pero el bloque está centrado */
}

/* Links dentro del anuncio */
#announce .usercontent a {
    color: var(--white); 
    text-decoration: underline; 
    font-weight: 600;
}

#announce .usercontent a:hover {
    color: #f0f0f0; 
    text-decoration: none; 
}

#announce.block:hover { 
    background-color: var(--usc-blue) !important; 
    cursor: default; 
}

#announce .usercontent p { 
    margin: 0 !important; 
    color: var(--white); 
}

/* Ajuste para móviles: Si el texto es muy largo, que no se rompa feo */
@media (max-width: 600px) {
    #announce .box, #announce-block.inbox {
        flex-direction: column; 
        text-align: center;
    }
    #announce-block.inbox::before {
        margin-right: 0;
        margin-bottom: 5px;
    }
    #announce .usercontent {
        text-align: center;
    }
}

/* --- FIX TABLA EN MÓVILES (HORIZONTAL SCROLL) --- */
@media (max-width: 600px) {
    table thead th:nth-child(2), table thead th:nth-child(3),
    table tbody td:nth-child(2), table tbody td:nth-child(3) { display: none; }
    td.tcl { width: 100% !important; padding-right: 15px !important; }
    td.tcl .icon { display: none !important; width: 0 !important; margin-right: 0 !important; }
    td.tcl .tclcon { margin-left: 0 !important; }
    table { min-width: auto; }
}

/* --- REDIRECCIÓN Y ANIMACIONES --- */
.redirection-page .redirection-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 99999; background-color: #f4f4f9;
    display: flex; justify-content: center; align-items: center;
}
.redirection-page { overflow: hidden; }
.loader-container { text-align: center; padding: 2rem; }
.usc-logo-block { animation: gentle-float 3s ease-in-out infinite; }
.usc-logo-text {
    font-family: 'IBM Plex Serif', serif; line-height: 1.1; margin: 0; display: block;
    background: linear-gradient(to right, var(--usc-blue) 0%, var(--usc-blue) 40%, var(--usc-light-blue) 50%, var(--usc-blue) 60%, var(--usc-blue) 100%);
    background-size: 200% auto; color: transparent; -webkit-background-clip: text; background-clip: text;
    animation: shine-flow 2.5s linear infinite reverse;
}
.main-title { font-weight: 700; font-size: 2.8rem; letter-spacing: -0.5px; }
.sub-title-virtual { font-weight: 400; font-style: italic; font-size: 1.8rem; margin-top: 0.5rem; }
.loading-subtext {
    margin-top: 2rem; font-family: 'IBM Plex Serif', serif; font-weight: 400;
    font-size: 1rem; color: var(--usc-blue); opacity: 0.8; letter-spacing: 1px;
    animation: pulse-fade 1.5s ease-in-out infinite;
}
@keyframes shine-flow { to { background-position: 200% center; } }
@keyframes gentle-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulse-fade { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

#punredirect-message {
	text-align: center; padding: 20px; margin: 0 auto; max-width: 80%;
	background-color: #fff; border: 1px solid #ccc; border-radius: 5px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
#punredirect-message p { margin: 0.5em 0; font-size: 1.1em; }
#punredirect-message .label { font-weight: bold; }
#punredirect-message a { color: #007bff; text-decoration: none; }

/* --- DISEÑO COMPACTO PARA MÓVILES --- */
#js-hamburger-btn { display: none; }

@media (max-width: 768px) {
    #brdheader.header-compacto {
        position: sticky; top: 0; z-index: 1000; padding: 0.5rem 1rem !important; height: auto;
    }
    .header-compacto #js-hamburger-btn {
        display: block; position: absolute; top: 50%; transform: translateY(-83%);
        left: 15px; z-index: 1001; background: transparent; border: none;
        color: #fff; font-size: 1.6rem; padding: 5px; cursor: pointer; line-height: 1; width: auto; margin: 0;
    }
    .header-compacto h1 {
        font-size: 1.2rem !important; margin: 0 !important; padding-left: 35px;
        text-align: center; line-height: 1.2;
    }
    .header-compacto .usc-subtitle { display: none !important; }
    
    /* Header compacto: Usuario abajo */
    .header-compacto #brdwelcome {
        position: fixed; bottom: -1px; left: 0; width: 100%; top: auto; right: auto; height: auto;
        z-index: 9000; background-color: var(--usc-blue); border-top: 1px solid rgba(255,255,255,0.2);
        border-radius: 0; padding: 8px 10px; box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
        display: flex; justify-content: center; align-items: center; font-size: 0.75rem; gap: 15px;
        max-width: none;
    }
    .header-compacto #brdwelcome ul { margin: 0; padding: 0; display: flex; gap: 10px; }
    .header-compacto #brdwelcome .conl li:first-child span { display: flex; gap: 5px; }
    .header-compacto #brdwelcome .conl li:nth-child(2) { display: none; }
    .header-compacto #brdwelcome .conr { font-size: 0.7rem; opacity: 0.9; }

    /* Menú móvil */
    .header-compacto #brdmenu ul {
        display: none; position: absolute; top: 15px; left: 0; width: 100%;
        background-color: var(--usc-dark-blue); z-index: 999; flex-direction: column;
        padding: 0; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    }
    .header-compacto.menu-abierto #brdmenu ul {
        display: flex !important; animation: slideDown 0.2s ease-out;
    }
    .header-compacto #brdmenu ul li a {
        display: block; padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
        text-align: left; font-size: 1rem; color: #fff;
    }
    
    ol.crumbs { margin-top: 5px; margin-bottom: 10px; }
    ol.crumbs li { font-size: 0.85rem; line-height: 1.3; }
    
    /* PWA Mobile Style */
    #pwa-install-link { display: list-item !important; }
    #pwa-install-link a {
        border-bottom: 1px solid rgba(255,255,255,0.1) !important; padding: 12px 20px !important;
        text-align: left !important; background-color: var(--usc-light-blue) !important; color: var(--usc-blue) !important;
    }
}

/* --- BOTÓN INSTALAR PWA --- */
#pwa-install-link { display: block; padding-bottom: 20px; }
#pwa-install-link a {
    display: block; padding: 1rem 1.5rem; text-decoration: none;
    color: var(--usc-dark-blue); font-family: 'IBM Plex Serif', serif; font-weight: 700;
    font-size: 1.2rem; letter-spacing: 0.5px; border-bottom: 4px solid transparent;
    background-color: var(--white); border-bottom: 4px solid var(--usc-light-blue); transition: all 0.2s ease;
}
#pwa-install-link a:hover { background-color: rgba(255, 255, 255, 0.1); color: #ffffff; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- ESTILOS DE ENQUISA / VOTACIÓN (post.php) --- */
.poll-selector-box {
    background: #f4f6f9; padding: 15px; border: 1px solid #ddd; margin-bottom: 20px;
}
.poll-main-question { font-weight: bold; color: var(--usc-blue); margin-bottom: 10px; display: block; }
.poll-type-label { display: inline-block; margin-right: 20px; cursor: pointer; font-weight: 600; }
.poll-type-label span { font-weight: normal; color: #666; }

.poll-thread-config-box {
    display: none; border-left: 3px solid var(--usc-blue); padding-left: 15px; margin-left: 5px; margin-bottom: 15px;
}
.poll-section-title { margin-top: 0; color: var(--usc-blue); font-size: 1.1em; margin-bottom: 10px; }
.poll-helper-text { font-size: 0.9em; color: #666; margin-bottom: 15px; }

.poll-single-config-box { display: none; }
.poll-inherit-notice {
    background: #fff3cd; padding: 10px; border: 1px solid #ffeeba; color: #856404; margin-bottom: 15px; border-radius: 4px;
}
.poll-single-title {
    margin-top: 0; color: var(--usc-blue); font-size: 1.1em; border-left: 3px solid var(--usc-blue); padding-left: 10px; margin-bottom: 15px;
}
.poll-groups-list {
    max-height: 250px; overflow-y: auto; border: 1px solid #ccc; background: #fff; padding: 5px;
}

/* Header Votación Responsive */
.poll-block h2 {
    display: flex !important; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 10px; padding-right: 10px; margin-bottom: 10px;
}
.poll-block h2 span.conl {
    font-weight: 700; font-size: 1.2rem; color: var(--usc-blue); flex-grow: 1;
}
.poll-block h2 .conr {
    float: none !important; display: inline-flex; align-items: center; gap: 10px;
    font-size: 0.75rem; font-family: 'IBM Plex Sans', sans-serif; text-transform: uppercase;
    letter-spacing: 0.5px; background-color: rgba(0, 76, 147, 0.1); padding: 4px 10px;
    border-radius: 1px; border: 1px solid rgba(0, 76, 147, 0.2); color: var(--usc-blue); white-space: nowrap;
}
.poll-block h2 form { margin: 0 !important; display: inline-block; }
.poll-block h2 form input[type="submit"] {
    margin: 0 !important; padding: 4px 8px !important; font-size: 0.7rem !important;
    line-height: 1; height: auto; background-color: var(--usc-blue); color: #fff;
    border-radius: 1px; text-transform: uppercase; border: none; cursor: pointer;
}
.poll-block h2 form input[type="submit"]:hover { background-color: var(--usc-gold); color: #000; }

@media (max-width: 480px) {
    .poll-block h2 { flex-direction: column; align-items: flex-start; }
    .poll-block h2 .conr { width: 100%; justify-content: space-between; margin-top: 5px; }
}

/* --- ESTILOS DE RESULTADOS DE VOTACIÓN (CARDS) --- */

/* 1. Limpieza del contenedor principal */
.poll-block .box .inbox {
    padding: 20px;
    background-color: #fff;
}

/* Ocultar los <br> que pone el sistema entre opciones, ya usaremos márgenes CSS */
.poll-block .box .inbox br {
    display: none;
}

/* 2. Estilo "Cajita" para cada opción */
.poll-option {
    background-color: #fcfcfc;      /* Fondo casi blanco */
    border: 1px solid #e0e0e0;      /* Borde gris suave */
    border-radius: 1px;             /* Bordes ligeramente redondeados */
    padding: 10px;                  /* Espacio interior */
    margin-bottom: 0px;            /* Espacio entre cada cajita */
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); /* Sombra muy sutil para dar volumen */
    transition: all 0.2s ease;
}

/* 3. Mejorar la etiqueta del texto */
.poll-label {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 1rem;
    display: flex;
    justify-content: space-between; /* Si hay texto extra, lo separa */
}

/* Resaltar "(O teu voto)" si aparece */
.poll-label strong {
    color: var(--usc-blue);
    background: rgba(0, 0, 102, 0.1);
    padding: 2px 8px;
    border-radius: 1px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* 4. Estilizar la Barra de Progreso */
.poll-bar-container {
    height: 12px !important;       /* Un poco más gordita */
    background-color: #eee !important;
    border-radius: 1px;           /* Forma de píldora redonda */
    overflow: hidden;              /* Para que la barra interna no se salga de las curvas */
    margin: 8px 0 !important;
}

.poll-bar {
    border-radius: 1px;           /* Redondear también la barra de color */
    background-color: var(--usc-blue) !important; /* Asegurar el azul corporativo */
    /* Opcional: un degradado sutil */
    background: linear-gradient(90deg, var(--usc-blue) 0%, #003399 100%) !important;
}

/* 5. Datos estadísticos (porcentaje) */
.poll-stats {
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 500;
}

/* 6. El texto de "Total votos" al final */
.poll-block p {
    text-align: right;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #444;
    border-top: 1px dashed #ddd;
    padding-top: 10px;
}

/* --- FIX POLL ADMIN (Xestión de Votacións) --- */

/* 1. Arreglo del Combobox (Select) */
/* Sobrescribimos o estilo inline para que se adapte ao contido */
.blocktable td.tc3 form select {
    width: auto !important;       /* Ignora o width:110px do PHP */
    min-width: 140px;             /* Ancho mínimo para ler "Privada (Censo)" */
    flex-grow: 1;                 /* Ocupa o espazo sobrante */
    margin-right: 5px;
}

/* 2. Botóns de Iconos (Usuarios 👥 e Gardar 💾) */
/* Facémolos máis estreitos para que parezan botóns de ferramentas */
.blocktable td.tc3 form input[type="submit"],
.blocktable td.tc3 form input[type="button"] {
    padding: 6px 10px !important; /* Moito menos recheo lateral */
    min-width: auto !important;   /* Eliminamos anchos mínimos herdados */
    width: auto !important;
    font-size: 1.1rem !important; /* Emoji un pouco máis grande */
    line-height: 1;
    margin: 0 0 0 4px !important;
}

/* 3. Botón de Acción (Reabrir/Pechar) */
/* Forzamos a cor do texto a branco para que se vexa ben sobre o fondo azul */
.blocktable td.tcr form input[type="submit"] {
    color: var(--white) !important; /* Texto branco */
    background-color: var(--usc-blue); /* Fondo azul corporativo */
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    font-weight: 600;
    border: 1px solid transparent;
}

/* Efecto Hover para o botón de acción */
.blocktable td.tcr form input[type="submit"]:hover {
    background-color: var(--white);
    color: var(--usc-blue) !important;
    border-color: var(--usc-blue);
}
