/* Navbar */
.navbar {
    background: #1F2A44;
    padding: clamp(0.3rem, 1vw, 0.5rem) clamp(0.5rem, 1.5vw, 0.8rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 900;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.navbar-brand img {
    width: clamp(22px, 6vw, 30px);
    height: auto;
    margin-right: clamp(0.2rem, 0.8vw, 0.4rem);
}

.navbar-brand span {
    color: #F0F4F8;
    font-weight: 700;
    font-size: clamp(0.8rem, 2.5vw, 1rem);
}

.btn-logout {
    display: flex;
    align-items: center;
    background: none;
    color: #F0F4F8;
    border: none;
    padding: clamp(0.2rem, 0.8vw, 0.4rem);
    font-size: clamp(1rem, 3vw, 1.4rem);
    transition: color 0.25s ease, transform 0.25s ease;
}

.btn-logout:active {
    color: #FF5733;
    transform: scale(0.97);
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    padding: clamp(1rem, 3vw, 1.5rem) clamp(0.5rem, 1.5vw, 0.8rem); /* Reducido el padding vertical */
    background: rgba(31, 42, 68, 0.2);
    margin-top: clamp(2rem, 5vw, 3rem);
    position: relative;
    z-index: 800;
    animation: slideIn 0.4s ease forwards;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Permite que el contenido se ajuste en una línea o se envuelva si es necesario */
    gap: clamp(0.5rem, 1.5vw, 0.8rem); /* Espacio entre elementos */
}

.welcome-section h1 {
    font-size: clamp(1rem, 4vw, 1.5rem);
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
    color: #F0F4F8;
    margin: 0; /* Eliminado margen para ahorrar espacio */
}

.welcome-section p {
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    color: #F0F4F8;
    margin: 0; /* Eliminado margen */
}

.welcome-section .casillas-info {
    display: inline-flex;
    align-items: center;
    gap: clamp(0.3rem, 1vw, 0.5rem); /* Espacio entre elementos en la línea */
}

.welcome-section .casillas-info h2 {
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    font-weight: 600;
    color: #FFB400;
    margin: 0; /* Sin margen para mantenerlo en línea */
}

.welcome-section .casillas-info ul {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: clamp(0.5rem, 1.5vw, 0.8rem); /* Espacio entre casillas */
}

.welcome-section .casillas-info li {
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    color: #F0F4F8;
    margin: 0; /* Sin margen para mantener en línea */
}

.welcome-section .casillas-info .casilla-nombre {
    font-weight: 500;
}

.welcome-section .casillas-info .casilla-puntos {
    color: #FFB400;
    margin-left: clamp(0.2rem, 0.8vw, 0.4rem);
}

/* Contenido */
.content {
    padding: clamp(0.5rem, 1.5vw, 0.8rem) clamp(0.3rem, 1vw, 0.5rem) clamp(2.5rem, 7vw, 3rem);
    flex-grow: 1;
    animation: fadeIn 0.5s ease forwards;
    position: relative;
    z-index: 700;
}

.section-title {
    font-size: clamp(0.9rem, 3vw, 1.2rem);
    font-weight: 600;
    margin: clamp(0.8rem, 2.5vw, 1rem) 0 clamp(0.4rem, 1.2vw, 0.6rem);
    text-align: center;
    color: #FFB400;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.app-icon-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(70px, 22vw, 90px), 1fr));
    gap: clamp(0.5rem, 1.8vw, 1rem);
    justify-items: center;
    padding: clamp(0.3rem, 1vw, 0.5rem);
}

.app-icon {
    background: rgba(31, 42, 68, 0.85);
    padding: clamp(0.7rem, 2.5vw, 1rem);
    border-radius: clamp(12px, 3vw, 16px);
    text-align: center;
    cursor: pointer;
    width: 100%;
    max-width: clamp(85px, 26vw, 105px);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.app-icon:active {
    transform: scale(0.97);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background: rgba(31, 42, 68, 1);
}

.app-icon i {
    font-size: clamp(1.5rem, 5.5vw, 2.2rem);
    color: #FFB400;
    transition: color 0.25s ease;
}

.app-icon span {
    display: block;
    font-size: clamp(0.6rem, 2vw, 0.9rem);
    color: #F0F4F8;
    margin-top: clamp(0.2rem, 0.8vw, 0.3rem);
    font-weight: 500;
}

/* Bottom Navigation */
.bottom-nav {
    background: #1F2A44;
    padding: clamp(0.3rem, 1vw, 0.5rem) 0;
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.3);
    z-index: 900;
    border-top: 1px solid rgba(240, 244, 248, 0.2);
}

.bottom-nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    color: #F0F4F8;
    text-decoration: none;
    font-size: clamp(0.6rem, 2vw, 0.9rem);
    padding: clamp(0.3rem, 1vw, 0.5rem) clamp(0.5rem, 1.5vw, 0.8rem);
    transition: color 0.25s ease, transform 0.25s ease;
}

.bottom-nav-item i {
    font-size: clamp(1.2rem, 4vw, 1.7rem);
    margin-right: clamp(0.2rem, 0.8vw, 0.4rem);
}

.bottom-nav-item span {
    display: inline;
    font-size: clamp(0.6rem, 2vw, 0.9rem);
    color: #F0F4F8;
}

.bottom-nav-item:hover, .bottom-nav-item:active {
    color: #FF5733;
    transform: scale(1.05);
}

.bottom-nav-item.active {
    color: #FFB400;
}

/* Tour */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 1000;
}

.tour-popup {
    position: fixed;
    background: #FFFFFF;
    color: #1F2A44;
    padding: clamp(0.6rem, 2vw, 1rem);
    border-radius: clamp(8px, 2vw, 12px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 1001;
    width: clamp(70%, 80vw, 85%);
    max-width: 280px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: popIn 0.3s ease forwards;
}

.tour-popup h3 {
    font-size: clamp(0.8rem, 3vw, 1.1rem);
    margin-bottom: clamp(0.2rem, 0.8vw, 0.4rem);
}

.tour-popup p {
    font-size: clamp(0.6rem, 2vw, 0.8rem);
    color: #5A6F88;
}

.tour-popup button {
    background: #FF5733;
    color: #FFFFFF;
    border: none;
    padding: clamp(0.3rem, 1vw, 0.5rem) clamp(0.6rem, 2vw, 1rem);
    border-radius: clamp(4px, 1vw, 6px);
    cursor: pointer;
    margin: clamp(0.2rem, 0.8vw, 0.4rem) clamp(0.2rem, 0.8vw, 0.4rem) 0 0;
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    transition: transform 0.25s ease;
}

.tour-popup button:active {
    transform: scale(0.97);
}

.tour-arrow {
    position: fixed;
    width: 0;
    height: 0;
    border: clamp(6px, 1.5vw, 10px) solid transparent;
    border-bottom-color: #FFFFFF;
    display: none;
    z-index: 1002;
}

/* Media Queries */
@media (max-width: 360px) {
    .navbar {
        padding: clamp(0.2rem, 0.8vw, 0.4rem) clamp(0.4rem, 1.2vw, 0.6rem);
    }
    .navbar-brand img {
        width: clamp(18px, 5vw, 24px);
    }
    .navbar-brand span {
        font-size: clamp(0.7rem, 2.2vw, 0.9rem);
    }
    .welcome-section {
        padding: clamp(0.8rem, 2.5vw, 1rem) clamp(0.4rem, 1.2vw, 0.6rem);
        margin-top: clamp(1.5rem, 4vw, 2rem);
        gap: clamp(0.3rem, 1vw, 0.5rem);
    }
    .welcome-section h1 {
        font-size: clamp(0.9rem, 3.5vw, 1.2rem);
    }
    .welcome-section p {
        font-size: clamp(0.6rem, 1.8vw, 0.8rem);
    }
    .welcome-section .casillas-info h2 {
        font-size: clamp(0.8rem, 2.5vw, 1rem);
    }
    .welcome-section .casillas-info li {
        font-size: clamp(0.6rem, 1.8vw, 0.8rem);
    }
    .app-icon-container {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: clamp(0.3rem, 1.2vw, 0.6rem);
    }
    .app-icon {
        max-width: clamp(70px, 22vw, 85px);
        padding: clamp(0.5rem, 2vw, 0.8rem);
    }
    .app-icon i {
        font-size: clamp(1.2rem, 4.5vw, 1.8rem);
    }
    .app-icon span {
        font-size: clamp(0.5rem, 1.8vw, 0.7rem);
    }
    .bottom-nav {
        padding: clamp(0.2rem, 0.8vw, 0.4rem) 0;
    }
    .bottom-nav-item {
        font-size: clamp(0.5rem, 1.8vw, 0.7rem);
        padding: clamp(0.2rem, 0.8vw, 0.4rem) clamp(0.3rem, 1vw, 0.6rem);
    }
    .bottom-nav-item i {
        font-size: clamp(1rem, 3.5vw, 1.5rem);
        margin-right: clamp(0.1rem, 0.5vw, 0.3rem);
    }
    .bottom-nav-item span {
        font-size: clamp(0.5rem, 1.8vw, 0.7rem);
    }
}

@media (min-width: 361px) and (max-width: 480px) {
    .welcome-section {
        margin-top: clamp(1.8rem, 4.5vw, 2.5rem);
    }
    .app-icon-container {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: clamp(0.4rem, 1.5vw, 0.8rem);
    }
    .app-icon {
        max-width: clamp(75px, 23vw, 95px);
    }
    .bottom-nav-item {
        font-size: clamp(0.6rem, 1.9vw, 0.8rem);
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .welcome-section {
        margin-top: clamp(2rem, 5vw, 3rem);
    }
    .app-icon-container {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: clamp(0.5rem, 1.8vw, 1rem);
    }
    .app-icon {
        max-width: clamp(85px, 25vw, 105px);
    }
    .bottom-nav {
        padding: clamp(0.4rem, 1.2vw, 0.6rem) 0;
    }
    .bottom-nav-item {
        font-size: clamp(0.7rem, 2vw, 0.9rem);
    }
}