/* --- ESTILOS GENERALES Y RESET --- */
body { font-family: 'Poppins', sans-serif; background-color: #f0f2f5; }
body > .navbar, body > footer { display: none; }
body > main { padding: 0 !important; margin: 0 !important; padding-bottom: 80px !important; }

.home-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px); /* Ocupa la pantalla menos la nav inferior */
}

/* --- SECCIÓN SUPERIOR (HERO) --- */
.home-hero {
    background-image: url('../burbujas.png'), linear-gradient(150deg, #34d5e9 0%, #2086c1 100%);
    background-repeat: no-repeat, no-repeat;
    background-position: center, 0 0;
    background-size: cover, 100% 100%;
    padding: 0.5rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

.home-mascot { width: 90px; height: 90px; margin: 1rem 0; }
.home-search-box {
    width: 100%;
    position: relative;
    margin-bottom: 1rem;
}
.home-search-box .bi-search { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #888; font-size: 1.1rem; }
.home-search-box .location-icon { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: #555; font-size: 1.2rem; }
.home-search-box .form-control {
    border-radius: 50px;
    padding: 14px 50px;
    font-size: 1rem;
    font-weight: 500;
}
.btn-buscar {
    background-color: #268cc8;
    color: white;
    font-weight: bold;
    border: none;
    width: 50%;
    max-width: 350px;
}

/* --- "HOJA" DE CONTENIDO INFERIOR --- */
.home-content-sheet {
    background: white;
    border-radius: 24px 24px 0 0;
    margin-top: -20px;
    position: relative;
    z-index: 1;
    flex-grow: 1;
    padding: 1.5rem;
}
.section-container { margin-bottom: 2rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-title { font-weight: 600; font-size: 1.1rem; margin: 0; }
.section-link { font-size: 0.85rem; font-weight: 500; text-decoration: none; color: #0083B0; }
.recent-search-card { border-radius: 12px; overflow: hidden; aspect-ratio: 1 / 1; }
.recent-search-card img { width: 100%; height: 100%; object-fit: cover; }

/* --- SECCIÓN DE VALORACIONES --- */
.valoraciones-section .valoracion-card {
    background: #e3f2fd;
    border-radius: 15px;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    color: #0d47a1;
}
.valoracion-card:last-child {
    background-color: #e0f2f1;
    color: #004d40;
}
.valoracion-card img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}
.valoracion-info h6 { font-weight: 600; margin: 0; }
.valoracion-info p { font-size: 0.85rem; margin: 0.25rem 0; }
.valoracion-rating { font-weight: 500; font-size: 0.8rem; opacity: 0.9; }
.valoracion-rating .bi-star-fill { color: #ffab00; }

/* --- USER DASHBOARD SECTION --- */
.user-dashboard-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    color: white;
    transition: padding 0.25s ease;
}

.user-dashboard-section .section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.dashboard-greeting-text {
    display: block;
}

.dashboard-header {
    margin-bottom: 0;
    min-height: 40px;
    align-items: center;
}

.dashboard-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.dashboard-toggle-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}

.dashboard-admin-shortcut {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.dashboard-admin-shortcut:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
    transform: translateY(-1px);
}

.dashboard-admin-shortcut i {
    font-size: 1.05rem;
    line-height: 1;
}

.dashboard-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
}

.dashboard-toggle-btn i {
    font-size: 1rem;
    transition: transform 0.25s ease;
}

.dashboard-collapsible-content {
    overflow: hidden;
    max-height: 1200px;
    opacity: 1;
    transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.25s ease;
    margin-top: 1.25rem;
}

.user-dashboard-section.is-collapsed .dashboard-collapsible-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
}

.user-dashboard-section.is-collapsed {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.user-dashboard-section.is-collapsed .section-title {
    margin-bottom: 0;
    line-height: 1.2;
}

.user-dashboard-section.is-collapsed .section-title i {
    margin-bottom: 0;
}

.user-dashboard-section:not(.is-collapsed) .dashboard-toggle-btn i {
    transform: rotate(180deg);
}

/* User Stats Grid */
.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-content h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    margin-bottom: 0.25rem;
}

.stat-content p {
    font-size: 0.75rem;
    margin: 0;
    opacity: 0.8;
    font-weight: 500;
}

/* Home Quick Actions */
.home-quick-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.home-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 70px;
    flex: 1;
    max-width: 100px;
}

.home-action-btn i {
    font-size: 1.3rem;
    text-align: center;
    width: 100%;
}

.home-action-btn span {
    width: 100%;
    text-align: center;
}

.home-action-btn.primary {
    background: rgba(40, 167, 69, 0.9);
    color: white;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.home-action-btn.primary:hover {
    background: rgba(40, 167, 69, 1);
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.home-action-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.home-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    color: white;
}

.home-action-btn.tertiary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.home-action-btn.tertiary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: white;
}

.home-action-btn.quaternary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.home-action-btn.quaternary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: white;
}

.home-action-btn.quinary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.home-action-btn.quinary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: white;
}

.home-action-btn.senary {
    background: rgba(220, 53, 69, 0.2);
    color: white;
    border: 1px solid rgba(220, 53, 69, 0.45);
}

.home-action-btn.senary:hover {
    background: rgba(220, 53, 69, 0.3);
    transform: translateY(-2px);
    color: white;
}

.home-quick-logout-form {
    display: flex;
    flex: 1;
    max-width: 100px;
}

.home-action-btn.logout-action {
    width: 100%;
    border: 1px solid rgba(220, 53, 69, 0.45);
    cursor: pointer;
    font-family: inherit;
}

.admin-title-mobile {
    display: none;
}

/* Responsive Design for User Dashboard */
@media (max-width: 576px) {
    .user-dashboard-section .section-title {
        margin-bottom: 0;
        min-width: 0;
        flex: 1 1 auto;
        white-space: nowrap;
        overflow: hidden;
    }

    .verified-badge {
        position: relative;
        left: -1.5px;
        flex-shrink: 0;
    }

    .dashboard-greeting-text {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dashboard-admin-shortcut {
        width: 36px;
        height: 36px;
    }

    .dashboard-admin-shortcut i {
        font-size: 1rem;
    }

    .dashboard-toggle-btn {
        width: 36px;
        height: 36px;
    }

    .dashboard-toggle-btn i {
        font-size: 0.95rem;
    }

    .user-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-content h4 {
        font-size: 1.2rem;
    }
    
    .stat-content p {
        font-size: 0.7rem;
    }
    
    .home-quick-actions {
        gap: 0.5rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        justify-content: flex-start;
        padding-bottom: 0.15rem;
    }

    .home-quick-actions::-webkit-scrollbar {
        display: none;
    }
    
    .home-action-btn {
        min-width: 60px;
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .home-quick-logout-form {
        flex: 0 0 auto;
        max-width: none;
    }

    .home-action-btn span {
        display: none;
    }
    
    .home-action-btn i {
        font-size: 1.25rem;
    }

    .admin-panel-card {
        padding: 0.5rem 0.25rem !important;
    }

    .admin-title-desktop,
    .admin-panel-text p {
        display: none;
    }

    .admin-title-mobile {
        display: block;
        margin: 0;
    }
}