/* Estilos Gerais */
body { 
    font-family: 'Inter', sans-serif; 
    background-color: #121212; 
    color: #FFFFFF; 
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: auto; /* Previne o scroll do body */
}

#app {
    position: relative;
    height: 100%;
    /*overflow: hidden;*/
}

#main-container {
    height: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    background-color: #121212;
}

#main-container.sidebar-open {
    transform: translateX(280px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background-color: #1F1F1F;
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: #A0A0A0;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-item:hover, .sidebar-item.active {
    background-color: #4CAF50;
    color: #FFFFFF;
}

.sidebar-item svg {
    width: 24px;
    height: 24px;
    margin-right: 1rem;
}

/* Overlay */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#overlay.active {
    opacity: 1;
    visibility: visible;
}


/* Cabeçalho Principal */
#main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: #1F1F1F;
    flex-shrink: 0; /* Impede que o header encolha */
    position: relative;
}

.main-header-title {
    font-size: 1.25rem; 
    font-weight: bold; 
    text-align: center; 
    flex-grow: 1;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.header-btn {
    background: none; 
    border: none; 
    cursor: pointer; 
    color: white; 
    padding: 0.25rem;
    z-index: 1; /* Para ficar acima do título */
}
.main-header-action-btn {
    background: none; 
    border: none; 
    cursor: pointer; 
    color: #4CAF50;
    font-weight: bold;
    z-index: 1; /* Para ficar acima do título */
}
.main-header-action-btn:disabled { 
    color: #555; 
    cursor: not-allowed; 
}


/* Estilos das Telas e Componentes */
#content-area {
    flex-grow: 1;
    overflow-y: auto;
}

.screen { 
    display: none; 
}
.active-screen { 
    display: flex; 
    flex-direction: column; 
    height: 100%;
}

/* Novas classes para layout com rodapé fixo */
.screen-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}
.screen-footer {
    flex-shrink: 0;
    padding: 1rem;
    border-top: 1px solid #2d3748;
    background-color: #121212;
    padding-bottom: 6rem;
}


.logo-image-container { text-align: center; margin: 1rem 0; }
/* Estilo padrão para logos menores */
.logo-image { 
    height: 60px;
    width: auto; 
    max-width: 80%;
    object-fit: contain;
    display: inline-block; 
}

/* Estilo específico e maior para as logos principais */
#screen-welcome .logo-image,
#screen-admin-dashboard .logo-image {
    height: 140px; 
    max-width: 90%;
}

.btn { background-color: #4CAF50; color: white; padding: 0.75rem 1.5rem; border-radius: 0.5rem; text-align: center; font-weight: bold; cursor: pointer; transition: background-color 0.3s; display: flex; align-items: center; justify-content: center; }
.btn:hover { background-color: #45a049; }
.btn:disabled { background-color: #3a8a3e; cursor: not-allowed; }
.btn-secondary { background-color: #333; color: #ccc; border: 1px solid #555; }
.btn-secondary:hover { background-color: #444; }
.btn-danger { background-color: #ef4444 !important; color: white !important; }
.btn-danger:hover { background-color: #dc2626 !important; }
.btn-warning { background-color: #f59e0b; }
.btn-warning:hover { background-color: #d97706; }
.card { background-color: #1F1F1F; border-radius: 0.75rem; padding: 1rem; margin-bottom: 1rem; position: relative; }
.card-image { width: 100%; height: 120px; object-fit: cover; border-radius: 0.5rem; margin-bottom: 0.5rem; }
.selection-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.selection-item { background-color: #2a2a2a; padding: 0.75rem; border-radius: 0.5rem; text-align: center; cursor: pointer; border: 2px solid transparent; }
.selection-item:hover, .selection-item.selected { border-color: #4CAF50; background-color: #333; }
.form-input, .form-textarea, .form-select { background-color: #2a2a2a; border: 1px solid #444; color: white; padding: 0.75rem; border-radius: 0.5rem; width: 100%; margin-bottom: 0.5rem; }
.form-input::placeholder, .form-textarea::placeholder { color: #888; }
.form-textarea { min-height: 80px; }
.list-item { background-color: #2a2a2a; padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 0.5rem; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.list-item:hover { background-color: #333; }
.checkbox-label { display: flex; align-items: center; color: #ccc; }
.checkbox-label input[type="checkbox"] { width: 1.25rem; height: 1.25rem; margin-right: 0.75rem; accent-color: #4CAF50; }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #555; transition: .4s; border-radius: 28px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #4CAF50; }
input:checked + .slider:before { transform: translateX(22px); }
.hidden { display: none !important; }

/* Adicionado para os botões de voltar nos cards */
.back-btn-card {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0,0,0,0.6);
    color: white;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
    z-index: 10;
}

/* Media Query para ecrãs pequenos (como iPhone 8) */
@media (max-height: 667px) {
    #screen-summary .screen-content {
        padding-top: 0.5rem;
        padding-bottom: 7rem; /* Espaço extra apenas em telas menores */
    }

    #screen-summary .card {
        margin-bottom: 0.0rem; /* Diminui a margem inferior */
        padding: 0.0rem 1rem; /* Diminui o preenchimento interno */
    }

    #screen-summary .card-image {
        height: 80px; /* Reduz a altura da imagem */
        margin-bottom: 0.25rem;
    }

    #screen-summary .screen-footer {
        padding: 0.95rem;
    }
}


/* Estilos do Calendário de Bloqueio */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.calendar-nav-btn {
    background-color: #333;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    text-align: center;
}
.calendar-day-header {
    font-weight: bold;
    font-size: 0.8rem;
    color: #a0aec0;
}
.calendar-day {
    padding: 0.75rem 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}
.calendar-day.other-month {
    color: #4a5568;
    cursor: default;
}
.calendar-day:not(.other-month):hover {
    background-color: #4a5568;
}
.calendar-day.today {
    border: 2px solid #4CAF50;
}
.calendar-day.blocked {
    background-color: #c53030;
    color: white;
    text-decoration: line-through;
}

/* Estilos para o botão de CTA (Call to Action) na sidebar */
.sidebar-cta-wrapper {
    margin-top: auto; /* Empurra o botão para o fundo do menu */
    padding: 1.5rem;
}

.sidebar-cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0.75rem;
    width: 100%;
    /*background-color: rgba(0, 0, 0, 0.3);*/
    border: none;
    cursor: pointer;
    color: white;
    font-weight: bold;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}


.sidebar-cta-button svg {
    width: 24px;
    height: 24px;
    margin-right: 0.75rem;
}
