* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

:root {
    --theme-color: #1565c0;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

body {
    background-color: #f0f2f5;
    color: #333;
    min-height: 100vh;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #1a1a1a;
    color: #ffffff;
}

body.dark-mode header {
    background-color: #2d2d2d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.dark-mode main {
    background-color: #000000;
}

body.dark-mode footer {
    background-color: #000000;
    color: #cccccc;
}

body.dark-mode .date,
body.dark-mode .timezone {
    color: #cccccc;
}

body.dark-mode .nav-links a {
    color: #cccccc;
}

body.dark-mode .settings-icon {
    color: #cccccc;
}

body.fullscreen-mode .frase-acoes {
    display: none;
}

@font-face {
    font-family: 'DS-Digital';
    src: url('fonts/DSEG7ClassicRegular.woff') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body.digital-font .time,
body.digital-font .time *,
body.digital-font .chronometer-display,
body.digital-font .chronometer-display *,
body.digital-font .timer-display {
    font-family: 'DS-Digital', 'Courier New', monospace !important;
    font-weight: normal;
    font-style: normal;
}

body.black-white {
    filter: grayscale(100%) !important;
}

header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    flex-shrink: 0;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 400;
    font-style: normal;
    color: var(--theme-color);
    font-family: "Audiowide", sans-serif;
}

.logo .zen {
    font-family: "Audiowide", sans-serif;
}

.logo .ticker {
    font-family: "Audiowide", sans-serif;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-links a {
    text-decoration: none;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.nav-links a.active {
    background-color: var(--theme-color);
    color: white;
}

.settings-icon {
    cursor: pointer;
    font-size: 1.5rem;
    color: #666;
}

main {
    margin: 0;
    padding: 0;
    background-color: white;
    width: 100%;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.view {
    padding: 0;
    min-height: calc(100vh - 60px);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.hidden {
    display: none;
}

.digital-clock {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 500;
    box-sizing: border-box;
    font-size: clamp(10px, 4vmin, 80px);
    /* Base para todos os filhos */
}

.time {
    font-size: 360%;
    font-weight: normal;
    color: var(--theme-color);
    display: flex;
    flex-direction: row;
    align-items: baseline;
    text-align: left;
    font-family: 'Arial', sans-serif;
    max-width: 100%;
    overflow: visible;
    transition: color 0.3s;
    line-height: 1.2;
}

.time-period {
    font-size: 40%;
    font-weight: normal;
    margin-left: 10px;
}

.date {
    font-size: 80%;
    color: #666;
    margin: 0.5rem 0;
    max-width: 100%;
    overflow: visible;
    line-height: 2.0;
}

.timezone {
    font-size: 60%;
    color: #999;
    max-width: 100%;
    overflow: visible;
    line-height: 1.0;
}

.motivational-text {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 140%;
    color: var(--theme-color);
    margin-top: clamp(1rem, 3vw, 6rem);
    text-align: center;
    max-width: 80%;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: visible;
    line-height: 1.4;
    white-space: normal;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.motivational-text.visible {
    opacity: 1;
}

/* Estilo para a caixa de seleção */
.quote-type-select {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--theme-color);
    padding: 5px;
    font-size: 1rem;
    cursor: pointer;
}

/* Destaca a opção selecionada */
.quote-type-select option.selected-quote {
    background-color: var(--theme-color);
    color: #fff;
    /* Contraste para legibilidade */
}

/* Garante que a opção selecionada tenha destaque ao abrir o select */
.quote-type-select option:checked {
    background-color: var(--theme-color);
    color: #fff;
}

/* Para navegadores que suportam estilização de option */
.quote-type-select option:hover {
    background-color: var(--theme-color);
    color: #fff;
}

.quote-type-select:focus {
    outline: none;
    border-color: var(--theme-color);
}

body.dark-mode .quote-type-select {
    background-color: #2a2a2a;
    border-color: #666;
}

/* Estilo para opções com ícones */
.quote-type-select option {
    padding-left: 20px;
    /* Espaço para o ícone */
    background-repeat: no-repeat;
    background-position: left center;
}

/* Estilo para a referência da citação */
.motivational-reference {
    font-family: 'Cinzel', serif;
    font-style: italic;
    font-size: 80%;
    /* Menor que a frase principal */
    color: #999;
    /* Cor clara para não ofuscar */
    margin-top: 0.5rem;
    text-align: center;
    max-width: 80%;
    line-height: 1.4;
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
}

.motivational-reference.visible {
    opacity: 1;
}

body.dark-mode .motivational-reference {
    color: #cccccc;
}

.chronometer {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 500;
    box-sizing: border-box;
    font-size: clamp(10px, 4vmin, 80px);
}

.chronometer-display {
    margin-bottom: 2rem;
    color: var(--theme-color);
    max-width: 100%;
    overflow: visible;
}

.chronometer-display .main-time {
    font-size: 360%;
    line-height: 1.2;
}

.chronometer-display .tenths {
    font-size: 175%;
    line-height: 1.2;
}

.chronometer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.chronometer-controls button {
    padding: 0.5rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    color: white;
    min-width: 48px;
    min-height: 48px;
}

.start-btn {
    background-color: #4caf50;
}

.start-btn:hover {
    background-color: #388e3c;
}

.stop-btn {
    background-color: #f44336;
}

.stop-btn:hover {
    background-color: #d32f2f;
}

.reset-btn {
    background-color: #8d6e63;
}

.reset-btn:hover {
    background-color: #6d4c41;
}

.lap-btn {
    background-color: #2196f3;
}

.lap-btn:hover {
    background-color: #1976d2;
}

.laps-table {
    width: 100%;
    max-width: 400px;
    color: var(--theme-color);
    font-size: clamp(10px, 4vmin, 16px);
}

.laps-header {
    display: flex;
    justify-content: space-between;
    padding-top: 1.0rem;
    padding-bottom: 1.0rem;
    border-bottom: 1px solid #444;
    font-weight: bold;
}

.laps-header span {
    flex: 1;
    text-align: center;
    font-size: large;
    font-size: 120%;
}

.laps-list {
    line-height: 1.2;
}

.laps-list div {
    display: flex;
    justify-content: space-between;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #333;
}

.laps-list div span {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-style: normal;
    font-size: 18px;
    font-family: 'DS-Digital', 'Courier New', monospace !important;
}

.timer {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 500;
    box-sizing: border-box;
    font-size: clamp(10px, 4vmin, 80px);
}

.timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.timer-controls input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 1.2rem;
}

.timer-buttons {
    display: flex;
    gap: 1rem;
    padding-top: 10px;
    justify-content: center;
    margin-bottom: 1rem;
}

.timer-buttons button {
    min-width: 48px;
    min-height: 48px;
}

.timer-display {
    font-size: 360%;
    font-weight: bold;
    color: var(--theme-color);
    padding-bottom: 30px;
    max-width: 100%;
    overflow: visible;
    line-height: 1.2;
}

.settings-panel {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    max-width: 100vw;
    height: 100%;
    background-color: #2e2e2e;
    z-index: 1000;
    transition: right 0.3s ease;
}

.settings-panel.open {
    right: 0;
}

.content.ticket-content {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #eee;
    padding: 10px 20px 30px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

.ticket-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #eee;
}

.form-group.options .field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group.options label {
    color: #eee;
}

.pull-right {
    display: flex;
    align-items: center;
}

.switch-button {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch-button input {
    display: none;
}

.switch-button span {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.4s;
}

.switch-button .switch-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
}

.switch-button span:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
}

.switch-button input:checked+span {
    background-color: var(--theme-color);
}

.switch-button input:checked+span:before {
    transform: translateX(26px);
}

.switch-button-sm {
    width: 40px;
    height: 20px;
}

.switch-button-sm span:before {
    height: 16px;
    width: 16px;
}

.panel-colors {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    line-height: 1.6;
    color: #eee;
    box-sizing: border-box;
    font-size: 0;
    margin-left: -4px;
    margin-top: 1px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-digit-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, border 0.2s;
    position: relative;
    display: inline-block;
    border: 2px solid transparent;
}

.btn-digit-color::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: currentColor;
}

.btn-digit-color.selected {
    border-color: #fff;
    transform: scale(1.1);
}

.btn-digit-color:hover {
    transform: scale(1.1);
}

.btn.btn-primary {
    width: 100%;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    background-color: var(--theme-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 1rem;
    min-height: 48px;
}

.btn.btn-primary:hover {
    opacity: 0.9;
}

button {
    padding: 0.5rem 2rem;
    border: none;
    border-radius: 4px;
    background-color: var(--theme-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    min-width: 48px;
    min-height: 48px;
}

button:hover {
    opacity: 0.9;
}

footer {
    text-align: center;
    padding: 0.5rem;
    color: #666;
    background-color: white;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    flex-shrink: 0;
}

.form-group.options select {
    padding: 0.3rem;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #3a3a3a;
    color: #eee;
    font-size: 0.9rem;
    width: 120px;
    cursor: pointer;
}

.form-group.options select:focus {
    outline: none;
    border-color: var(--theme-color);
}

.floating-menu-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    margin: 0;
    padding: 0;
    background-color: var(--theme-color);
    color: white;
    border: none;
    border-radius: 16%;
    width: 20px;
    /* Menor */
    height: 20px;
    /* Menor */
    font-size: 1.2rem;
    display: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, transform 0.2s;
}

.floating-menu-btn:hover {
    opacity: 0.9;
    transform: scale(1.1);
}

/* Estilos para a página Sobre */
.about-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    min-height: calc(100vh - 60px);
}

.about-section h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: var(--theme-color);
    margin-bottom: 0.5rem;
    font-family: 'Audiowide', serif;
    font-weight: 600;
}

.about-text {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: #333;
    line-height: 1.6;
    margin-bottom: 1rem;
}

body.dark-mode .about-text {
    color: #cccccc;
}

.about-icon {
    margin: 1rem 0;
}

.about-section .btn-primary {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    background-color: var(--theme-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.about-section .btn-primary:hover {
    opacity: 0.9;
}

/* Estilos para a seção de missão */
.mission-section {
    margin: 2rem 0;
    text-align: center;
}

.mission-section h2 {
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: var(--theme-color);
    font-family: 'Audiowide', serif;
    font-weight: 600;
    margin-bottom: 1rem;
}

.mission-section p {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: #333;
    line-height: 1.6;
}

body.dark-mode .mission-section p {
    color: #cccccc;
}

/* Estilos para o Menu Mobile */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    /* Começa fora da tela */
    width: 250px;
    height: 100%;
    background-color: #2e2e2e;
    /* Fundo escuro */
    color: #eee;
    z-index: 1100;
    /* Acima de outros elementos */
    transition: left 0.3s ease;
    display: none;
    /* Escondido por padrão */
}

.mobile-menu.open {
    left: 0;
    /* Aparece na tela */
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-header .logo {
    font-size: 1.5rem;
    color: var(--theme-color);
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #eee;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-content {
    padding: 1rem;
}

.mobile-nav-links {
    list-style: none;
}

.mobile-nav-links li {
    margin: 0.5rem 0;
}

.mobile-nav-links a {
    display: block;
    text-decoration: none;
    color: #eee;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.mobile-nav-links a.active,
.mobile-nav-links a:hover {
    background-color: var(--theme-color);
    color: white;
}

.mobile-menu-actions {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-dark-mode,
.mobile-settings {
    background: none;
    border: 1px solid #eee;
    color: #eee;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.mobile-dark-mode:hover,
.mobile-settings:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Ajustes para Modo Escuro */
body.dark-mode .mobile-menu {
    background-color: #1a1a1a;
}

body.dark-mode .mobile-nav-links a {
    color: #cccccc;
}

body.dark-mode .mobile-dark-mode,
body.dark-mode .mobile-settings {
    color: #cccccc;
    border-color: #cccccc;
}

.music-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--theme-color, #007bff);
    color: white;
    border: none;
    border-radius: 16%;
    width: 20px;
    height: 20px;
    font-size: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: background 0.3s;
}

.music-btn:hover {
    background: var(--theme-color-hover, #0056b3);
}

.fullscreen-mode .music-btn {
    display: none;
    /* Oculta em tela cheia */
}

/* Media Queries para Responsividade */
@media (max-width: 600px) {

    header,
    footer {
        display: none !important;
        /* Nunca exibir header/footer em telas pequenas */
    }

    .floating-menu-btn {
        display: block;
    }

    .mobile-menu {
        display: block;
    }

    .view {
        min-height: 100vh;
        height: 100vh;
    }

    .digital-clock,
    .chronometer,
    .timer {
        padding: 0.5rem;
    }

    .nav-links a {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .about-section {
        padding: 1rem;
        min-height: 100vh;
    }

    .about-section h1 {
        font-size: clamp(1.2rem, 4vw, 2rem);
    }

    .about-text {
        font-size: clamp(0.8rem, 1.8vw, 1rem);
    }

    .mission-section {
        margin: 1rem 0;
    }

    .mission-section h2 {
        font-size: clamp(1rem, 3.5vw, 1.5rem);
    }

    .mission-section p {
        font-size: clamp(0.8rem, 1.8vw, 1rem);
    }

    .music-btn {
        bottom: 60px;
        /* Evita sobreposição com .floating-menu-btn */
    }
}

/* Garantir que o menu e botão flutuante sejam ocultos no modo Fullscreen */
body.fullscreen-mode header,
body.fullscreen-mode footer,
body.fullscreen-mode .floating-menu-btn,
body.fullscreen-mode .mobile-menu {
    display: none !important;
}

/* Estilo para a lista de músicas no painel de configurações */
.music-list {
    max-height: 300px;
    width: 260px;
    overflow-y: auto;
    /* Roloagem vertical se necessário */
    overflow-x: hidden;
    /* Impede rolagem horizontal */
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: #3a3a3a;
    box-sizing: border-box;
    /* Garante que padding não aumente o tamanho */
}

body.dark-mode .music-list {
    background: #2a2a2a;
    width: 260px;
}

.music-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    /* Contém o ::before para evitar overflow */
    box-sizing: border-box;
}

.music-list-item:last-child {
    border-bottom: none;
}

.music-list-item input[type="checkbox"] {
    margin-right: 0.5rem;
}

.music-list-item label {
    flex-grow: 1;
    color: #eee;
    font-size: 0.9rem;
    word-break: break-word;
    /* Evita overflow horizontal por labels longas */
}

.music-list-item .preview-btn {
    background: transparent;
    /* Fundo transparente */
    border: none;
    /* Remove borda */
    color: #eee;
    padding: 0;
    /* Remove padding */
    margin: 0;
    /* Remove margens */
    cursor: pointer;
    font-size: 1.0rem;
    /* Tamanho do ícone (~16px) */
    line-height: 1;
    /* Evita espaçamento vertical */
    width: 26px;
    /* Área do ícone */
    height: 26px;
    /* Área do ícone */
    min-width: 0;
    /* Remove tamanho mínimo padrão */
    min-height: 0;
    /* Remove tamanho mínimo padrão */
    display: inline-block;
    text-align: center;
    transition: color 0.3s;
    /* Transição suave para hover */
    position: relative;
    /* Para ::before */
}

.music-list-item .preview-btn::before {
    content: '';
    position: absolute;
    top: -3px;
    /* Reduzido para minimizar overflow */
    left: -3px;
    right: -3px;
    bottom: -3px;
    z-index: -1;
    /* Evita interferência visual */
}

.music-list-item .preview-btn:hover {
    color: var(--theme-color, #007bff);
    /* Cor do tema no hover */
}

body.dark-mode .music-list-item label,
body.dark-mode .music-list-item .preview-btn {
    color: #cccccc;
}

body.dark-mode .music-list-item .preview-btn:hover {
    color: var(--theme-color, #007bff);
}

.about-view {
    width: 100%;
    height: calc(100vh - 60px); /* Ajuste conforme a altura do seu menu */
    overflow: auto;
}