/* -------------------------------------------------------- LAYOUT -------------------------------------------------------- */
#layoutbody {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #a8e6cf, #dcedc1, #ffd3b6);
    font-family: 'Segoe UI', sans-serif;
    overflow-x: hidden;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #e0f2f1;
    border-bottom: 2px solid #81c784;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.date-time{
    margin-left:14px;
    color:#2e7d32;
    display:flex;
    flex-direction:column;
    line-height:1.2;
}

#time{
    font-size:24px;
    font-weight:700;
    color:#388e3c;
}

#date{
    font-size:18px;
    font-weight:500;
    color:#2e7d32;
}

.greeting {
    color: #388e3c;
    font-size: 18px;
    font-weight: bold;
}

.OptionLink {
    color: #388e3c;
    font-size: 35px;
    font-weight: bold;
}

.logout-btn {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #388e3c;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background: #e0f2f1;
    border-right: 2px solid #81c784;
    padding-top: 60px;
    transition: left 0.3s ease;
    z-index: 999;
}

.sidebar.active {
    left: 0;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    padding: 15px 20px;
}

.sidebar ul li a {
    color: #2e7d32;
    text-decoration: none;
    font-size: 16px;
    display: block;
    transition: color 0.3s;
}

.sidebar ul li a:hover {
    color: #388e3c;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 998;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.content {
    margin-top: 80px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
}

.messages-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Fondo oscuro semitransparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Por encima de todo (incluso del top-bar) */
    backdrop-filter: blur(4px); /* Opcional: desenfoca un poco el fondo */
}

/* La ventana centrada */
.message-modal {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    text-align: center;
    border: 2px solid #81c784;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.message-header h3 {
    margin-top: 0;
    color: #2e7d32;
    font-size: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.message-content {
    margin: 20px 0;
    font-size: 16px;
    color: #333;
}

/* Estilos según el tipo de mensaje de Django */
.message-item {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.message-item.success { background-color: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.message-item.error { background-color: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.message-item.warning { background-color: #fff3e0; color: #ef6c00; border: 1px solid #ffcc80; }
.message-item.info { background-color: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* Botón de cierre */
.message-btn {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.3s;
}

.message-btn:hover {
    background-color: #388e3c;
}

/*----------------------------------------- RESPONSIVE MOBILE ---------------------------------------- */

@media screen and (max-width: 768px) {

    .top-bar {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
        backdrop-filter: blur(10px);
    }

    .top-bar > div:first-child {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .greeting {
        font-size: 15px;
        width: 100%;
        text-align: center;
        margin-top: 5px;
    }

    .logout-btn {
        width: 50%;
        text-align: center;
        padding: 10px;
        font-size: 15px;
        align-self: center;
    }

    .date-time{
        margin-left:10px;
        line-height:1.15;
    }

    #time{
        font-size:22px;
    }

    #date{
        font-size:16px;
    }

    .sidebar {
        width: 80%;
        left: -100%;
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar ul li {
        padding: 18px 20px;
    }

    .sidebar ul li a {
        font-size: 17px;
    }

    .content {
        margin-top: 170px;
        padding: 15px;
        min-height: calc(100vh - 170px);
        align-items: flex-start;
    }

    .message-modal {
        width: 95%;
        padding: 20px;
    }

    .message-content {
        font-size: 15px;
    }
}

/* Extra pequeño */

@media screen and (max-width: 480px) {

    .greeting {
        font-size: 14px;
    }

    .logout-btn {
        font-size: 14px;
    }

    .sidebar {
        width: 85%;
    }

    .content {
        padding: 10px;
    }

    .message-modal {
        border-radius: 10px;
    }
}

/* --------------------------------------------------------
   TOP BAR MOBILE IMPROVEMENTS
-------------------------------------------------------- */

@media screen and (max-width:768px){

    .top-bar{
        padding: 10px 12px;
        gap: 6px;
    }

    .date-time{
        font-size: 12px;
        line-height: 1.1;
    }

    .logout-btn{
        margin-top: 5px;
    }
}

/* móviles pequeños */

@media screen and (max-width:480px){

    .greeting{
        display:none;
    }

    .top-bar{
        padding: 8px 10px;
    }

    #time{
        font-size:20px;
    }

    #date{
        font-size:15px;
    }

    .logout-btn{
        padding: 8px;
        font-size:14px;
    }

    .content{
        margin-top: 130px;
        min-height: calc(100vh - 130px);
    }
}


/* --------------------------------------------------------
   HAMBURGER ANIMATION
-------------------------------------------------------- */

.menu-icon{
    width: 30px;
    height: 24px;
    position: relative;
    cursor: pointer;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}

.menu-icon span{
    display:block;
    height:4px;
    width:100%;
    background:#388e3c;
    border-radius:4px;
    transition: all 0.3s ease;
}

/* animación a X */

.menu-icon.active span:nth-child(1){
    transform: translateY(10px) rotate(45deg);
}

.menu-icon.active span:nth-child(2){
    opacity:0;
}

.menu-icon.active span:nth-child(3){
    transform: translateY(-10px) rotate(-45deg);
}
