@import url('https://fonts.googleapis.com/css2?family=Fjalla+One&family=Josefin+Sans:wght@300;400;500;600&display=swap');

/* RESET BÁSICO */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Josefin Sans', sans-serif;
}

/* ========== VARIABLES DE COLORES ========== */
:root {
    /* Paleta principal */
    --azul-cielo: #A3D2CA;
    --verde-menta: #B5EAEA;
    --amarillo-palido: #FFF3B0;
    --coral-suave: #FFAAA7;
    /* SOLO errores, rechazos */
    --azul-lila: #7B68EE;
    --azul-lila-hover: #6A5ADB;
    --gris-claro: #E8E8E8;

    /* Textos - Mejorado contraste */
    --texto-oscuro: #1a1a1a;
    --texto-medio: #2d2d2d;
    --texto-claro: #4a4a4a;

    /* Fondos para mejor legibilidad */
    --fondo-blanco: #ffffff;
    --fondo-claro: #fafafa;

    /* Toasts */
    --toast-exito: linear-gradient(135deg, #B5EAEA 0%, #A3D2CA 100%);
    --toast-error: linear-gradient(135deg, #FFAAA7 0%, #FF9593 100%);
    --toast-info: linear-gradient(135deg, #7B68EE 0%, #6A5ADB 100%);
    --toast-warning: linear-gradient(135deg, #FFF3B0 0%, #FFE259 100%);
}

/* ========== TIPOGRAFÍA GLOBAL ========== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Fjalla One', sans-serif;
    color: var(--texto-oscuro);
}

p,
li,
span,
a,
button,
input,
textarea,
label {
    font-family: 'Josefin Sans', sans-serif;
}

/* ========== ESTILOS LOGIN.PHP ========== */
body.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #A3D2CA 0%, #B5EAEA 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

body.login-page main {
    background-color: #ffffff;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(163, 210, 202, 0.3);
}

body.login-page h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--texto-oscuro);
    font-size: 2rem;
    font-weight: 400;
}

body.login-page form {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
}

body.login-page label {
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
    color: var(--texto-medio);
    font-weight: 600;
}

body.login-page input {
    margin-top: 0.5rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 2px solid #607b94;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: var(--fondo-blanco);
    color: var(--texto-oscuro);
}

body.login-page input:focus {
    outline: none;
    border-color: #7B68EE;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.15);
}

body.login-page button {
    margin-top: 1.5rem;
    padding: 0.9rem;
    background: linear-gradient(135deg, #B79AFF, #AA88FF);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 28px 0 rgba(170, 136, 255, 0.38), 0 1.5px 4px rgba(183, 153, 255, 0.22);
    text-shadow: 0 1px 6px #B799FF;
}

body.login-page button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(170, 136, 255, 0.36);
}

body.login-page .button-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

body.login-page .registre-btn {
    background: linear-gradient(135deg, #CBB4FF, #E6C7FE);
    margin-top: 1rem;
    font-weight: 600;
    width: 50%;
    color: white;
    box-shadow: 0 4px 15px rgba(203, 180, 255, 0.25);
    font-family: 'Josefin Sans', sans-serif;
    text-shadow: 0 1px 4px #B799FF;
}

body.login-page .registre-btn:hover {
    box-shadow: 0 6px 20px rgba(170, 136, 255, 0.36);
}

body.login-page .back-btn {
    background: linear-gradient(135deg, #D6BBFB, #B8C2F6);
    margin-top: 1rem;
    font-weight: 600;
    width: 50%;
    color: white;
    box-shadow: 0 4px 15px rgba(186, 162, 255, 0.20);
    font-family: 'Josefin Sans', sans-serif;
    text-shadow: 0 1px 4px #B799FF;
}

body.login-page .back-btn:hover {
    box-shadow: 0 6px 20px rgba(186, 162, 255, 0.36);
}

/* notifi errres logn*/
.notification {
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.notification.error {
    background: linear-gradient(90deg, #FFE8E8 16px 100%);
    color: #B41F1F;
    border-left: 8px solid #FFAAA7;
    border-top: 1px solid #FFAEB0;
    border-bottom: 1px solid #FFAEB0;
    border-right: 1px solid #FFD3D2;
    box-shadow: 0 4px 16px 0 rgba(255, 170, 167, 0.3);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
    font-family: 'Josefin Sans', sans-serif;
}

.notification.warning {
    background: linear-gradient(90deg, #FFFDE7 16px 100%);
    color: #857000;
    border-left: 8px solid #FFF3B0;
    border-top: 1px solid #FFE082;
    border-bottom: 1px solid #FFE082;
    border-right: 1px solid #FFF9D6;
    box-shadow: 0 4px 14px 0 rgba(255, 243, 176, 0.3);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
    font-family: 'Josefin Sans', sans-serif;
}

/* ========== CONFIRMATION PAGE ========== */
body.confirmation-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #A3D2CA 0%, #B5EAEA 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.confirmation-box {
    background-color: #ffffff;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(163, 210, 202, 0.3);
    text-align: center;
}

.confirmation-box h1 {
    color: var(--texto-oscuro);
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.confirmation-box p {
    color: var(--texto-medio);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.confirmation-box button {
    background: linear-gradient(135deg, #7B68EE, #6A5ADB);
    border: none;
    padding: 0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(123, 104, 238, 0.25);
}

.confirmation-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 104, 238, 0.35);
}

.confirmation-box button a {
    display: block;
    padding: 0.9rem 2.5rem;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

/* ========== LOGIN ADMIN ========== */
body.login-page-admin {
    min-height: 100vh;
    /* Paleta admin: azul oscuro y dorado */
    background: linear-gradient(135deg, #212A3E 0%, #394867 70%, #FFD966 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

body.login-page-admin main {
    background-color: #F5F7FA;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(57, 72, 103, 0.18), 0 2px 8px rgba(33, 42, 62, 0.08);
}

body.login-page-admin h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #212A3E;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

body.login-page-admin form {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
}

body.login-page-admin label {
    display: flex;
    flex-direction: column;
    font-size: 1rem;
    color: #394867;
    font-weight: 600;
    letter-spacing: 0.1px;
}

body.login-page-admin input {
    margin-top: 0.5rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 2px solid #FFD966;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #212A3E;
    font-family: 'Josefin Sans', sans-serif;
}

body.login-page-admin input:focus {
    outline: none;
    border-color: #FFB200;
    background-color: #FFFBEA;
    box-shadow: 0 0 0 3px rgba(255, 217, 102, 0.16);
}

body.login-page-admin button {
    margin-top: 1.5rem;
    padding: 0.9rem;
    background: linear-gradient(135deg, #FFD966 40%, #FFB200 100%);
    color: #212A3E;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 28px 0 rgba(255, 188, 51, 0.15), 0 1.5px 4px rgba(33, 42, 62, 0.09);
    text-shadow: 0 1px 6px #FFF7CC;
    letter-spacing: 0.1px;
    font-family: 'Josefin Sans', sans-serif;
}

body.login-page-admin button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px 0 rgba(255, 178, 0, 0.18), 0 2px 8px rgba(33, 42, 62, 0.12);
    background: linear-gradient(135deg, #FFDF77 40%, #FFD966 100%);
    color: #1a2233;
}

body.login-page-admin .button-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* Botones estilo login */
body.login-page-admin .button-link {
    display: block;
    text-align: center;
    padding: 0.9rem;
    background: linear-gradient(135deg, #FFD966 40%, #FFB200 100%);
    color: #212A3E;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 6px 28px 0 rgba(255, 188, 51, 0.15), 0 1.5px 4px rgba(33, 42, 62, 0.09);
    transition: all 0.3s ease;
    font-family: 'Josefin Sans', sans-serif;
}

body.login-page-admin .button-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px 0 rgba(255, 178, 0, 0.18), 0 2px 8px rgba(33, 42, 62, 0.12);
    background: linear-gradient(135deg, #FFDF77 40%, #FFD966 100%);
    color: #1a2233;
}

/* -------- DASHBOARD ADMIN PROJECTS -------- */
body.login-page-admin header {
    position: fixed;
    /* fijo arriba */
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 30px;
    background: linear-gradient(135deg, #212A3E 0%, #394867 100%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

body.login-page-admin header .header-left,
body.login-page-admin header .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

body.login-page-admin header .nav-link {
    text-decoration: none;
    font-weight: 600;
    color: #FFD966;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

body.login-page-admin header .nav-link:hover {
    background-color: rgba(255, 217, 102, 0.2);
    text-decoration: none;
}

body.login-page-admin header .btn-logout {
    text-decoration: none;
    font-weight: 600;
    background-color: #FF6B6B;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

body.login-page-admin header .btn-logout:hover {
    background-color: #FF3B3B;
}

body.login-page-admin main {
    max-width: 1000px;
    padding: 2rem;
    margin-top: 80px;
}

body.login-page-admin #user-projects {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

body.login-page-admin .project-card {
    background-color: #F5F7FA;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(57, 72, 103, 0.18), 0 2px 8px rgba(33, 42, 62, 0.08);
    padding: 15px;
    width: 250px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.login-page-admin .project-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #212A3E;
    font-weight: 700;
}

body.login-page-admin .project-image {
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
}

body.login-page-admin .project-buttons {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: auto;
    gap: 5px;
}

body.login-page-admin .project-buttons .btn {
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: #212A3E;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

body.login-page-admin .btn-preview {
    background: linear-gradient(135deg, #FFD966 40%, #FFB200 100%);
    box-shadow: 0 4px 15px rgba(255, 217, 102, 0.4);
}

body.login-page-admin .btn-preview:hover {
    box-shadow: 0 6px 20px rgba(255, 178, 0, 0.6);
}

body.login-page-admin .btn-delete {
    background: linear-gradient(135deg, #FF6B6B 40%, #FF3B3B 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

body.login-page-admin .btn-delete:hover {
    box-shadow: 0 6px 20px rgba(255, 59, 59, 0.6);
}

body.login-page-admin .btn-restore {
    background: linear-gradient(135deg, #6BCB77 40%, #4CAF50 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(107, 203, 119, 0.4);
}

body.login-page-admin .btn-restore:hover {
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

body.login-page-admin video {
    width: 100%;
    border-radius: 8px;
    display: none;
    margin-top: 5px;
    margin-bottom: 10px;
}




/* =========== ESTILOS DISCOVER ============ */

/* Ocultar "Descobrir" en la navegación de discover.php */
.discover-page header .nav-links li:nth-child(1) a {
    display: none;
}

.discover-page {
    background: linear-gradient(135deg, #A3D2CA 0%, #B5EAEA 100%);
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    width: 100%;
}

.discover-page header {
    position: fixed;
    /* fijo arriba */
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 30px;
    background: linear-gradient(135deg, #A3D2CA 0%, #B5EAEA 100%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.discover-page header .nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.discover-page header .nav-links a {
    color: var(--texto-oscuro);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 8px 14px;
    border-radius: 8px;
}

.discover-page header .nav-links a:hover {
    color: #7B68EE;
    background: rgba(255, 255, 255, 0.5);
    text-decoration: underline;
}

.discover-page header .session-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--texto-oscuro);
}

.discover-page header .session-info a {
    color: var(--texto-oscuro);
    text-decoration: none;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.discover-page header .session-info a:hover {
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ADB 100%);
    color: #fff;
    border-color: #7B68EE;
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.28);
    transform: translateY(-2px) scale(1.04);
}

.discover-page main {
    height: 100vh;
    width: 100%;
    margin-top: 0;
    padding: 0;
    padding-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.discover-page .project-card {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}


.discover-page .project-card header {
    position: absolute;
    top: 70px;
    left: 20px;
    right: 20px;
    z-index: 10;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(163, 210, 202, 0.3);
}

.discover-page .project-card header h2 {
    color: var(--texto-oscuro);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 8px;
}

.discover-page .project-card header p {
    color: var(--texto-medio);
    font-size: 1rem;
    font-weight: 500;
}

.discover-page .project-card .video-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #E8E8E8;
}

.discover-page .project-card .video-section video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discover-page .project-card .actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: transparent;
    padding: 30px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.discover-page .project-card .buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.discover-page .project-card .buttons button {
    width: 98px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.discover-page .project-card .nope-btn {
    background: linear-gradient(135deg, #D32F2F, #B71C1C);
    color: #fff;
    width: 90px;
}

.discover-page .project-card .nope-btn:hover {
    background: linear-gradient(135deg, #B71C1C, #C62828);
    transform: scale(1.15) rotate(-10deg);
    box-shadow: 0 6px 25px rgba(211, 47, 47, 0.6);
}

.discover-page .project-card .like-btn {
    background: linear-gradient(135deg, #7B68EE, #6A5ADB);
    color: white;
    width: 90px;
}

.discover-page .project-card .like-btn:hover {
    background: linear-gradient(135deg, #6A5ADB, #5A4AC8);
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 6px 25px rgba(123, 104, 238, 0.6);
}

.discover-page .project-card .next-btn {
    background: linear-gradient(135deg, #A3D2CA, #8BC4BC);
    color: white;
    width: auto;
    height: auto;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
}

.discover-page .project-card .next-btn:hover {
    background: linear-gradient(135deg, #8BC4BC, #7AB4AC);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(163, 210, 202, 0.6);
}

.discover-page .project-card .next-btn::before {
    content: '';
}

.discover-page .project-card .bottom-bar {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 14px 18px;
    border-top: 1px solid #ececec;
    background: #fff;
    border-radius: 14px;
    margin-top: auto;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
    gap: 14px;
}

.discover-page .project-card .bottom-bar a,
.discover-page .project-card .bottom-bar button {
    background: #f7f7fa;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #5a5a85;
    font-size: 0.98rem;
    transition: background 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 9px 20px;
    text-decoration: none;
    border-radius: 7px;
    box-shadow: 0 1px 2px 0 rgba(160, 160, 160, 0.07);
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 0.45em;
}

.discover-page .project-card .bottom-bar a:hover,
.discover-page .project-card .bottom-bar button:hover {
    background: #ece7fb;
    color: #7B68EE;
    box-shadow: 0 2px 8px rgba(123, 104, 238, 0.1);
    transform: translateY(-2px) scale(1.03);
}



.discover-page .project-card .details {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
    padding: 25px 20px 35px 20px;
    border-radius: 20px 20px 0 0;
    max-height: 60vh;
    overflow-y: auto;
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    border-top: 3px solid rgba(123, 104, 238, 0.3);
}

.discover-page .project-card .details.hidden {
    transform: translateY(calc(100% + 50px));
}

.discover-page .project-card .details h3 {
    color: var(--texto-oscuro);
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 400;
}

.discover-page .project-card .details .description {
    color: var(--texto-medio);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: left;
}

.discover-page .project-card .details .tags {
    background-color: #FFF3B0;
    padding: 10px 15px;
    border-radius: 10px;
    color: var(--texto-oscuro);
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 600;
}

.discover-page .project-card .details .tags .tag {
    background-color: #FFF3B0;
    display: inline-block;
    color: var(--texto-oscuro);
    padding: 5px 10px;
    border-radius: 8px;
    margin: 5px 8px 5px 0;
    font-size: 0.85rem;
}

.discover-page .close-details {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--texto-oscuro);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.discover-page .close-details:hover {
    color: #7B68EE;
    transform: rotate(90deg);
}

.discover-page .project-card.swipe-right {
    transform: translateX(120vw) rotate(25deg) scale(0.7);
    opacity: 0;
}

.discover-page .project-card.swipe-left {
    transform: translateX(-120vw) rotate(-25deg) scale(0.7);
    opacity: 0;
}


.discover-page .project-card .details::-webkit-scrollbar {
    width: 6px;
}

.discover-page .project-card .details::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.discover-page .project-card .details::-webkit-scrollbar-thumb {
    background: #7B68EE;
    border-radius: 10px;
}

.discover-page .project-card .details::-webkit-scrollbar-thumb:hover {
    background: #6A5ADB;
}

/* match */
.match-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ADB 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.4);
    animation: pulse 2s infinite;
}

/* Indicador de "Ja t'ha agradat" */
.liked-indicator {
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, #FFF3B0 0%, #FFE259 100%);
    color: #5a4c0f;
    border-radius: 10px;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(255, 243, 176, 0.4);
}

/* ================= MENSAJES DINÁMICOS ============= */
.empty-message,
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #A3D2CA 0%, #B5EAEA 100%);
    border-radius: 20px;
    margin: 20px;
}

.error-message h2 {
    margin-bottom: 10px;
}

.empty-icon,
.error-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.empty-message h2,
.error-message h2 {
    font-size: 1.8rem;
    color: var(--texto-oscuro);
    margin-bottom: 10px;
}

.empty-message p,
.error-message p {
    font-size: 1rem;
    color: var(--texto-medio);
    margin-bottom: 20px;
    max-width: 400px;
}

.error-message code {
    background: #E8E8E8;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}



/* Botones */
.buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.like-btn,
.nope-btn,
.next-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 25px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.like-btn {
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ADB 100%);
    color: white;
}

.like-btn:hover {
    background: linear-gradient(135deg, #6A5ADB 0%, #5A4AC8 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(123, 104, 238, 0.6);
}

.nope-btn {
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    color: white;
}

.nope-btn:hover {
    background: linear-gradient(135deg, #B71C1C 0%, #C62828 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.6);
}

.next-btn {
    background: linear-gradient(135deg, #A3D2CA 0%, #8BC4BC 100%);
    color: white;
}

.next-btn:hover {
    background: linear-gradient(135deg, #8BC4BC 0%, #7AB4AC 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(163, 210, 202, 0.6);
}

.btn-text {
    font-size: 0.85rem;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* Animaciones de swipe */
.swipe-right {
    animation: swipeRight 0.6s ease-out forwards;
}

.swipe-left {
    animation: swipeLeft 0.6s ease-out forwards;
}

/* Botón de reinicio */
.restart-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ADB 100%);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(123, 104, 238, 0.4);
}

.restart-btn:hover {
    background: linear-gradient(135deg, #6A5ADB 0%, #5A4AC8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 104, 238, 0.6);
}

.restart-btn:active {
    transform: translateY(0);
}

/* botones toast */
.toast .btn-cerrar {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-width: 48px;
    position: relative;
    overflow: hidden;
}

.toast .btn-cerrar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.05);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.toast .btn-cerrar:hover::before {
    opacity: 1;
}

.toast .btn-cerrar:active {
    transform: scale(0.95);
}

.toast .btn-cerrar .icono {
    width: 20px;
    height: 20px;
    color: rgba(0, 0, 0, 0.5);
    background: transparent;
}

.toast .btn-cerrar:hover .icono {
    color: rgba(0, 0, 0, 0.7);
    transform: rotate(90deg) scale(1.1);
}

.toast .btn-cerrar .icono svg {
    width: 100%;
    height: 100%;
}


/* ========== ESTILOS TOASTS ========== */
.contenedor-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: calc(100% - 40px);
    max-width: 400px;
    max-height: calc(100vh - 40px);
    display: flex;
    gap: 12px;
    flex-direction: column-reverse;
    z-index: 9999;
    pointer-events: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px;
}

/* Scrollbar personalizado para el contenedor de toasts */
.contenedor-toast::-webkit-scrollbar {
    width: 6px;
}

.contenedor-toast::-webkit-scrollbar-track {
    background: transparent;
}

.contenedor-toast::-webkit-scrollbar-thumb {
    background: rgba(123, 104, 238, 0.6);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.contenedor-toast::-webkit-scrollbar-thumb:hover {
    background: rgba(123, 104, 238, 0.9);
}

/* ========================================
   TOAST BASE
   ======================================== */
.toast {
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: all;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    min-height: 80px;
}

/* Barra lateral izquierda de color */
.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    transition: width 0.3s ease;
}

.toast:hover::before {
    width: 7px;
}

/* Colores por tipo */
.toast.exito {
    background: linear-gradient(135deg, rgba(181, 234, 234, 0.15) 0%, rgba(163, 210, 202, 0.1) 100%);
}

.toast.exito::before {
    background: linear-gradient(180deg, #8BC4BC 0%, #6BAFA5 100%);
}

.toast.error {
    background: linear-gradient(135deg, rgba(255, 170, 167, 0.15) 0%, rgba(255, 149, 147, 0.1) 100%);
}

.toast.error::before {
    background: linear-gradient(180deg, #FF7B78 0%, #FF5B58 100%);
}

.toast.info {
    background: linear-gradient(135deg, rgba(123, 104, 238, 0.15) 0%, rgba(106, 90, 219, 0.1) 100%);
}

.toast.info::before {
    background: linear-gradient(180deg, #7B68EE 0%, #6A5ADB 100%);
}

.toast.warning {
    background: linear-gradient(135deg, rgba(255, 243, 176, 0.15) 0%, rgba(255, 226, 89, 0.1) 100%);
}

.toast.warning::before {
    background: linear-gradient(180deg, #FFD600 0%, #FFC700 100%);
}

/* ======= CONTENIDO DEL TOAST ========*/
.toast .contenido {
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: center;
    gap: 12px;
    padding: 16px 12px 16px 16px;
    flex: 1;
}

.toast .icono {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.toast:hover .icono {
    transform: scale(1.1);
}

.toast .icono svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Iconos por tipo */
.toast.exito .icono {
    background: linear-gradient(135deg, #B5EAEA 0%, #A3D2CA 100%);
    color: #1a4a3f;
}

.toast.error .icono {
    background: linear-gradient(135deg, #FFAAA7 0%, #FF9593 100%);
    color: #8b1f1f;
}

.toast.info .icono {
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ADB 100%);
    color: white;
}

.toast.warning .icono {
    background: linear-gradient(135deg, #FFF3B0 0%, #FFE259 100%);
    color: #6a5c0f;
}

/* Texto */
.toast .texto {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.toast .titulo {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.toast.exito .titulo {
    color: #1a4a3f;
}

.toast.error .titulo {
    color: #8b1f1f;
}

.toast.info .titulo {
    color: #4A3A9E;
}

.toast.warning .titulo {
    color: #6a5c0f;
}

.toast .descripcion {
    font-size: 0.875rem;
    font-weight: 400;
    margin: 0;
    line-height: 1.5;
    opacity: 0.9;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.toast.exito .descripcion {
    color: #2d5a50;
}

.toast.error .descripcion {
    color: #8b1f1f;
}

.toast.info .descripcion {
    color: #5A4AC8;
}

.toast.warning .descripcion {
    color: #6a5c0f;
}

/* ======== ESTILOS PROFILE ======== */
.profile-page {
    background: linear-gradient(135deg, #A3D2CA 0%, #B5EAEA 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* -------- HEADER -------- */
.profile-page .profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: linear-gradient(135deg, #A3D2CA, #B5EAEA);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 12px 12px;
    margin-bottom: 20px;
}

.profile-page .profile-header h1 {
    flex: 1;
    text-align: center;
    font-size: 1.8rem;
    color: var(--texto-oscuro);
    margin: 0;
}

.profile-page .profile-header .session-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--texto-oscuro);
}

.profile-page .profile-header .session-info a {
    color: var(--texto-oscuro);
    text-decoration: none;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.profile-page .profile-header .session-info a:hover {
    color: white;
    background: linear-gradient(135deg, #7B68EE, #6A5ADB);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.4);
}

/* -------- USER INFO -------- */
.profile-page .user-info {
    color: var(--texto-medio);
    font-size: 1rem;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 500;
}

/* -------- TAGS -------- */
.profile-page .tags-list,
.tag-item {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #FFF3B0, #FFE5B4);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #FFD580;
    margin-left: 6px;
    margin-right: 6px;
    margin-top: 5px;
    margin-bottom: 5px;

}

.tag-item span {
    font-weight: 600;
    color: var(--texto-oscuro);
    font-size: 0.9rem;
}

.remove-tag-btn {
    background: none;
    border: none;
    color: #D32F2F;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.remove-tag-btn:hover {
    color: #B71C1C;
}

.add-tag-container {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.tag-search-wrapper {
    flex: 1;
    position: relative;
}

.tag-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--texto-oscuro);
    background-color: var(--fondo-blanco);
    transition: all 0.3s ease;
}

.tag-search-input:focus {
    outline: none;
    border-color: #7B68EE;
    box-shadow: 0 0 10px rgba(123, 104, 238, 0.3);
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #E0E0E0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #F0F0F0;
    font-size: 0.9rem;
    color: var(--texto-oscuro);
    background-color: var(--fondo-blanco);
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: rgba(123, 104, 238, 0.1);
    color: #7B68EE;
}

.suggestion-item:last-child {
    border-bottom: none;
}


/* -------- PROJECTS -------- */
.profile-page #user-projects {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Centrar las tarjetas */
    gap: 20px; /* Espacio entre tarjetas */
    margin-top: 20px;
}

.profile-page .project-card {
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 15px;
    width: 250px; /* ancho de cada tarjeta */
    text-align: center; /* centrar contenido */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-page .project-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.profile-page .project-image {
    width: 100%;
    height: auto;
    max-height: 180px; /* limitar altura */
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.profile-page .project-buttons {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: auto;
}

.profile-page .project-buttons .btn {
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    color: black;
}

.profile-page .btn-preview {
    background: linear-gradient(135deg, #b7a7ff, #baa7ff);
    box-shadow: 0 4px 15px rgba(205, 167, 255, 0.4);
}
.profile-page .btn-preview:hover {
    box-shadow: 0 6px 20px rgba(205, 167, 255, 0.6);
}

.profile-page .btn-edit {
    background: linear-gradient(135deg, #FFAAA7, #FF9593);
    box-shadow: 0 4px 15px rgba(255, 170, 167, 0.4);
}
.profile-page .btn-edit:hover {
    box-shadow: 0 6px 20px rgba(255, 170, 167, 0.6);
}

.profile-page .user-projects h2 {
    text-align: center;
    color: var(--texto-oscuro);
    margin-bottom: 15px;
    font-family: 'Fjalla One', sans-serif;
}

.profile-page .user-projects a.btn.btn-primary {
    display: block;              /* 🔑 clave */
    width: fit-content;          /* para que no ocupe todo el ancho */
    margin: 0 auto 15px auto;    /* centrado horizontal */
    
    text-decoration: none;
    color: #333;
    background-color: #E8E8E8;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.3s;
    text-align: center;
    font-weight: 600;
}
.profile-page .user-projects a.btn.btn-primary:hover {
    background: linear-gradient(135deg, #b7a7ff, #baa7ff);
    color: #FFF;
    box-shadow: 0 4px 15px rgba(205, 167, 255, 0.6);
}




/* -------- NAV -------- */
.profile-nav {
    margin-top: 15px;
    display: flex;
    gap: 25px;
}

.profile-nav a {
    color: var(--texto-oscuro);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 6px;
}

.profile-nav a:hover {
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ADB 100%);
    color: #fff;
    border-color: #7B68EE;
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.28);
    transform: translateY(-2px) scale(1.04);
}

/* -------- FORMULARIOS -------- */
.profile-form {
    max-width: 600px;
    margin: 0 auto 30px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.profile-form h3 {
    color: var(--texto-oscuro);
    font-size: 1.3rem;
    margin: 0 0 15px;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: var(--texto-medio);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    padding: 12px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--texto-oscuro);
    background-color: var(--fondo-blanco);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #7B68EE;
    box-shadow: 0 0 10px rgba(123, 104, 238, 0.3);
}

input[readonly],
input[disabled] {
    background: #F5F5F5;
    color: #999;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.form-actions .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #7B68EE, #6A5ADB);
    color: #fff;
    box-shadow: 0 4px 15px rgba(123, 104, 238, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #6A5ADB, #5A4AC8);
    box-shadow: 0 6px 20px rgba(123, 104, 238, 0.6);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #E8E8E8;
    color: var(--texto-oscuro);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background-color: #D0D0D0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Botón Añadir Tag (acción secundaria) */
#add-tag-btn {
    margin-left: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #FFF3B0 0%, #FFD966 100%);
    /* Amarillo suave: secundario/informativo */
    color: #856700;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 215, 102, 0.25);
    transition: all 0.3s;
}

#add-tag-btn:hover {
    background: linear-gradient(135deg, #FFD966 0%, #FFF3B0 100%);
    color: #564400;
    box-shadow: 0 6px 20px rgba(255, 183, 0, 0.18);
    transform: translateY(-2px);
}


.register-login-actions {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Botón Register (principal) */
body.register-page .register-form button[type="submit"] {
    flex: 1 0 0;
    min-width: 140px;
    padding: 0.9rem 0;
    background: linear-gradient(135deg, #B5EAEA 0%, #69D2E7 100%);
    color: #23414e;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(163, 210, 202, 0.22);
}

body.register-page .register-form button[type="submit"]:hover {
    background: linear-gradient(135deg, #69D2E7 0%, #7B68EE 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(91, 175, 183, 0.24);
    transform: translateY(-2px);
}

/* Botón Login (secundario, al lado del de registro) */
.login_regist {
    flex: 1 0 0;
    min-width: 140px;
    display: inline-block;
    padding: 0.9rem 0;
    background: linear-gradient(135deg, #E8E8E8 0%, #FFD966 100%);
    color: #684c02;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(255, 217, 102, 0.11);
    text-decoration: none;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s, transform 0.2s;
    cursor: pointer;
    text-align: center;
}

.login_regist:hover,
.login_regist:focus {
    background: linear-gradient(135deg, #FFD966 0%, #7B68EE 100%);
    color: #fff;
    box-shadow: 0 6px 24px rgba(91, 175, 183, 0.18);
    text-decoration: none;
    transform: translateY(-2px) scale(1.035);
    outline: none;
}



/* ========== PÁGINAS ERROR ========== */
body.page-error {
    background: linear-gradient(135deg, #A3D2CA 0%, #B5EAEA 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.page-error .contenedor {
    background-color: #FFF2F2;
    box-shadow: 0 6px 32px 0 rgba(0, 0, 0, 0.10), 0 1.5px 5px 0 rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 95%;
    max-width: 420px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    font-family: 'Josefin Sans', sans-serif;
}

body.page-error h1 {
    font-size: 50px;
    font-family: 'Fjalla One', sans-serif;
    margin-top: 0;
    margin-bottom: 1.2em;
    text-align: center;
    color: #8b3432;
}

body.page-error p {
    text-align: center;
    font-size: 20px;
    margin: 1.5em 0 1em 0;
    color: #3d6a60;
    padding-top: 0;
}

body.page-error p.spacer {
    margin: 2em 0;
    height: 1.2em;
    background: transparent;
    border: none;
}

body.page-error a.button {
    display: inline-block;
    padding: 0.7em 2em;
    background: linear-gradient(135deg, #FFAAA7, #FFAAA7);
    color: #fff;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(181, 234, 234, 0.2);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
    margin-top: 2rem;
}

body.page-error a.button:hover {
    box-shadow: 0 8px 25px rgba(255, 170, 167, 0.6);
    transform: translateY(-2px) scale(1.03);
    background: linear-gradient(135deg, #FFAAA7 70%, #FFC3BD 100%);
}

body.page-error h2 {
    text-align: center;
    font-size: 2rem;
    font-family: 'Fjalla One', sans-serif;
    color: #8b3432;
    margin-top: 2em;
    margin-bottom: 0.5em;
    letter-spacing: 0.02em;
}

body.page-error address {
    text-align: center;
    font-style: normal;
    color: #555;
    margin-top: 2em;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    font-family: 'Josefin Sans', sans-serif;
}

body.page-error address a {
    color: #8b3432;
    text-decoration: none;
    font-weight: 700;
}

body.page-error address a:hover {
    text-decoration: underline;
}

body.page-error address span {
    color: #9e9e9e;
    font-size: 0.94em;
}

/* ====== Register ========= */

/* Nota: variables solo para register (sin tocar :root global de toasts) */
body.register-page {
    --r-sky: #A3D2CA;
    /* Azul cielo suave */
    --r-mint: #B5EAEA;
    /* Verde menta */
    --r-pale: #FFF3B0;
    /* Amarillo pálido */
    --r-coral: #FFAAA7;
    /* Coral suave */
    --r-gray: #E8E8E8;
    /* Gris claro */
    --r-ink: #333333;
    --r-muted: #555555;

    min-height: 100vh;
    background: linear-gradient(135deg, var(--r-sky) 0%, var(--r-mint) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    overflow-y: auto;
    /* por si el contenido supera el viewport */
}

/* Tarjeta centrada (equivalente a login main) */
body.register-page .register-shell {
    background-color: #ffffff;
    width: 100%;
    max-width: 720px;
    /* “horizontal” por ancho, sin moverlo a la derecha */
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.10);
    padding: 2.4rem 2.2rem;
}

/* El form ya no es “otra tarjeta” */
body.register-page .register-form {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    overflow: visible;
    max-height: none;
}

body.register-page .register-form h1 {
    text-align: center;
    margin-bottom: 0.3rem;
    color: var(--r-ink);
    font-size: 1.8rem;
    font-weight: 400;
    font-family: 'Fjalla One', sans-serif;
}

/* Mensajes (consistentes y “limpios”) */
body.register-page .register-form .success,
body.register-page .register-form .error,
body.register-page .register-form .info {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #ffffff;
}

body.register-page .register-form .error {
    background: #FFF2F2;
    color: #8b3432;
    border-left: 8px solid var(--r-coral);
}

body.register-page .register-form .success {
    background: #F2FFFB;
    color: #1f4b44;
    border-left: 8px solid var(--r-mint);
}

body.register-page .register-form .info {
    background: #FFFCE6;
    color: #7a6c1f;
    border-left: 8px solid var(--r-pale);
}

body.register-page .register-form .error ul {
    margin-left: 1.1rem;
}

/* Inputs (alineados al estilo login) */
body.register-page .register-form label {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: var(--r-muted);
    font-weight: 500;
}

body.register-page .register-form input,
body.register-page .register-form select {
    margin-top: 0.5rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 2px solid var(--r-gray);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

body.register-page .register-form input:focus,
body.register-page .register-form select:focus {
    outline: none;
    border-color: var(--r-sky);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(163, 210, 202, 0.15);
}

/* Filas “horizontales” (2 columnas) */
body.register-page .register-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

body.register-page .register-form .form-group {
    display: flex;
    flex-direction: column;
}

/* ======= MATCHES ======= */
.matches-page .sidebar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(163, 210, 202, 0.98) 0%, rgba(163, 210, 202, 0.85) 100%);
    padding: 18px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 15px rgba(163, 210, 202, 0.3);
    backdrop-filter: blur(10px);
}

.matches-page .sidebar .nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.matches-page .sidebar .nav-links li a {
    color: var(--texto-oscuro);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 8px;
}

.matches-page .sidebar .nav-links li a:hover {
    color: #FFAAA7;
    background: rgba(255, 255, 255, 0.3);
}

.matches-page .sidebar .session-info {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--texto-oscuro);
    font-size: 0.95rem;
    font-weight: 600;
}

.matches-page .sidebar .session-info a {
    color: var(--texto-oscuro);
    text-decoration: none;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.3) 100%);
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.matches-page .sidebar .session-info a:hover {
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ADB 100%);
    color: white;
    border-color: #6A5ADB;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.4);
}

.matches-page main {
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.matches-page h1 {
    text-align: center;
    color: var(--texto-oscuro);
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(163, 210, 202, 0.3);
}

.matches-page .subtitle {
    text-align: center;
    color: var(--texto-medio);
    font-size: 1.1rem;
    margin-bottom: 45px;
    font-weight: 500;
    opacity: 0.85;
}

/* GRID DE MATCHES */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.match-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(163, 210, 202, 0.3);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid transparent;
}

.match-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(163, 210, 202, 0.5);
    border-color: #A3D2CA;
}

.match-card .video-container {
    position: relative;
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #E8E8E8 0%, #D8D8D8 100%);
    overflow: hidden;
}

.match-card .video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.match-card .mutual-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FFF3B0 0%, #FFE259 100%);
    color: #7a6c1f;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 243, 176, 0.5);
    animation: pulse 2s infinite;
    z-index: 10;
}

.match-card .card-content {
    padding: 25px;
}

.match-card h3 {
    color: var(--texto-oscuro);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 10px;
    margin-top: 0;
    text-align: center;
}

.match-card .author {
    color: var(--texto-medio);
    font-size: 0.95rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.match-card .description {
    color: var(--texto-medio);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.match-card .tags {
    background: linear-gradient(135deg, #FFF3B0 0%, #FFE259 100%);
    padding: 12px 16px;
    border-radius: 12px;
    color: #5a4c0f;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(255, 243, 176, 0.3);
}

.match-card .actions {
    display: flex;
    gap: 12px;
}

.match-card .btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.match-card .btn-view {
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ADB 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.4);
}

.match-card .btn-view:hover {
    background: linear-gradient(135deg, #6A5ADB 0%, #5A4AC8 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(123, 104, 238, 0.6);
}

.match-card .btn-contact {
    background: linear-gradient(135deg, #A3D2CA 0%, #8BC4BC 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(163, 210, 202, 0.4);
}

.match-card .btn-contact:hover {
    background: linear-gradient(135deg, #8BC4BC 0%, #7AB4AC 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(163, 210, 202, 0.6);
}

/* MENSAJE VACÍO */
.matches-page .empty-message {
    text-align: center;
    padding: 80px 20px;
}

.matches-page .empty-icon {
    font-size: 6rem;
    margin-bottom: 25px;
    animation: bounce 2s infinite;
}

.matches-page .empty-message h2 {
    color: var(--texto-oscuro);
    font-size: 2rem;
    margin-bottom: 15px;
}

.matches-page .empty-message p {
    color: var(--texto-medio);
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.matches-page .btn-discover {
    display: inline-block;
    padding: 15px 35px;
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ADB 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(123, 104, 238, 0.4);
}

.matches-page .btn-discover:hover {
    background: linear-gradient(135deg, #6A5ADB 0%, #5A4AC8 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(123, 104, 238, 0.6);
}

/* ====== EDIT_PROJECT ======= */
.edit-project-page {
    background: linear-gradient(135deg, #A3D2CA 0%, #B5EAEA 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* -------- HEADER -------- */
.edit-project-page .edit-project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: linear-gradient(135deg, #A3D2CA, #B5EAEA);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 12px 12px;
    margin-bottom: 20px;
}

.edit-project-page .edit-project-header h1 {
    color: var(--texto-oscuro);
    font-size: 1.8rem;
}

/* -------- NAV -------- */
.edit-project-nav {
    margin-top: 15px;
    display: flex;
    gap: 25px;
}

.edit-project-nav a {
    color: var(--texto-oscuro);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 6px;
}

.edit-project-nav a:hover {
    color: #FFAAA7;
}

/* -------- SESSION INFO -------- */
.edit-project-page .edit-project-header .session-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--texto-oscuro);
}

.edit-project-page .edit-project-header .session-info a {
    color: var(--texto-oscuro);
    text-decoration: none;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.edit-project-page .edit-project-header .session-info a:hover {
    color: white;
    background: linear-gradient(135deg, #7B68EE, #6A5ADB);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.4);
}

.save-message.success {
    color: green;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
}

/* ====== NEW_PROJECT ======== */
.new-project-page {
    background: linear-gradient(135deg, #A3D2CA 0%, #B5EAEA 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* -------- HEADER -------- */
.new-project-page .new-project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: linear-gradient(135deg, #A3D2CA, #B5EAEA);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 12px 12px;
    margin-bottom: 20px;
}

.new-project-page .new-project-header h1 {
    color: var(--texto-oscuro);
    font-size: 1.8rem;
}

/* -------- NAV -------- */
.new-project-nav {
    margin-top: 15px;
    display: flex;
    gap: 25px;
}

.new-project-nav a {
    color: var(--texto-oscuro);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 6px;
}

.new-project-nav a:hover {
    color: #FFAAA7;
}

/* -------- SESSION INFO -------- */
.new-project-page .new-project-header .session-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--texto-oscuro);
}

.new-project-page .new-project-header .session-info a {
    color: var(--texto-oscuro);
    text-decoration: none;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.new-project-page .new-project-header .session-info a:hover {
    color: white;
    background: linear-gradient(135deg, #7B68EE, #6A5ADB);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.4);
}


.alert.alert-success {
    color: green;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
}

.alert.alert-error {
    color: red;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
}

.new-project-page .form-group input[type="file"] {
    padding: 6px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--texto-oscuro);
    transition: all 0.3s ease;
}

.new-project-page .form-group input[type="file"]:focus {
    border-color: #7B68EE;
    box-shadow: 0 0 10px rgba(123, 104, 238, 0.3);
}

/* ====== CONVERSES ======== */
/* CHAT */

body.page-chat {
    min-height: 100vh;
    min-height: 100svh;
    background: linear-gradient(135deg, var(--verde-menta), var(--azul-cielo));
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.chat-container {
    background: var(--fondo-blanco);
    /* Aumentado: más espacioso */
    width: 100%;
    max-width: 660px;
    /* Más ancho para evitar que se vea pequeño */
    border-radius: 26px;
    border: 2.5px solid var(--azul-cielo);
    box-shadow: 0 16px 44px rgba(123, 104, 238, 0.13), 0 4px 12px rgba(179, 234, 234, 0.16);
    display: flex;
    flex-direction: column;
    gap: 34px;
    height: 82vh;
    /* Más alto */
    max-height: 94vh;
    margin: 0 auto;
    overflow: hidden;
    justify-content: flex-start;
}

.chat-box {
    background: var(--fondo-blanco);
    width: 100%;
    max-width: 700px;
    border-radius: 26px;
    border: 2.5px solid var(--azul-cielo);
    box-shadow: 0 16px 44px rgba(123, 104, 238, .13), 0 4px 12px rgba(179, 234, 234, .16);
    display: flex;
    flex-direction: column;
    height: 78vh;
    max-height: 88vh;
    overflow: hidden;
    padding: 44px 26px 0 26px;
}

.chat-header {
    background: linear-gradient(135deg, var(--azul-lila), var(--azul-cielo));
    color: #fff;
    padding: 22px 20px 13px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2.5px solid var(--azul-cielo);
    border-radius: 18px 18px 0 0;
    position: sticky;
    top: 0;
    z-index: 9;
    box-shadow: 0 3px 16px rgba(123, 104, 238, 0.12);
    gap: 17px;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1 1 0%;
}

.chat-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2.5px solid var(--azul-cielo);
    background: var(--fondo-claro);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    background: linear-gradient(135deg, var(--azul-lila), var(--azul-cielo));
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-text h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 3px 12px rgba(123, 104, 238, 0.10);
}

.chat-header-text .chat-entity {
    margin: 0;
    font-size: 1.03rem;
    color: var(--texto-claro);
    opacity: 0.92;
}

.btn-back {
    background: var(--amarillo-palido);
    color: var(--azul-lila);
    border: 2.5px solid var(--verde-menta);
    padding: 20px 44px;
    border-radius: 32px;
    font-weight: 600;
    transition: 0.18s;
    text-decoration: none;
    cursor: pointer;
    font-size: 1.15rem;
}

.btn-back:hover {
    filter: brightness(1.07);
    color: var(--texto-oscuro);
}

/* Area que contiene los mensajes */
.messages-container {
    flex: 1 1 0%;
    overflow-y: auto;
    padding: 36px 22px 29px 22px;
    display: flex;
    flex-direction: column;
    gap: 27px;
    font-size: 1.1rem;
}

.messages-container::-webkit-scrollbar {
    width: 11px;
    background: var(--azul-cielo);
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--verde-menta);
    border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--azul-lila);
}

/* Mensajes individuales (burbujas) */
.message-bubble {
    display: flex;
    gap: 17px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble.sent {
    justify-content: flex-end;
}

.message-bubble.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 84%;
    word-break: break-word;
    padding: 22px 34px;
    border-radius: 22px;
    font-size: 1.12rem;
    line-height: 1.62;
    border: 2.1px solid var(--azul-cielo);
    transition: background 0.2s;
}

.message-bubble.sent .message-content {
    background: linear-gradient(135deg, var(--azul-lila), var(--azul-cielo));
    color: #fff;
    border-bottom-right-radius: 7px;
    border-top-right-radius: 25px;
    font-weight: 600;
    border: 2.1px solid var(--azul-cielo);
    box-shadow: 0 3px 14px rgba(179, 234, 234, 0.16);
}

.message-bubble.received .message-content {
    background: linear-gradient(90deg, var(--fondo-claro) 74%, var(--amarillo-palido) 100%);
    color: var(--texto-oscuro);
    border-bottom-left-radius: 7px;
    border-top-left-radius: 25px;
    font-weight: 500;
    border: 2.1px solid var(--amarillo-palido);
    box-shadow: 0 2px 11px rgba(181, 234, 234, 0.13);
}


/* Hora del mensaje */
.message-time {
    font-size: 0.82rem;
    color: var(--texto-claro);
    opacity: 0.77;
    align-self: flex-end;
    padding: 0 0.5rem;
}

/* Area de input para escribir mensaje */
.chat-input-area {
    background: var(--fondo-blanco);
    padding: 20px 21px;
    border-top: 2px solid var(--azul-cielo);
    border-radius: 0 0 24px 24px;
    box-shadow: 0 -2px 10px rgba(123, 104, 238, 0.03);
    z-index: 3;
}

.message-form {
    display: flex;
    gap: 0.75rem;
    max-width: 100%;
}

.message-input {
    flex: 1 1 0%;
    border: 2px solid var(--azul-cielo);
    border-radius: 24px;
    background: var(--fondo-claro);
    padding: 0.93rem 1.25rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--texto-oscuro);
    transition: border-color 0.2s;
}

.message-input:focus {
    outline: none;
    border-color: var(--azul-lila);
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.10);
}

.btn-send {
    background: linear-gradient(135deg, var(--azul-lila), var(--azul-cielo));
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(123, 104, 238, .16);
}

.btn-send svg {
    width: 21px;
    height: 21px;
}

.btn-send:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 18px rgba(179, 234, 234, 0.23);
}

.btn-send:active {
    filter: brightness(0.96);
    transform: scale(0.96);
}

.btn-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: none;
    transform: none;
}

/* Estado de cargando */
.loading-indicator {
    display: flex;
    justify-content: center;
    padding: 1rem;
}

.loading-dots {
    display: flex;
    gap: 0.5rem;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--azul-cielo);
    animation: bounce 1.4s infinite;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        opacity: 0.5;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* Estado vacío (sin mensajes) */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--fondo-blanco), var(--azul-cielo));
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(181, 234, 234, 0.12);
    text-align: center;
    color: var(--texto-claro);
    margin-top: 16px;
}

.empty-state-icon {
    font-size: 2.3rem;
    margin-bottom: 18px;
    opacity: 0.82;
}

.empty-state-text {
    font-size: 1.08rem;
    margin: 0;
    color: var(--texto-claro);
    opacity: 0.8;
}

.empty-state .btn-primary {
    background: var(--toast-info);
    color: #fff;
    padding: 12px 37px;
    border-radius: 23px;
    font-weight: 700;
    margin-top: 14px;
    transition: 0.15s;
}

.empty-state .btn-primary:hover {
    filter: brightness(1.1);
}


/* ======= LISTA DE CHATS ======= */
main.conversations-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--verde-menta), var(--azul-cielo));
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(163, 210, 202, 0.95) 0%, rgba(163, 210, 202, 0) 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.sidebar .nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.sidebar .nav-links li a {
    color: var(--texto-oscuro);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 8px 14px;
    border-radius: 8px;
}

.sidebar .nav-links li a:hover {
    color: #7B68EE;
    background: rgba(255, 255, 255, 0.5);
    text-decoration: underline;
}

.sidebar .session-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--texto-oscuro);
    font-size: 0.9rem;
    font-weight: 600;
}

.sidebar .session-info a {
    color: var(--texto-oscuro);
    text-decoration: none;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.sidebar .session-info a:hover {
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ADB 100%);
    color: #fff;
    border-color: #7B68EE;
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.28);
    transform: translateY(-2px) scale(1.04);
}

/* Container de las conversaciones */
.conversations-container {
    background: var(--fondo-blanco);
    padding: 50px 32px;
    width: 100%;
    max-width: 680px;
    border-radius: 24px;
    border: 2px solid var(--azul-cielo);
    box-shadow: 0 12px 40px rgba(123, 104, 238, 0.10), 0 2px 8px rgba(179, 234, 234, 0.12);
    display: flex;
    flex-direction: column;
    gap: 27px;
    max-height: 80vh;
    overflow: hidden;
    margin-top: 70px;
}

.conversations-header {
    background: linear-gradient(135deg, var(--azul-lila), var(--azul-cielo));
    color: white;
    padding: 32px 29px 19px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid var(--azul-cielo);
    border-radius: 18px 18px 0 0;
    position: sticky;
    top: 0;
    z-index: 9;
    box-shadow: 0 1px 14px rgba(123, 104, 238, 0.10);
}

.conversations-header h1 {
    font-size: 34px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(123, 104, 238, 0.08);
}

.conversations-header .btn-back {
    background: var(--amarillo-palido);
    color: var(--azul-lila);
    border: 2px solid var(--verde-menta);
    padding: 14px 34px;
    border-radius: 24px;
    font-weight: 600;
    transition: 0.2s;
    text-decoration: none;
}

.conversations-header .btn-back:hover {
    filter: brightness(1.06);
    color: var(--texto-oscuro);
    text-decoration: none;
}

/* Lista de chats */
.conversations-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
}

.conversations-list::-webkit-scrollbar {
    width: 8px;
    background: var(--azul-cielo);
}

.conversations-list::-webkit-scrollbar-thumb {
    background: var(--verde-menta);
    border-radius: 7px;
}

.conversations-list::-webkit-scrollbar-thumb:hover {
    background: var(--azul-lila);
}

/* Cada item de chat */
.conversation-item {
    display: flex;
    align-items: center;
    gap: 21px;
    padding: 16px 19px;
    border-bottom: 1.4px solid var(--azul-cielo);
    cursor: pointer;
    transition: background 0.17s, font-weight 0.17s, box-shadow 0.15s;
    background: none;
    text-decoration: none;
}

.conversation-item:hover,
.conversation-item:focus {
    background: linear-gradient(90deg, var(--fondo-claro) 77%, var(--amarillo-palido) 100%);
    text-decoration: none;
}

.conversation-item.unread {
    background: linear-gradient(90deg, var(--verde-menta) 65%, var(--azul-cielo) 100%);
    font-weight: 700;
    text-decoration: none;
}

.conversation-item.selected {
    background: var(--azul-cielo);
    box-shadow: 0 2px 12px rgba(179, 234, 234, 0.15);
    text-decoration: none;
}

.conversation-item a,
.conversation-item a:visited,
.conversation-item a:active,
.conversation-item a:focus {
    color: inherit;
    text-decoration: none !important;
}

/* ========= Avatar ========= */
.conversation-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    overflow: hidden;
    border: 2.5px solid var(--azul-cielo);
    background: var(--fondo-claro);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.conversation-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    background: linear-gradient(135deg, var(--azul-lila), var(--azul-cielo));
    color: white;
    font-size: 22px;
    font-weight: bold;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ====== Conversation Text ======= */
.conversation-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    width: 100%;
    gap: 6px;
}

.conversation-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--azul-lila);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    padding: 0;
    text-decoration: none;
}

.conversation-time {
    font-size: 15px;
    color: var(--texto-claro);
    opacity: 0.75;
    margin-left: 12px;
    text-decoration: none;
}

.conversation-preview {
    font-size: 16px;
    color: var(--texto-claro);
    opacity: 0.92;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    margin: 0;
    padding: 0;
}


/* ========================================
   Empty State
   ======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--fondo-blanco), var(--azul-cielo));
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(181, 234, 234, 0.12);
}

.empty-icon {
    font-size: 35px;
    margin-bottom: 18px;
}

.empty-state p {
    font-size: 17px;
    color: var(--texto-claro);
    opacity: 0.8;
}

.empty-state .btn-primary {
    background: var(--toast-info);
    color: white;
    padding: 12px 37px;
    border-radius: 23px;
    font-weight: 700;
    transition: 0.15s;
    text-decoration: none;
}

.empty-state .btn-primary:hover {
    filter: brightness(1.1);
    text-decoration: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #E8E8E8;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #7B68EE 0%, #6A5ADB 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #6A5ADB 0%, #5A4AC8 100%);
}



/* ========================================
                 ANIMACIONES
   ======================================== */

/* Animación de entrada */
@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Ocultar elementos */
.hidden {
    display: none !important;
}


.swipe-right {
    animation: swipeRight 0.6s ease-out forwards;
}

.swipe-left {
    animation: swipeLeft 0.6s ease-out forwards;
}

@keyframes swipeRight {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateX(150%) rotate(20deg);
        opacity: 0;
    }
}

@keyframes swipeLeft {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateX(-150%) rotate(-20deg);
        opacity: 0;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes slideIn {
    0% {
        transform: translateX(120%) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideOut {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateX(120%) scale(0.8);
        opacity: 0;
    }
}

.toast.cerrando {
    animation: slideOut 0.3s ease-out forwards;
}

/* ----------- RESPONSIVES ----------- */
/* MEDIA QUERY MOBILE (max-width: 767px) */
@media (max-width: 767px) {

    body.discover-page {
        min-height: 100svh;
        min-width: 100vw;
        width: 100vw;
        height: 100svh;
        overflow: auto;
    }

    .discover-page header {
        padding: 0.6em 1em;
        gap: 0.6em;
        flex-direction: row;
        font-size: 0.8rem;
        height: auto;
    }

    .discover-page header .nav-links {
        gap: 0.6em;
        justify-content: center;
        flex-wrap: wrap;
    }

    .discover-page header .nav-links a {
        font-size: 0.8rem;
        padding: 0.6em 0.9em;
    }

    .discover-page header .session-info {
        justify-content: center;
        gap: 0.6em;
        flex-wrap: wrap;
        font-size: 0.8rem;
    }

    .discover-page header .session-info a {
        font-size: 0.8rem;
        padding: 0.6em 0.9em;
    }

    .discover-page main {
        position: static;
        top: unset;
        left: unset;
        width: 100vw;
        min-height: 100svh;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: stretch;
        background: #fff;
    }

    .discover-page .project-card {
        position: relative;
        top: unset;
        left: unset;
        width: 100vw;
        height: calc(100svh - 56px);
        max-width: 100vw;
        max-height: 100svh;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        padding: 0;
        background: #000;
    }

    .discover-page .project-card header {
        position: absolute;
        top: 15px;
        left: 15px;
        right: 15px;
        z-index: 10;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
        padding: 15px;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
        border: 2px solid rgba(163, 210, 202, 0.3);
    }

    .discover-page .project-card header h2 {
        color: var(--texto-oscuro);
        font-size: 1.2rem;
        font-weight: 400;
        margin-bottom: 6px;
    }

    .discover-page .project-card header p {
        color: var(--texto-medio);
        font-size: 0.9rem;
        font-weight: 500;
    }

    .discover-page .project-card .video-section {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        background-color: #000;
    }

    .discover-page .project-card .actions {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 10;
        background: transparent;
        padding: 15px 12px 12px 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .discover-page .project-card .liked-indicator {
        color: var(--texto-oscuro);
        text-align: center;
        font-size: 0.9rem;
        font-weight: 600;
    }

    .discover-page .project-card .buttons {
        gap: 25px;
        margin-bottom: 8px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .discover-page .project-card .buttons button {
        width: 70px;
        height: 70px;
        font-size: 0.8rem;
        border-radius: 50%;
        padding: 0;
        flex-shrink: 0;
    }

    .discover-page .project-card .bottom-bar {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        padding: 11px 12px;
        border-top: 1px solid #ececec;
        background: #fff;
        border-radius: 11px;
        margin-top: 0;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
        gap: 8px;
    }

    .discover-page .project-card .bottom-bar a,
    .discover-page .project-card .bottom-bar button {
        font-size: 0.82rem;
        padding: 7px 14px;
        text-align: center;
        color: #5a5a85;
        font-weight: 600;
        background: #f7f7fa;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        white-space: nowrap;
    }

    .discover-page .project-card .details {
        max-height: 62svh;
        padding: 1.2rem 1rem 1.25rem 1rem;
        overflow-y: auto;
        background: #fff;
        border-radius: 0;
    }

    .discover-page .project-card .details h3 {
        font-size: 1.05rem;
        margin-bottom: 0.5rem;
    }

    .discover-page .project-card .details .description {
        font-size: 0.98rem;
    }

    .discover-page .project-card .details .tags {
        font-size: 0.93rem;
    }
}

/* MEDIA QUERY DESKTOP (min-width: 768px) (solo desktop, móvil sobreescribe arriba) */
@media (min-width: 768px) {

    body.discover-page {
        overflow: auto;
    }

    .discover-page {
        position: relative;
    }

    /* Main centrado en desktop */
    .discover-page main {
        position: relative;
        background: linear-gradient(135deg, #A3D2CA 0%, #B5EAEA 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }

    /* Card con tamaño fijo en desktop */
    .discover-page .project-card {
        position: relative;
        max-width: 450px;
        height: 90vh;
        border-radius: 20px;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
        margin: auto;
        background: #fff;
    }

    /* Sidebar normal en desktop */
    .discover-page .sidebar {
        padding: 20px 40px;
        max-width: 290px;
        box-sizing: border-box;
        border-radius: 20px;
    }
}

/* RESPONSIVE - MÓVIL TOASTS */
@media (max-width: 767px) {
    .contenedor-toast {
        right: 6px;
        bottom: 9px;
        left: 6px;
        width: calc(100vw - 12px);
        max-width: 100vw;
        max-height: 60svh;
        gap: 0.6rem;
    }

    .contenedor-toast::-webkit-scrollbar {
        width: 3px;
    }

    .toast {
        min-height: 54px;
        width: 100%;
    }

    .toast .contenido {
        grid-template-columns: 34px 1fr;
        padding: 0.7rem 0.5rem 0.7rem 0.8rem;
        gap: 0.7rem;
    }

    .toast .icono {
        width: 30px;
        height: 30px;
    }

    .toast .icono svg {
        width: 16px;
        height: 16px;
    }

    .toast .titulo {
        font-size: 0.98rem;
    }

    .toast .descripcion {
        font-size: 0.89rem;
    }

    .toast .btn-cerrar {
        padding: 0.5rem;
        min-width: 32px;
    }

    .toast .btn-cerrar .icono {
        width: 15px;
        height: 15px;
    }
}

@media (max-width: 767px) {

    body.profile-page, body.edit-project-page, body.new-project-page {
        overflow-x: hidden;
        min-width: 100vw;
    }

    /* Header */
    .profile-page .profile-header,
    .edit-project-page .edit-project-header,
    .new-project-page .new-project-header {
        flex-direction: column;
        gap: 0.6em;
        padding: 0.9em 1em;
        text-align: center;
    }

    .profile-page .profile-header h1,
    .edit-project-page .edit-project-header h1,
    .new-project-page .new-project-header h1 {
        font-size: 1.1rem;
    }

    .profile-page .profile-header .session-info,
    .edit-project-page .edit-project-header .session-info,
    .new-project-page .new-project-header .session-info {
        justify-content: center;
        gap: 0.6em;
        flex-wrap: wrap;
    }

    /* User info */
    .profile-page .user-info {
        font-size: 0.98rem;
        margin: 0.8em 1em;
    }

    /* Nav */
    .profile-nav,
    .edit-project-nav,
    .new-project-nav {
        justify-content: center;
        gap: 0.8em;
        flex-wrap: wrap;
    }

    .profile-nav a,
    .edit-project-nav a,
    .new-project-nav a {
        font-size: 0.92rem;
    }

    /* Projects */
    .profile-page .user-projects {
        margin: 1em;
    }

    .profile-page .user-projects h2 {
        font-size: 1.07rem;
        text-align: center;
    }

    .profile-page .user-projects .project-preview {
        width: 100%;
        max-width: 100%;
    }

    /* Tags */
    .tag-item {
        font-size: 0.92rem;
        padding: 0.34em 0.5em;
    }

    /* Forms */
    .profile-form,
    .edit-project-page .profile-form,
    .new-project-page .profile-form {
        margin: 0 1em 1.2em;
        padding: 0.9em 1em;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.6em;
    }

    .form-actions .btn {
        width: 100%;
    }

    .new-project-page input[type="file"] {
        font-size: 0.88rem;
    }
}

@media (max-width: 540px) {
    body.page-error .contenedor {
        width: 100vw;
        max-width: 100vw;
        padding: 1em 0.3em;
        box-sizing: border-box;
    }
    body.page-error h1 {
        font-size: 1.6rem;
    }
    body.page-error h2 {
        font-size: 1rem;
    }
    body.page-error p {
        font-size: 0.93rem;
    }
    .discover-page .project-card .buttons button {
        width: 70px;
        height: 70px;
        font-size: 0.8rem;
    }
}

@media (max-width: 350px) {
    body.page-error h1 {
        font-size: 1rem;
    }
    body.page-error .contenedor {
        padding: 0.5em 0.1em;
    }
}

/* Register page responsive - móvil */
@media (max-width: 767px){
    body.register-page{
        align-items: flex-start;
        padding-bottom: 1.2rem;
        min-height: 100svh;
    }

    body.register-page .register-shell{
        padding: 1.1rem 0.7rem;
        border-radius: 12px;
        max-width: 98vw;
        max-height: calc(100svh - 1.2rem);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }

    body.register-page .register-form .form-row{
        grid-template-columns: 1fr;
    }
}

/* Page error address styles (no changes) */
body.page-error address {
    text-align: center;
    font-style: normal;
    color: var(--texto-claro);
    margin-top: 2em;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

body.page-error address a {
    color: #7B68EE;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

body.page-error address a:hover {
    color: #6A5ADB;
    text-decoration: underline;
}

body.page-error address span {
    color: #9e9e9e;
    font-size: 0.94em;
}

body.page-error a.button:hover {
    box-shadow: 0 8px 25px rgba(255, 170, 167, 0.6);
    transform: translateY(-2px) scale(1.03);
}

@media (max-width: 768px) {
    .matches-grid {
        grid-template-columns: 1fr;
        gap: 1.1em;
    }

    .matches-page h1 {
        font-size: 1.1rem;
    }

    .matches-page .subtitle {
        font-size: 0.98rem;
    }

    .matches-page .sidebar {
        flex-direction: column;
        gap: 0.9em;
        padding: 1em;
    }

    .matches-page .sidebar .nav-links {
        gap: 0.9em;
    }

    .discover-page .project-card .buttons {
        gap: 25px;
    }

    .discover-page .project-card .buttons button {
        width: 70px;
        height: 70px;
        font-size: 0.8rem;
    }

    body.login-page main {
        padding: 1.5rem 0.8rem;
    }

    .contenedor-toast {
        max-width: 100vw;
        right: 5px;
        bottom: 5px;
    }
}

@media (max-width: 480px) {
    .match-card .card-content {
        padding: 0.8em;
    }

    .match-card h3 {
        font-size: 0.97rem;
    }

    .discover-page .project-card header {
        top: 0.7rem;
        left: 0.6rem;
        right: 0.6rem;
        padding: 0.85rem;
    }

    .discover-page .project-card header h2 {
        font-size: 1rem;
    }

    .discover-page .project-card .actions {
        padding: 0.9rem 0.7rem 0.6rem;
    }
}

/* ======= LISTA DE CHATS (RESPONSIVE MÓVIL) ======= */
/* Ocultar "Converses" en la navegación de messages.php */
body.conversations-page .sidebar .nav-links li:nth-child(3) a {
    display: none;
}

@media (max-width: 767px) {
    body.conversations-page {
        overflow-x: hidden;
    }

    body.conversations-page .sidebar {
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        padding: 0.8em 1em;
        gap: 0.6em;
        flex-direction: column;
        background: linear-gradient(180deg, rgba(163, 210, 202, 0.98) 0%, rgba(163, 210, 202, 0.85) 100%);
        backdrop-filter: blur(10px);
    }

    body.conversations-page .sidebar .nav-links {
        gap: 0.6em;
        justify-content: center;
        flex-wrap: wrap;
    }

    body.conversations-page .sidebar .nav-links li a {
        font-size: 0.9rem;
        padding: 0.6em 1em;
        white-space: normal;
    }

    body.conversations-page .sidebar .session-info {
        justify-content: center;
        gap: 0.6em;
        flex-wrap: wrap;
        font-size: 0.85rem;
    }

    body.conversations-page main.conversations-page {
        min-height: 100svh;
        padding: 10px;
    }

    body.conversations-page .conversations-container {
        max-width: 100%;
        width: 100%;
        padding: 18px 14px;
        border-radius: 18px;
        max-height: none;
        margin-top: 10px;
    }

    body.conversations-page .conversations-header {
        padding: 18px 14px 14px;
        align-items: center;
        border-radius: 14px 14px 0 0;
    }

    body.conversations-page .conversations-header h1 {
        font-size: 22px;
        line-height: 1.1;
    }

    body.conversations-page .conversations-header .btn-back {
        padding: 10px 14px;
        border-radius: 20px;
    }

    body.conversations-page .conversation-item {
        gap: 14px;
        padding: 12px 14px;
    }

    body.conversations-page .conversation-avatar {
        width: 46px;
        height: 46px;
    }

    body.conversations-page .avatar-placeholder {
        width: 46px;
        height: 46px;
        font-size: 18px;
    }

    body.conversations-page .conversation-header h3 {
        font-size: 18px;
    }

    body.conversations-page .conversation-time {
        font-size: 13px;
        margin-left: 8px;
    }

    body.conversations-page .conversation-entity {
        font-size: 13px;
        color: var(--texto-claro);
        opacity: 0.85;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.conversations-page .conversation-preview {
        font-size: 14px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    body.conversations-page .conversation-arrow {
        display: none;
    }
}

/* ========== PAGE CHAT (MOBILE FIRST) ========== */
body.page-chat {
    background: linear-gradient(135deg, var(--azul-cielo) 0%, var(--verde-menta) 100%);
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    background: white;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--azul-lila) 0%, var(--azul-cielo) 100%);
    color: white;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid white;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gris-claro);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--azul-lila);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-text {
    flex: 1;
    min-width: 0;
}

.chat-header-text h2 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-text .chat-entity {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-back {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: white;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Message Bubble */
.message-bubble {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.message-bubble.sent {
    justify-content: flex-end;
}

.message-bubble.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 1.05rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-bubble.sent .message-content {
    background: linear-gradient(135deg, var(--azul-lila), var(--azul-lila-hover));
    color: white;
    font-weight: 500;
}

.message-bubble.received .message-content {
    background: #f0f0f0;
    color: var(--texto-oscuro);
}

.message-time {
    font-size: 0.65rem;
    color: #888;
    align-self: flex-end;
    margin: 0 4px;
}

/* Chat Input Area */
.chat-input-area {
    background: white;
    padding: 12px 14px;
    border-top: 1px solid #ddd;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.message-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.message-input {
    flex: 1;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.95rem;
    background: var(--fondo-blanco);
    color: var(--texto-oscuro);
    font-family: 'Josefin Sans', sans-serif;
    min-height: 44px;
}

.message-input:focus {
    outline: none;
    border-color: var(--azul-lila);
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.1);
}

.btn-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--azul-lila), var(--azul-lila-hover));
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.3);
}

.btn-send:active {
    transform: scale(0.95);
}

.btn-send svg {
    width: 22px;
    height: 22px;
}

/* ========== TABLET RESPONSIVE (min-width: 600px) ========== */
@media (min-width: 600px) {
    body.page-chat {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 20px;
        background: linear-gradient(135deg, var(--azul-cielo) 0%, var(--verde-menta) 100%);
    }

    .chat-container {
        max-width: 700px;
        width: 100%;
        height: calc(100vh - 40px);
        border-radius: 18px;
        background: white;
        box-shadow: 0 12px 40px rgba(163, 210, 202, 0.2);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .chat-header {
        padding: 16px 18px;
        border-radius: 18px 18px 0 0;
        position: relative;
    }

    .chat-header-text h2 {
        font-size: 1.1rem;
    }

    .chat-header-text .chat-entity {
        font-size: 0.8rem;
    }

    .chat-avatar {
        width: 50px;
        height: 50px;
    }

    .messages-container {
        padding: 16px 14px;
        gap: 12px;
    }

    .message-content {
        max-width: 70%;
        padding: 10px 14px;
        font-size: 0.95rem;
        border-radius: 14px;
    }

    .message-input {
        padding: 11px 14px;
        font-size: 0.95rem;
    }

    .chat-input-area {
        border-radius: 0 0 18px 18px;
        position: relative;
    }

    .btn-send {
        width: 44px;
        height: 44px;
    }

    .btn-send svg {
        width: 22px;
        height: 22px;
    }
}
