﻿@import url('https://fonts.googleapis.com/css2?family=Open+Sans&display=swap');

:root {
    --color-main: #ffb400;
    --color-main-light: #ffd368;

    /* antracita que combina con naranja */
    --color-secondary: #1f2937; /* fondo base sidebar */
    --color-secondary-light: #374151; /* hover suave */

    --color-white: #FFFFFF;
    --color-grey: #F5F5F5;
    --color-button: #469EF5;
    --color-button-text: #E9F0FE;
    --color-texto: #222B45;
    --color-error: #D80F3B;
    --color-error-light: #F4E8E9;

    --color-sidebar-text: #ffffff;
    --color-sidebar-hover: #2b3648;
    --color-sidebar-active: #111827;
    --color-sidebar-divider: rgba(255,255,255,.08);
}


/* Fuente y base general */
html, body {
    font-family: 'Open Sans', sans-serif;
    color: var(--color-texto);
}

body {
    margin: 0;
    background-image: url('/img/fondo-gymnyam.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
}

/* Logo de la app */
.logo-gymnyam {
    display: block;
    margin: 30px auto 10px auto;
    height: 100px;
}

.header-logo-grande {
    position: relative;
    height: 120px;
    padding: 10px 30px;
    text-align: right;
}

    .header-logo-grande img {
        height: 100px;
        object-fit: contain;
    }


/* Ajuste para el layout general */
main {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.85); /* opcional: para mejorar legibilidad sobre fondo */
    border-radius: 10px;
}


.bg-gym-main {
    background-color: var(--color-main) !important;
}

.fondo-contenido {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}


.btn-gym {
    background-color: var(--color-main);
    color: white;
    font-weight: bold;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.3s ease-in-out;
    position: relative;
}

    .btn-gym:hover {
        background-color: var(--color-main-light);
        color: var(--color-texto);
        box-shadow: 0 0 10px var(--color-main);
    }

.text-gym-secondary {
    color: var(--color-secondary);
}


.table thead {
    background-color: var(--color-main-light);
    color: var(--color-texto);
    font-weight: bold;
}

.layout-container {
    display: flex;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--color-secondary) 0%, #161e2a 100%);
    color: var(--color-sidebar-text);
    padding-top: 1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid var(--color-sidebar-divider);
}
    .sidebar .nav-title {
        color: rgba(255,255,255,.8); 
        font-weight: 700;
        margin-top: 1rem;
        margin-bottom: .5rem;
        text-transform: uppercase;
        font-size: .8rem;
        letter-spacing: .5px;
    }




.main-content {
    flex-grow: 1;
    padding: 3rem 2rem 2rem 2rem;
    background-color: #f8f9fa;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}



.toggle-sidebar-btn:hover {
    background-color: var(--color-main-light);
    color: var(--color-texto);
    transform: scale(1.05);
}

.sidebar .logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .sidebar .logo img {
        width: 100%;
        height: 100%;
        object-fit: contain; 
        background-color: #fff;
        border-radius: 50%;
        padding: 8px; 
        box-shadow: 0 0 0 2px rgba(255,255,255,.35);
        box-sizing: border-box;
        transition: all .3s ease;
    }



#sidebarLogo {
    cursor: pointer;
}


.sidebar a {
    color: rgba(255,255,255,.95); 
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: .75rem 1.25rem;
    text-decoration: none;
    white-space: nowrap;
    width: 100%;
    transition: background-color .2s ease, color .2s ease, border-left-color .2s ease, opacity .2s;
    border-left: 3px solid transparent;
    opacity: .95;
}

    .sidebar a:visited {
        color: rgba(255,255,255,.95);
    }


    .sidebar a:hover {
        color: #fff; 
        background-color: var(--color-sidebar-hover);
        border-left-color: var(--color-main);
        opacity: 1;
    }

    .sidebar a.active {
        background-color: var(--color-sidebar-active);
        color: #fff;
        border-left-color: var(--color-main);
        box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
    }

    .sidebar a:focus-visible {
        outline: 2px solid var(--color-main);
        outline-offset: 2px;
        border-radius: 6px;
    }


/* Sidebar-links y comportamiento colapsado */
.sidebar-links {
    width: 100%;
    transition: opacity 0.3s ease;
}


/* Cuando el sidebar está colapsado */
.sidebar-collapsed .sidebar {
    width: 80px;
    align-items: center;
}

.sidebar-collapsed .sidebar-links {
    display: none;
}

.sidebar-collapsed .sidebar .logo {
    width: 72px;
    height: 72px;
    margin-bottom: 1rem;
}

    .sidebar-collapsed .sidebar .logo img {
        width: 100%;
        height: 100%;
        padding: 6px;
    }

/* Submenús */

.submenu-group {
    padding: 0 1.5rem;
    margin-top: 1rem;
}

.submenu-title {
    display: block;
    color: var(--color-main-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.submenu-link {
    padding-left: 2rem;
    font-size: 0.95rem;
}


/* Aparicencia menú ADMIN*/
.card-admin {
    border-left: 6px solid var(--color-main);
    background-color: var(--color-white);
    transition: transform 0.2s ease;
    border-radius: 12px;
}

    .card-admin:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    }

.icon-admin {
    font-size: 40px;
    color: var(--color-main);
}


/* Asegura que el texto y los iconos del link hereden el color del <a> */
.sidebar a span,
.sidebar a i {
    color: inherit !important;
}


/* Colapsado: ocultar texto, mantener iconos */
.sidebar-collapsed .sidebar a span {
    display: none;
}

.sidebar-collapsed .sidebar a {
    justify-content: center;
    border-left: none;
}




.sidebar a i {
    min-width: 20px;
    text-align: center;
    opacity: .95;
}



/* Mejora submenús */
.submenu-title {
    color: var(--color-main-light);
    font-size: 0.75rem;
    padding-left: 1.5rem;
}

.submenu-link {
    font-size: 0.9rem;
    padding-left: 2.5rem;
}


.sidebar-logo {
    width: 100px; /* o el tamaño que uses */
    height: 100px;
    object-fit: contain; /* Esto evita que se corte */
    border-radius: 50%;
    background-color: white; /* Para que se vea como un avatar */
    padding: 8px;
}



/* === Chat (UI tipo messenger) === */
.chat-wrapper {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: calc(100vh - 220px);
    max-height: 800px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-white);
}

.chat-header {
    padding: .75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
}

.chat-status {
    font-size: .85rem;
    color: #64748b;
    margin-left: auto;
}

.chat-body {
    overflow-y: auto;
    padding: 1rem;
    background: #f1f5f9;
}

.chat-row {
    display: flex;
    margin: .25rem 0;
}

    .chat-row.me {
        justify-content: flex-end;
    }

    .chat-row.other {
        justify-content: flex-start;
    }

.chat-msg {
    max-width: 70%;
    padding: .6rem .75rem;
    border-radius: 12px;
    line-height: 1.35;
    word-wrap: break-word;
    white-space: pre-wrap;
    display: inline-block;
    position: relative;
    border: 1px solid transparent;
}

    .chat-msg.me {
        background: #dcfce7; /* verde suave */
        border-color: #bbf7d0;
    }

    .chat-msg.other {
        background: #ffffff; /* blanco */
        border-color: #e5e7eb;
    }

.chat-time {
    display: block;
    font-size: .75rem;
    color: #94a3b8;
    margin-top: .2rem;
    text-align: right;
}

.chat-input {
    padding: .75rem;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}

    .chat-input .input-group > .form-control {
        border-radius: 10px 0 0 10px;
    }

    .chat-input .input-group > .btn {
        border-radius: 0 10px 10px 0;
    }

.chat-hint {
    font-size: .85rem;
    color: #64748b;
    margin-top: .35rem;
}

.chat-error {
    color: #b91c1c;
    background: #fee2e2;
    border: 1px solid #fecaca;
    padding: .5rem .75rem;
    border-radius: 8px;
    margin-bottom: .5rem;
    display: none; /* visible cuando hay error */
}


.chat-entry {
    position: relative;
    display: inline-block;
}

.chat-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 50%;
    background: #d80f3b;
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 0 0 2px #fff; /* borde blanco para que no se pierda con el botón */
}
