@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --dark-bg: #212121; /* Cor de fundo escura, como na imagem */
    --card-bg: #2C2C2E; /* Cor de fundo dos cards */
    --text-color: #E0E0E0; /* Cor do texto principal */
    --light-text: #99A0AA; /* Cor para texto mais suave/secundário */
    --plus-color: #4CAF50; /* Verde para o ícone de adição */
    --border-radius-lg: 18px; /* Raio da borda maior para os cards */
    --border-radius-sm: 8px; /* Raio da borda menor */
    --notification-bg: #E74C3C; /* Vermelho para notificações */
    --notification-text: white;
    --button-simulate-bg: #3498db; /* Azul para botões de simulação */
    --button-simulate-hover: #2980b9;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alinha o conteúdo ao topo */
    min-height: 100vh;
    overflow-x: hidden; /* Evita scroll horizontal */
}

.dashboard-container {
    padding: 40px 20px;
    max-width: 1200px; /* Largura máxima do dashboard */
    width: 100%;
}

.dashboard-header {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    padding-left: 20px; /* Espaçamento da esquerda */
}

.header-line {
    width: 4px;
    height: 30px;
    background-color: var(--plus-color); /* Linha verde */
    margin-right: 15px;
    border-radius: 2px;
}

.dashboard-header h1 {
    font-size: 2.2em;
    font-weight: 600;
    color: var(--light-text);
    margin: 0;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    justify-content: center;
}

.card-link {
    text-decoration: none;
    color: inherit;
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.add-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    color: var(--light-text);
    font-size: 1.2em;
    opacity: 0;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.card:hover .add-icon {
    opacity: 1;
    color: var(--plus-color);
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}

.card-icon {
    font-size: 3em;
    color: var(--text-color);
    margin-bottom: 15px;
    align-self: flex-start;
}

.card h2 {
    font-size: 1.3em;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
    line-height: 1.3;
    text-align: left;
}

.notification-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--notification-bg);
    color: var(--notification-text);
    font-size: 0.75em;
    font-weight: 700;
    padding: 0.2em 0.5em;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 5;
    display: none; /* Escondido por padrão, só aparece se tiver notificações */
    transform: scale(0.9);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.notification-badge.visible {
    display: block;
    transform: scale(1);
    opacity: 1;
}

/* NOVO: Estilo para o status de conexão ao backend */
.connection-status {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--light-text);
    font-size: 0.9em;
}

/* Notification Simulation Section */
.notification-simulation-section {
    margin-top: 40px;
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.notification-simulation-section h3 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.simulation-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    justify-content: center;
}

.simulate-btn {
    padding: 12px 15px;
    background-color: var(--button-simulate-bg);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.simulate-btn:hover {
    background-color: var(--button-simulate-hover);
    transform: translateY(-2px);
}

/* Responsividade */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 25px 15px;
    }

    .dashboard-header {
        margin-bottom: 30px;
        padding-left: 0;
        justify-content: center;
    }

    .header-line {
        height: 25px;
        margin-right: 10px;
    }

    .dashboard-header h1 {
        font-size: 1.8em;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .card {
        padding: 20px;
    }

    .card-icon {
        font-size: 2.5em;
    }

    .card h2 {
        font-size: 1.1em;
    }

    .add-icon {
        font-size: 1em;
        top: 10px;
        right: 10px;
    }

    .notification-badge {
        top: 5px;
        right: 5px;
        font-size: 0.65em;
        padding: 0.1em 0.4em;
        min-width: 18px;
    }

    .notification-simulation-section {
        padding: 20px;
    }

    .simulation-buttons-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: 20px 10px;
    }
    .dashboard-header h1 {
        font-size: 1.5em;
    }
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .card {
        max-width: 300px;
        margin: 0 auto;
    }
}

/* Bloco modificado para posicionar no canto superior direito */
#fullscreen-button {
    position: fixed; /* Fixa na tela */
    top: 20px;       /* 20px do topo */
    right: 20px;     /* 20px da direita */
    /* Remova 'left: 50%;' e 'transform: translateX(-50%);' */
    background-color: transparent; /* Reutiliza cor de botão de simulação*/
    color: var(--notification-text); /* Cor do texto*/
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm); /* Borda arredondada*/
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
    z-index: 1000; /* Garante que fique acima de outros elementos */
    display: flex;
    align-items: center;
    gap: 8px;
}

#fullscreen-button i {
    font-size: 1.2em;
}

/* Opcional: Estilo para quando a página está em tela cheia (o ícone pode mudar) */
#fullscreen-button.active i.fas.fa-expand {
    display: none;
}

#fullscreen-button.active i.fas.fa-compress {
    display: inline-block; /* Mostra o ícone de "encolher" */
}

/* Certifique-se de ter o ícone de compressão disponível, senão adicione ele no HTML */
#fullscreen-button i.fas.fa-compress {
    display: none; /* Escondido por padrão */
}

/* Responsividade para o botão de tela cheia */
@media (max-width: 768px) {
    #fullscreen-button {
        top: 15px; /* Ajuste para telas menores */
        right: 15px; /* Ajuste para telas menores */
        padding: 8px 15px;
        font-size: 0.9em;
    }
}