/* Estilos para o sistema de Favoritos e Recentes */

/* Sidebar */
.service-sidebar {
    position: fixed;
    top: 0;
    left: -300px; /* Começa escondido */
    width: 300px;
    height: 100%;
    background-color: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    padding-top: 48px; /* Espaço para a barra superior */
}

.service-sidebar.open {
    left: 0;
}

/* Botão para abrir/fechar o sidebar */
.toggle-sidebar {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 30px;
    height: 60px;
    background-color: #235aa7;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.3s ease;
}

.service-sidebar.open + .toggle-sidebar {
    left: 300px;
}

/* Abas */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.sidebar-tab {
    flex: 1;
    padding: 8px;
    text-align: center;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: #777;
    transition: all 0.2s ease;
}

.sidebar-tab.active {
    color: #235aa7;
    border-bottom: 3px solid #235aa7;
}

.sidebar-tab:hover {
    background-color: #f5f5f5;
}

/* Painéis de conteúdo */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
}

.sidebar-panel {
    display: none;
    padding: 16px;
}

.sidebar-panel.active {
    display: block;
}

/* Lista de serviços */
.service-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-item {
    position: relative;
    margin-bottom: 8px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.service-item:hover {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.service-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
}

.service-icon {
    margin-right: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #235aa7;
}

/* Compensar o mt-4 do grid principal para centralizar o ícone no sidebar */
.service-icon i {
    margin-top: 0 !important; /* Remove qualquer margem top que venha do grid */
}

.service-title {
    flex: 1;
    font-weight: 500;
}

.access-time {
    font-size: 12px;
    color: #888;
    margin-left: 8px;
}

/* Botão para remover dos favoritos */
.remove-service {
    position: absolute;
    right: 8px;
    top: 8px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.service-item:hover .remove-service {
    opacity: 1;
}

.remove-service:hover {
    background-color: #f0f0f0;
    color: #e74c3c;
}

/* Botão de favoritos para os items do grid */
.favorite-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #235aa7; /* Alterado de #ffab00 para a cor principal do tema */
    font-size: 18px;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.favorite-button:hover {
    opacity: 1;
    transform: scale(1.1);
}

.favorite-button.near-footer {
    opacity: 0;
    pointer-events: none;
}

.grid-item:hover .favorite-button {
    opacity: 1;
}

/* Mensagem vazia */
.empty-message {
    color: #888;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Notificação */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #235aa7;
    color: white;
    padding: 12px 16px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    transition: all 0.3s ease;
    transform: translateY(100px);
    opacity: 0;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* Compatibilidade com Dark Mode */
.dark-mode .service-sidebar {
    background-color: #2D2D2D;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.dark-mode .toggle-sidebar {
    background-color: #1a3b6d;
}

.dark-mode .sidebar-tab {
    color: #b0b0b0;
}

.dark-mode .sidebar-tab.active {
    color: #4c8ed7;
    border-bottom-color: #4c8ed7;
}

.dark-mode .sidebar-tab:hover {
    background-color: #3d3d3d;
}

.dark-mode .service-link {
    color: #e0e0e0;
}

.dark-mode .service-icon {
    background-color: #3d3d3d;
    color: #4c8ed7;
}

.dark-mode .service-item {
    background-color: #2D2D2D;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark-mode .service-item:hover {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.dark-mode .access-time {
    color: #aaa;
}

.dark-mode .remove-service {
    color: #aaa;
}

.dark-mode .remove-service:hover {
    background-color: #3d3d3d;
    color: #ff6b6b;
}

.dark-mode .empty-message {
    color: #aaa;
}

.dark-mode .notification {
    background-color: #1a3b6d;
}

/* Compatibilidade com High Contrast */
.high-contrast .service-sidebar {
    background-color: #000000;
    box-shadow: 0 0 10px #ff0;
    border-right: 2px solid #ff0;
}

.high-contrast .toggle-sidebar {
    background-color: #000000;
    color: #ff0;
    border: 2px solid #ff0;
}

.high-contrast .sidebar-tab {
    color: #ff0;
    border: 1px solid #ff0;
}

.high-contrast .sidebar-tab.active {
    background-color: #ff0;
    color: #000000;
}

.high-contrast .sidebar-tab:hover {
    background-color: #333;
}

.high-contrast .service-link {
    color: #ff0;
}

.high-contrast .service-icon {
    background-color: #333;
    color: #ff0;
    border: 1px solid #ff0;
}

.high-contrast .service-item {
    background-color: #000000;
    border: 1px solid #ff0;
    box-shadow: none;
}

.high-contrast .service-item:hover {
    background-color: #333;
}

.high-contrast .access-time {
    color: #ff9;
}

.high-contrast .remove-service {
    color: #ff0;
    border: 1px solid #ff0;
}

.high-contrast .remove-service:hover {
    background-color: #ff0;
    color: #000000;
}

.high-contrast .favorite-button {
    color: #ff0;
    border: 1px solid #ff0;
}

.high-contrast .empty-message {
    color: #ff0;
}

.high-contrast .notification {
    background-color: #000000;
    color: #ff0;
    border: 1px solid #ff0;
}

/* Para garantir que funciona bem no mobile */
@media (max-width: 480px) {
    .service-sidebar {
        width: 85%;
        left: -85%;
    }
    
    .service-sidebar.open + .toggle-sidebar {
        left: 85%;
    }
    
    .notification {
        left: 20px;
        right: 20px;
        bottom: 20px;
        text-align: center;
    }
}
