:root {
    --bg-color: #0f172a;
    --primary-color: #d65b2d;
    /* Taronja IES Mollerussa */
    --secondary-color: #8ec63f;
    /* Verd Logo */
    --text-color: #f8fafc;
    --panel-bg: rgba(30, 41, 59, 0.7);
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow: hidden;
}

#tv-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
}

/* Fons Abstracte Animat */
.bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.shape {
    position: absolute;
    filter: blur(140px);
    opacity: 0.5;
    border-radius: 50%;
    animation: float 25s infinite ease-in-out alternate;
}

.shape1 {
    background: var(--primary-color);
    width: 45vw;
    height: 45vw;
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.shape2 {
    background: var(--secondary-color);
    width: 50vw;
    height: 50vw;
    bottom: -10%;
    right: -15%;
    animation-delay: -5s;
}

.shape3 {
    background: #f59e0b;
    width: 40vw;
    height: 40vw;
    top: 30%;
    left: 30%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: scale(1) translate(0, 0);
    }

    50% {
        transform: scale(1.1) translate(10%, 10%);
    }

    100% {
        transform: scale(0.9) translate(-5%, -5%);
    }
}

/* Estils del Panell Principal de Vidre (Glassmorphism) */
.glass-panel {
    position: relative;
    z-index: 10;
    background: var(--panel-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: none;
    border-radius: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem 3rem;
    box-sizing: border-box;
    box-shadow: none;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#post-header {
    flex: 0 0 auto;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#post-title {
    font-size: 4rem;
    text-align: center;
    font-weight: 800;
    line-height: 1.15;
    text-wrap: balance;
    color: white;
    margin: 0;
    transition: opacity 0.8s ease;
}

/* Àrea d'imatges — Galeria Gran */
#content-area {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 0;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    background: transparent;
}

.img-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease-in-out, transform 10s linear;
    transform: scale(1.03);
    padding: 0;
    box-sizing: border-box;
}

.img-wrapper.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* ========================================
   GALERIA — Màxim 2 imatges per diapositiva
   ======================================== */

.gallery {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 1 imatge sola — ocupa el màxim espai possible */
.gallery.count-1 {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.gallery.count-1 img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.5rem;
    display: block;
}

/* 2 imatges costat a costat — ideal per fotos verticals/mòbil */
.gallery.count-2 {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem;
}

.gallery.count-2 img {
    max-width: calc(50% - 0.75rem);
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.5rem;
    display: block;
    flex-shrink: 0;
}

#no-images-msg {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    font-weight: 700;
    display: none;
}

/* Barra de Progrés */
#footer-bar {
    flex: 0 0 auto;
    margin-top: 1.5rem;
    width: 100%;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.6);
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    z-index: 20;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}