:root {
    --bg-color: #faf9f6; /* Blanc trencat editorial / Ivori */
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --accent-color: #c0262d; /* Vermell del logo */
    
    --font-title: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Evitar selecció de text i imatges (Anti-còpia bàsic web) */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- 1. PANTALLA PC (QR) --- */
#pc-block {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10000;
}

.pc-content {
    max-width: 500px;
    padding: 40px;
}

.brand-logo {
    width: 70px;
    height: auto;
    margin-bottom: 25px;
    border-radius: 5px;
}

.pc-content h1 {
    font-family: var(--font-title);
    font-size: 2.8rem;
    font-weight: 400;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.pc-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-weight: 300;
}

.qr-container {
    margin: 20px auto;
    padding: 15px;
    background: white;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 15px 35px rgba(0,0,0,0.03);
    border-radius: 12px;
}

.small-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 15px;
    color: #888;
}

/* --- 2. PANTALLA LOGIN --- */
#login-screen {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
    text-align: center;
}
.login-box {
    max-width: 400px; width: 100%;
    padding: 20px;
}
.login-box img { width: 60px; margin-bottom: 25px; border-radius: 4px; }
.login-box h2 { font-family: var(--font-title); font-size: 2rem; margin-bottom: 15px; font-weight: 400; font-style: italic; }
.login-box p { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 30px; line-height: 1.5; }

.login-input {
    width: 100%; padding: 15px;
    font-family: var(--font-body); font-size: 1.1rem;
    border: 1px solid rgba(0,0,0,0.1); border-radius: 4px;
    text-align: center; text-transform: uppercase;
    letter-spacing: 2px; margin-bottom: 20px;
    outline: none; transition: 0.3s;
    background: white;
}
.login-input:focus { border-color: var(--accent-color); }

.login-btn {
    width: 100%; padding: 16px;
    background-color: var(--text-primary); color: white; border: none;
    font-family: var(--font-body); font-size: 1rem; letter-spacing: 1px;
    border-radius: 40px; cursor: pointer; transition: 0.3s;
    font-weight: 500;
}
.login-btn:hover { background-color: var(--accent-color); }
#login-error { color: var(--accent-color); font-size: 0.85rem; margin-top: 15px; display: none; }

/* --- 3. MOBILE APP --- */
.app-header {
    text-align: center;
    padding: 30px 20px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    /* Efecte vidre per la capçalera si hi fem scroll per sota */
    background: rgba(250, 249, 246, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.nav-logo {
    width: 40px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.app-header h2 {
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    font-style: italic;
}

/* Masonry Grid (CSS Columns) */
.gallery-container {
    padding: 15px;
    padding-bottom: 100px; /* Espai inferior perquè la píndola no tapi imatges */
}

.masonry-grid {
    column-count: 2;
    column-gap: 15px;
}

.masonry-grid img {
    width: 100%;
    margin-bottom: 15px;
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
    display: block; /* Evita espais blancs sota les imatges inline */
}

/* Interacció Selecció */
.masonry-grid img.selected {
    border: 4px solid #34C759; /* Verd */
    padding: 2px;
    transform: scale(0.98);
}

/* Píndola flotant inferior */
.floating-pill {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 12px 25px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.04);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
}

/* --- 3. Capa Blanca Anti-Captura --- */
#anti-screenshot-layer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: white;
    z-index: 99999;
    display: none;
}

/* --- 4. Visor de fotos gran (Lightbox) --- */
#lightbox {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: rgba(20, 20, 20, 0.98);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#lightbox-close {
    position: absolute;
    top: 25px; right: 25px;
    color: white; font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    font-weight: 300;
}

#lightbox-img {
    max-width: 100%; max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transition: opacity 0.3s;
}

.lightbox-controls {
    margin-top: 30px;
    width: 100%; text-align: center;
}

#lightbox-select-btn {
    padding: 16px 35px;
    font-size: 1.1rem; border-radius: 40px;
    border: none; color: white; background-color: #333;
    font-family: var(--font-body); font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Fletxes de navegació */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 15px;
    user-select: none;
    opacity: 0.7;
    transition: 0.3s;
    z-index: 100001;
}
.nav-arrow:hover { opacity: 1; }
#lightbox-prev { left: 10px; }
#lightbox-next { right: 10px; }

/* Comentari discret */
.comment-wrapper {
    margin-top: 20px;
    text-align: center;
}
#lightbox-comment {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 5px;
    width: 85%;
    max-width: 350px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    text-align: center;
    outline: none;
    transition: 0.3s;
}
#lightbox-comment::placeholder {
    color: rgba(255,255,255,0.4);
    font-style: italic;
}
#lightbox-comment:focus {
    border-bottom-color: #34C759;
}
