@font-face {
    font-family: 'BBHSansHegarty';
    src: url('./fonts/BBHSansHegarty-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

html,
body {
    overflow: hidden;
}

body {
    font-family: 'Lora', serif;
    color: #212121;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    line-height: 1.6;
}

#backgroundCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #242938;
}

.screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px 20px;
    box-sizing: border-box;
}

.hero-section {
    background-color: transparent;
    flex-direction: column;
    justify-content: space-between;
    color: #fcfcfc;
    padding: 30px 20px;
    position: relative;
}

.main-header {
    width: 100%;
    text-align: center;
    padding-bottom: 20px;
}

.logo {
    font-family: 'BBHSansHegarty', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 0.1em;
    font-weight: normal;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    text-align: center;
}

.main-title {
    font-family: 'BBHSansHegarty', sans-serif;
    font-size: 6rem;
    font-weight: normal;
    margin: 0;
    line-height: 1;
    letter-spacing: 0.2em;
    color: #cccccc;
}

.subtitle {
    font-family: 'Lora', serif;
    font-size: 1.5rem;
    font-weight: 400;
    max-width: 400px;
    margin-top: 20px;
    color: #cccccc;
}

.scroll-down-button {
    background-color: #3b578c;
    border: none;
    border-radius: 50%;
    width: 75px;
    height: 75px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 50px;
    margin-bottom: 30px;
    transition: background-color 0.3s, transform 0.3s;
}

.scroll-down-button:hover {
    background-color: #4a6aa7;
    transform: translateY(5px);
}

.arrow-icon {
    font-size: 2rem;
    color: white;
}

.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #fcfcfc;
    border-bottom: 1px solid #eeeeee;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
}

.fixed-header.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-logo {
    font-family: 'BBHSansHegarty', sans-serif;
    font-size: 1.2rem;
    font-weight: normal;
    color: #242938;
}

.close-button {
    background: none;
    border: none;
    font-family: 'BBHSansHegarty', sans-serif;
    font-size: 1.8rem;
    color: #242938;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin: 0;
    transition: color 0.2s;
}

.close-button:hover {
    color: #dc3545;
}

.container {
    background-color: #fff;
    padding: 40px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    max-width: 1100px;
    width: 100%;
    box-sizing: border-box;
}

h1 {
    font-family: 'BBHSansHegarty', sans-serif;
    font-size: 2.2rem;
    font-weight: normal;
    text-align: center;
    color: #333;
    margin: 0 0 40px 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.card {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    box-sizing: border-box;
}

.card h2 {
    font-family: 'Lora', serif;
    color: #333;
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 10px;
}

.timer {
    font-family: 'BBHSansHegarty', sans-serif;
    font-size: 4rem;
    font-weight: normal;
    color: #007bff;
    margin: 10px 0 20px 0;
    line-height: 1.1;
}

.recompensa .timer {
    color: #28a745;
}

.botoes-acao {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.action-bar {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.action-bar.centered {
    justify-content: center;
}

.action-bar.right-aligned {
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.3s;
    border: 2px solid transparent;
    font-family: 'Lora', serif;
}

.btn-primary {
    color: white;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0056b3;
}

.btn-secondary {
    color: #5a6268;
    background-color: transparent;
    border-color: #ced4da;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #f1f1f1;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto minmax(500px, auto);
    gap: 40px;
}

.grid-container h1 {
    grid-column: 1 / -1;
}

.items-panel {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background-color: #fdfdfd;
    min-width: 0;
}

.panel-title {
    font-family: 'BBHSansHegarty', sans-serif;
    font-size: 1.5rem;
    color: #242938;
    margin-bottom: 15px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    text-align: center;
}

.list-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px;
    max-height: 400px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #fff;
    margin-bottom: 10px;
    font-family: 'Lora', serif;
    font-size: 1em;
}

.item-name {
    font-weight: 600;
    flex-grow: 1;
    margin-right: 10px;
    border: none;
    background: transparent;
    padding: 5px;
}

.item-name:focus {
    outline: none;
    background-color: #f0f8ff;
}


.item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-weight {
    width: 45px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'BBHSansHegarty', sans-serif;
}

.btn-move,
.btn-delete {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-move {
    color: #333;
}

.btn-move:hover,
.btn-delete:hover {
    background-color: #e0e0e0;
}

.btn-delete {
    color: #dc3545;
}

.btn-select-today {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background-color: #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
    flex-shrink: 0;
}

.btn-select-today:hover {
    background-color: #e0e0e0;
}

.btn-select-today.selected {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-select-today.selected::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 10px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.add-item-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

#new-item-name {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.add-item-form .btn-primary {
    flex-shrink: 0;
}

.vertical-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.input-group {
    margin: 20px 0;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

#total-hours {
    padding: 10px;
    font-size: 1.8rem;
    font-family: 'BBHSansHegarty', sans-serif;
    width: 100px;
    text-align: center;
    border: 2px solid #007bff;
    border-radius: 4px;
}

.calculation-summary {
    width: 100%;
    max-width: 400px;
}

.info-text,
.placeholder-text {
    font-style: italic;
    color: #666;
    margin-top: 10px;
    font-size: 0.9em;
}

.execution-grid-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr auto;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
}

.execution-panel-left {
    grid-column: 1;
    grid-row: 1;
}

.execution-panel-right {
    grid-column: 2;
    grid-row: 1;
}

.execution-panel-right .items-panel {
    height: 100%;
}

.action-bar-footer {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    justify-content: center;
}

.study-details p {
    margin: 8px 0;
}

.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 20px;
    background-color: #28a745;
    transition: width 0.5s ease-in-out;
}

.execution-today-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #fff;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.execution-today-item:hover {
    background-color: #f0f8ff;
}

.execution-today-item.selected {
    background-color: #e6f3ff;
    border-left: 5px solid #007bff;
}

.execution-today-item h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

.execution-today-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

.time-input-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.time-input-container input {
    padding: 10px;
    font-size: 1.8rem;
    font-family: 'BBHSansHegarty', sans-serif;
    width: 100px;
    text-align: center;
    border: 2px solid #007bff;
    border-radius: 4px;
}

.time-input-container input::-webkit-outer-spin-button,
.time-input-container input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.time-input-container span {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    padding-bottom: 5px;
}

#screen-2 .container {
    max-width: 800px;
}

#calculated-times-list {
    max-height: 300px;  
    overflow-y: auto;    
    text-align: left;   
    padding-left: 20px;  
    padding-right: 10px;
    margin-top: 15px;   
}

#screen-3 .container {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    
    /* Escondido por padrão */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    font-family: 'Lora', serif;
    color: #333;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.is-visible .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    font-family: 'BBHSansHegarty', sans-serif;
    margin-top: 0;
    font-size: 1.8rem;
}

.modal-content p {
    font-size: 1.1rem;
    margin: 15px 0 25px 0;
}

@media (max-width: 768px) {

    html,
    body {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .screen {
        min-height: auto;
        padding: 60px 20px 80px 20px;
    }

    .hero-section#screen-1 {
        height: 100vh;
        min-height: 100vh;
        padding: 30px 20px;
    }

    .container {
        padding: 20px;
    }

    .main-title {
        font-size: 3.5rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .timer {
        font-size: 3rem;
    }

    .grid-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 30px;
    }

    .execution-grid-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 30px;
        max-width: 100%;
    }

    .execution-panel-right {
        grid-row: 1;
        grid-column: 1;
        height: auto;
    }

    .execution-panel-left {
        grid-row: 2;
        grid-column: 1;
    }

    .action-bar-footer {
        grid-row: 3;
        grid-column: 1;
        justify-content: center;
    }

    .action-bar.centered,
    .action-bar.right-aligned {
        justify-content: space-between;
    }

    .action-bar .btn-primary,
    .action-bar .btn-secondary {
        flex-grow: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .main-title {
        font-size: 2.8rem;
    }

    .timer {
        font-size: 2.5rem;
    }

    .time-input-container input {
        width: 80px;
        font-size: 1.5rem;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .item-name {
        width: 100%;
        margin-right: 0;
        box-sizing: border-box;
    }

    .item-controls {
        width: 100%;
        justify-content: space-between;
    }
}