/* --- GERAL & VARIÁRIAS DE TEMA (MODO CLARO PADRÃO) --- */
:root {
    --primary-color: #1565c0;
    --primary-dark-color: #0d47a1;
    --accent-color: #29b6f6;
    --danger-color: #d32f2f;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --info-color: #1565c0; /* Azul para a barra de progresso */
    --background-color: #f4f6f8;
    --surface-color: #ffffff;
    --header-footer-bg: #ffffff;
    --text-color: #212121;
    --text-light-color: #757575;
    --text-on-primary-color: #ffffff;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --border-radius: 12px;
    --border-radius-round: 50%;
    --transition-speed: 0.2s;
}

body.light-purple-mode {
    --primary-color: #9b59b6; /* Roxo principal */
    --primary-dark-color: #8e44ad;
    --accent-color: #be90d4;
    --info-color: #9b59b6;
    --background-color: #f5eef8; /* Fundo roxo claro */
    --surface-color: #ffffff;
    --header-footer-bg: #ffffff;
    --text-color: #3d2a45; /* Cor de texto escura */
    --text-light-color: #9b59b6;
    --text-on-primary-color: #ffffff;
    --border-color: #e8daef;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body.dark-purple-mode {
    --primary-color: #bb86fc;         /* Roxo claro para destaque no fundo escuro */
    --primary-dark-color: #a775d9;    /* Um roxo um pouco mais escuro para o hover */
    --accent-color: #d1b1f2;
    --info-color: #bb86fc;
    --background-color: #121212;      /* Fundo quase preto, padrão em dark modes */
    --surface-color: #1e1e1e;         /* Cor das "cartas" e secções, um pouco mais clara */
    --text-color: #e0e0e0;            /* Texto principal claro */
    --text-light-color: #9e9e9e;      /* Texto secundário um pouco mais cinzento */
    --text-on-primary-color: #000000;  /* Texto sobre os botões roxos (preto) */
    --border-color: #424242;          /* Borda escura, mas visível */
    --shadow-color: rgba(0, 0, 0, 0.5); /* Sombra mais forte para o modo escuro */
}

/* --- TEMAS ADICIONAIS --- */
body.dark-mode {
    --primary-color: #29b6f6;
    --primary-dark-color: #0288d1;
    --accent-color: #4fc3f7;
    --info-color: #29b6f6;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --header-footer-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-light-color: #9e9e9e;
    --text-on-primary-color: #000000;
    --border-color: #424242;
    --shadow-color: rgba(0, 0, 0, 0.4);
}

body.dark-warm-mode {
    --primary-color: #ff8a65;
    --primary-dark-color: #e64a19;
    --accent-color: #ffb74d;
    --info-color: #ff8a65;
    --background-color: #212121;
    --surface-color: #303030;
    --header-footer-bg: #303030;
    --text-color: #f5f5f5;
    --text-light-color: #bdbdbd;
    --text-on-primary-color: #000000;
    --border-color: #515151;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

body.dark-grey-mode {
    --primary-color: #90a4ae;
    --primary-dark-color: #546e7a;
    --accent-color: #b0bec5;
    --info-color: #90a4ae;
    --background-color: #263238;
    --surface-color: #37474f;
    --header-footer-bg: #37474f;
    --text-color: #eceff1;
    --text-light-color: #b0bec5;
    --text-on-primary-color: #000000;
    --border-color: #546e7a;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

body.light-mode { /* This is the default */
    --primary-color: #1565c0;
    --primary-dark-color: #0d47a1;
    --accent-color: #29b6f6;
    --info-color: #1565c0;
    --background-color: #f4f6f8;
    --surface-color: #ffffff;
    --header-footer-bg: #ffffff;
    --text-color: #212121;
    --text-light-color: #757575;
    --text-on-primary-color: #ffffff;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body.light-blue-mode {
    --primary-color: #03a9f4;
    --primary-dark-color: #0288d1;
    --accent-color: #81d4fa;
    --info-color: #03a9f4;
    --background-color: #e3f2fd;
    --surface-color: #ffffff;
    --header-footer-bg: #ffffff;
    --text-color: #263238;
    --text-light-color: #546e7a;
    --text-on-primary-color: #ffffff;
    --border-color: #bbdefb;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body.light-green-mode {
    --primary-color: #4caf50;
    --primary-dark-color: #388e3c;
    --accent-color: #81c784;
    --info-color: #4caf50;
    --background-color: #e8f5e9;
    --surface-color: #ffffff;
    --header-footer-bg: #ffffff;
    --text-color: #1b5e20;
    --text-light-color: #4caf50;
    --text-on-primary-color: #ffffff;
    --border-color: #c8e6c9;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body.light-pink-mode {
    --primary-color: #ec407a;
    --primary-dark-color: #c2185b;
    --accent-color: #f48fb1;
    --info-color: #ec407a;
    --background-color: #fce4ec;
    --surface-color: #ffffff;
    --header-footer-bg: #ffffff;
    --text-color: #880e4f;
    --text-light-color: #c2185b;
    --text-on-primary-color: #ffffff;
    --border-color: #f8bbd0;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body.light-orange-mode {
    --primary-color: #ff9800;
    --primary-dark-color: #f57c00;
    --accent-color: #ffb74d;
    --info-color: #ff9800;
    --background-color: #fff3e0;
    --surface-color: #ffffff;
    --header-footer-bg: #ffffff;
    --text-color: #e65100;
    --text-light-color: #f57c00;
    --text-on-primary-color: #ffffff;
    --border-color: #ffe0b2;
    --shadow-color: rgba(0, 0, 0, 0.1);
}


/* --- ESTILOS DE BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overscroll-behavior-y: contain;
}

/* --- LAYOUT PRINCIPAL DA APLICAÇÃO --- */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--background-color); /* Alterado para a cor de fundo principal */
    box-shadow: 0 0 20px var(--shadow-color);
    position: relative;
}

header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background-color: var(--header-footer-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

main {
    flex-grow: 1;
    position: relative;
    overflow-x: hidden;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    background-color: var(--header-footer-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 8px var(--shadow-color);
    z-index: 100;
}

/* --- ECRÃS (TELAS) --- */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 20px 15px 90px 15px;
    display: none;
    text-align: center;
}

.screen.active {
    display: block; 
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- ELEMENTOS DE UI COMUNS --- */
h2, h3, h4 {
    color: var(--primary-color);
    text-align: center;
}

h2 { font-size: 1.5em; }
h3 { font-size: 1.2em; }
h4 { font-size: 1.1em; }

p {
    margin-bottom: 10px;
}

.light-text {
    color: var(--text-light-color);
    font-size: 0.9em;
}

.page-section {
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    /* gap removido daqui para ser controlado por regras mais específicas */
    width: 100%;
    text-align: center;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 15px 0;
}

.screen-header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.screen-header h2 {
    flex-grow: 0;
    text-align: center;
    margin: 0;
    white-space: nowrap;
}

.button-group-vertical {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
}


/* --- CABEÇALHO --- */
.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title-container {
    text-align: center;
    flex-grow: 1;
}

.header-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-color);
}

.date-display {
    font-size: 0.8em;
    color: var(--text-light-color);
}

.date-time-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* Cria um pequeno espaço entre a data e as horas */
}

.app-icon-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.app-icon-button .app-icon-img {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius);
}

/* --- RODAPÉ DE NAVEGAÇÃO --- */
.nav-item, .nav-item-header {
    background: none;
    border: none;
    color: var(--text-light-color);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.8em;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.nav-item .emoji, .nav-item-header .emoji {
    font-size: 1em;
}

.nav-item:hover {
    background-color: var(--background-color);
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item-header {
    color: var(--text-color);
    font-size: 1.6em;
}

.theme-toggle {
    font-size: 1.3em !important;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 5px;
    color: var(--text-color);
}


/* --- BOTÕES --- */
button, .action-button, .link-button {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background-color var(--transition-speed), transform var(--transition-speed);
    width: 100%;
}

button:active, .action-button:active, .link-button:active {
    transform: scale(0.98);
}

.action-button {
    background-color: var(--primary-color);
    color: var(--text-on-primary-color);
}

.action-button:hover {
    background-color: var(--primary-dark-color);
}

.link-button {
    background-color: transparent;
    color: var(--primary-color);
}

.link-button:hover {
    background-color: var(--background-color);
}

.red-button {
    background-color: var(--danger-color);
    color: #fff;
}

.red-button:hover {
    background-color: #b71c1c;
}

.toggle-button {
    background-color: var(--surface-color);
    color: var(--text-light-color);
    border: 2px solid var(--border-color);
}

.toggle-button.active {
    background-color: var(--success-color);
    color: #fff;
    border-color: var(--success-color);
}

#participated-btn:not(.active) {
    background-color: var(--danger-color);
    color: #fff;
    border-color: var(--danger-color);
}


.screen-header .add-button-container {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.add-button-round {
    background-color: var(--primary-color);
    color: var(--text-on-primary-color);
    font-size: 2em;
    width: 50px;
    height: 50px;
    padding: 0;
    line-height: 50px;
    border-radius: var(--border-radius-round);
}

/* --- FORMULÁRIOS & ENTRADAS --- */
input[type="text"],
input[type="password"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1em;
    background-color: var(--background-color);
    color: var(--text-color);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.2);
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-light-color);
    text-align: left;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.inline-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.inline-inputs > div {
    flex: 1;
}

.day-checkboxes-aligned {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    text-align: center;
    width: 100%;
    padding: 10px 0;
}
.day-checkbox-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.day-checkbox-item label {
    font-weight: bold;
    margin-bottom: 0;
}
.day-checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

/* --- TELA DE LOGIN PREMIUM --- */
#login-screen.active, #register-screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(145deg, var(--background-color) 0%, #eef2f5 100%);
}

body.dark-mode #login-screen.active, body.dark-mode #register-screen.active {
    background: linear-gradient(145deg, var(--background-color) 0%, #1a1a1a 100%);
}

.login-card {
    background-color: var(--surface-color);
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px var(--shadow-color);
    text-align: center;
    max-width: 380px;
    width: 100%;
    border: 1px solid var(--border-color);
    animation: slideUpFadeIn 0.6s ease-out forwards;
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    width: 90px;
    height: 90px;
    border-radius: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.login-title {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}

.login-tagline {
    font-size: 1em;
    color: var(--text-light-color);
    margin-bottom: 30px;
}

.outline-button {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    transition: all 0.2s ease;
}

.outline-button:hover {
    background-color: var(--primary-color);
    color: var(--text-on-primary-color);
}

/* --- CRONÓMETRO (TIMER) --- */
.timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.timer-input-container {
    display: flex;
    justify-content: center;
}

.timer-section input[type="time"] {
    width: 120px;
    text-align: center;
    font-size: 1.2em;
    border: 2px solid var(--border-color);
}


.timer-buttons-container {
    display: flex;
    gap: 15px;
}

#play-timer-btn, #pause-timer-btn, #stop-timer-btn {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

#play-timer-btn:active, #pause-timer-btn:active, #stop-timer-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.timer-buttons-container .icon {
    width: 28px;
    height: 28px;
}

#play-timer-btn { background-color: var(--success-color); border-color: #28b867; }
#pause-timer-btn { background-color: var(--warning-color); color: white; border-color: #e08e0b; }
#stop-timer-btn { background-color: var(--danger-color); color: white; border-color: #c02a2a; }


.total-display {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
}


/* --- ESTILOS PARA TELA DE REGISTO --- */
.summary-card-title {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-light-color);
    margin-bottom: 4px;
}
.summary-card-value {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.1;
}
#total-hours-display { /* Sobrescreve estilo genérico */
    font-size: 2.2em;
    font-weight: 700;
    line-height: 1.1;
}
.summary-card-footer {
    font-size: 0.8em;
    color: var(--danger-color);
    margin-top: 4px;
    font-style: italic;
    font-weight: 600;
}
.add-button-top-right {
    position: absolute;
    top: 8px;
    right: 8px;
}
.add-button-top-right .add-button-round {
    width: 44px;
    height: 44px;
    line-height: 44px;
    font-size: 1.8em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* --- Barra de Progresso --- */
.progress-bar-container {
    width: 100%;
    background-color: rgba(0,0,0,0.1);
    border-radius: 20px;
    margin-top: 15px;
    height: 28px;
    overflow: hidden;
    position: relative;
}
.progress-bar-value {
    height: 100%;
    width: 0%; /* Controlado por JS */
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-primary-color);
    font-weight: bold;
    font-size: 0.9em;
    transition: width 0.5s ease-out, background-color 0.5s ease-out;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}
.progress-bar-value.red { background-color: var(--danger-color); }
.progress-bar-value.yellow { background-color: var(--warning-color); }
.progress-bar-value.blue { background-color: var(--info-color); }
.progress-bar-value.green { background-color: var(--success-color); }

/* --- ESTATÍSTICAS E TOTAIS --- */
.total-stats-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-radius: var(--border-radius);
    width: 100%;
}

.total-stats-container.centered-stats { justify-content: center; gap: 8px; }
.total-stats-label { font-weight: bold; margin: 0; }
.total-stats-value { font-size: 1.2em; font-weight: bold; color: var(--primary-color); margin: 0; }

/* --- LISTAS --- */
.styled-list {
    list-style-type: none;
    padding: 0;
    width: 100%;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 5px;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.list-item:last-child {
    border-bottom: none;
}

.item-details { flex-grow: 1; text-align: left;}
.item-actions { display: flex; align-items: center; gap: 5px; }


/* --- CALENDÁRIO --- */
.calendar-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    margin-bottom: 0px;
    width: 100%;
}

.calendar-controls select {
    border: none;
    background-color: transparent;
    font-size: 1.1em;
    font-weight: 600;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    text-align: center;
    color: var(--text-color);
}

#calendar-swipe-area {
    width: 100%;
    overflow-x: hidden;
    touch-action: pan-y;
}

#calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    width: 100%;
}

.calendar-day-header {
    font-weight: bold;
    color: var(--text-light-color);
    padding-bottom: 10px;
    font-size: 0.9em;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    aspect-ratio: 1 / 1.5;
    transition: background-color 0.2s;
    overflow: hidden;
}

.calendar-day:hover { background-color: var(--background-color); }
.calendar-day.current-day { border-color: var(--primary-color); border-width: 2px; }

.day-number {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 2px;
}

.planned-hours {
    font-size: 0.65em;
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 2px;
    line-height: 0.6;
}

.event-icon {
    font-size: 0.8em;
    margin-top: 4px;
}

/* --- MODAIS --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

.modal-flex-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
}

.close-button-modal {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    font-size: 1.8em;
    font-weight: bold;
    color: var(--text-light-color);
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    line-height: 32px;
    text-align: center;
    padding: 0;
    transition: background-color 0.2s, color 0.2s;
    z-index: 10;
}
.close-button-modal:hover {
    background-color: var(--background-color);
    color: var(--text-color);
}

.modal-button-group {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.modal-button-group.single-button-group { justify-content: center; }

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- REVISITAS E ESTUDANTES (NOVOS ESTILOS) --- */
.details-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    justify-content: center;
}

.back-button {
    position: absolute;
    left: 0;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-color);
    padding: 5px;
    width: auto;
}

.details-header h2 {
    margin: 0;
}

.summary-list {
    list-style-type: none;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-list li {
    background-color: var(--surface-color);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.summary-list .item-info {
    text-align: left;
    cursor: pointer;
}

.summary-list .item-info h4 {
    margin: 0 0 5px 0;
    color: var(--primary-color);
    text-align: left;
    font-size: 1.1em;
}

.summary-list .item-info p {
    font-size: 0.9em;
    color: var(--text-light-color);
    margin: 0;
}

.summary-list .action-btn-small {
    padding: 8px;
    font-size: 1.2em;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    color: var(--text-light-color);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}
.summary-list .action-btn-small img {
    width: 20px;
    height: 20px;
}
.summary-list .action-btn-small:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}
.summary-list .action-btn-small.delete:hover {
    background-color: var(--danger-color);
    color: white;
}


.actions-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    background-color: var(--background-color);
    padding: 10px;
    border-radius: var(--border-radius);
}

.toolbar-button {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-light-color);
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-round);
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    text-decoration: none;
}

.toolbar-button:hover {
    background-color: var(--primary-color);
    color: var(--text-on-primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.toolbar-button img {
    width: 24px;
    height: 24px;
}

.details-section p { margin-bottom: 5px; text-align: left; }
.checklist-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; width: 100%; }
.checklist-item input[type="checkbox"], .checklist-item input[type="date"] { width: auto; }

/* --- RELATÓRIO --- */
.report-selectors { display: flex; gap: 15px; justify-content: center; width: 100%; }
.report-results { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.report-item { padding: 10px; background-color: var(--background-color); border-radius: var(--border-radius); display: flex; justify-content: center; align-items: center; text-align: center; }
.report-item-text { margin: 0; font-size: 1.1em; }
.report-item .value { font-weight: bold; color: var(--primary-color); }

.stylish-whatsapp-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #00A884;
    margin-top: 20px;
    width: 100%;
}

.stylish-whatsapp-button:hover { background-color: #128C7E; }
.whatsapp-icon-button { width: 24px; height: 24px; }

/* --- TOAST (Notificação) --- */
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: var(--border-radius);
    padding: 16px;
    position: fixed;
    z-index: 2000;
    left: 50%;
    transform: translateX(-50%);
    bottom: 90px;
    font-size: 1em;
    opacity: 0;
    transition: all 0.5s;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 100px;
}

/* --- RESUMO DIÁRIO --- */
.list-container {
    list-style: none;
    padding: 0;
    width: 100%;
}

.list-container .list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 10px;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    margin-bottom: 10px;
}

.event-today {
    border-left: 4px solid var(--accent-color);
}

.details-section p, .details-section span {
    white-space: normal !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
}

#plan-screen-menu .total-display {
    font-size: 1.1em;
    font-weight: 500;
    color: var(--text-light-color);
    margin-bottom: 0;
}

#plan-screen-menu .total-display span {
    font-weight: bold;
    color: var(--primary-color);
}

.centered-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    width: 100%;
}

/* ANIMAÇÕES DE TRANSIÇÃO DE ECRÃ */
main {
    flex-grow: 1;
    position: relative;
    overflow-x: hidden;
}

@keyframes slideInFromRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideInFromLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes slideOutToLeft { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes slideOutToRight { from { transform: translateX(0); } to { transform: translateX(100%); } }

.slide-in-from-right { animation: slideInFromRight 0.3s ease-out forwards; }
.slide-in-from-left  { animation: slideInFromLeft 0.3s ease-out forwards; }
.slide-out-to-left   { animation: slideOutToLeft 0.3s ease-out forwards; }
.slide-out-to-right  { animation: slideOutToRight 0.3s ease-out forwards; }

#settings-screen-menu .link-button {
    border: 1px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    transition: all 0.2s ease-in-out;
}

#settings-screen-menu .link-button:hover {
    background-color: var(--primary-color);
    color: var(--text-on-primary-color);
}

#settings-screen-menu .page-section {
    gap: 8px;
}

#settings-profile-select, #revisit-select, #student-select {
    color: var(--primary-color);
    font-weight: bold;
    text-align: center;
    border-color: var(--primary-color);
    padding: 12px;
}

#revisits-count, #students-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    height: 35px;
    padding: 2px;
    margin-left: 8px;
    font-size: 0.8em;
    font-weight: bold;
    background-color: var(--primary-color);
    color: var(--text-on-primary-color);
    border-radius: 50%;
}

#publicador-options.page-section {
    gap: 15px;
}

#publicador-options p {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-color);
}

.item-details-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hour-entry-date {
    font-weight: bold;
    color: var(--text-color);
}

.hour-entry-time {
    color: var(--text-light-color);
}

.item-actions .link-button {
    padding: 6px;
}

#plan-screen-menu .button-group-vertical {
    flex-direction: row;
    gap: 8px;
}

#plan-screen-menu .button-group-vertical .action-button {
    background-color: var(--primary-color);
    color: var(--text-on-primary-color);
    border: none;
    padding: 8px 10px;
    font-size: 0.8em;
    font-weight: 600;
    transition: background-color 0.2s ease-in-out;
}

#plan-screen-menu .button-group-vertical .red-button {
    background-color: var(--danger-color);
    color: var(--text-on-primary-color);
}

#plan-screen-menu .button-group-vertical .action-button:hover {
    background-color: var(--primary-dark-color);
}

#plan-screen-menu .button-group-vertical .red-button:hover {
    background-color: #b71c1c;
}

.modal-button-group .action-button {
    margin-left: auto;
    order: 2;
    width: auto;
    min-width: 120px;
}

.modal-button-group.single-button-group .action-button {
    margin-left: initial;
}

/* Centraliza o texto "Perfil" no menu Definições */
#settings-screen-menu .profile-selection label {
    text-align: center;
}

/* Novos estilos para alinhar texto e botões na mesma linha */
.summary-list .item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
}

.summary-list .item-footer p {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-light-color);
}

.summary-list .item-actions-inline {
    display: flex; /* Alinha os botões na horizontal */
    gap: 8px;      /* Adiciona um espaço entre eles */
}

/* --- ESTILOS PARA O ÍCONE DE MOSTRAR/OCULTAR SENHA --- */
.input-group.with-icon {
    position: relative;
}
.input-group.with-icon input {
    padding-right: 45px;
}
.toggle-visibility-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light-color);
    font-size: 1.3em;
    user-select: none;
}

/* --- ESTILOS PARA O INTERRUPTOR DE NOTIFICAÇÕES (SETTINGS) --- */
.settings-item-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.settings-item-toggle label {
    margin-bottom: 0;
    font-weight: 600;
    color: var(--text-color);
    text-align: left;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* --- EFEITO CÔNCAVO UNIVERSAL PARA TODOS OS CARDS DA APLICAÇÃO --- */
.page-section:not(#pioneiro-options),
.summary-list li,
#pioneiro-options > div {
    background: var(--background-color);
    border-radius: 20px;
    border: none;
    padding: 20px;
    box-shadow: inset 5px 5px 10px rgba(0, 0, 0, 0.1),
                inset -5px -5px 10px rgba(255, 255, 255, 0.7);
    transition: box-shadow 0.3s ease;
    position: relative;
}

/* --- Espaçamento vertical FORÇADO para os cards do menu Registo --- */
#pioneiro-options > *:not(:last-child) {
    margin-bottom: 20px;
}

/* Estilos para o cabeçalho da sub-página de histórico */
#hours-history-screen .details-header {
    margin-bottom: 20px;
}

/* Centraliza o texto no campo de telefone do relatório */
#report-contact-phone {
    text-align: center;
    font-size: 1.2em; /* Opcional: aumenta um pouco o tamanho do texto */
}

label[for="report-contact-phone"] {
    text-align: center;
}