* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;

    min-height: 100vh;

    background: #160d24;
    color: #ffffff;

    font-family: Arial, Helvetica, sans-serif;
}


/* APP */

.app {
    width: 100%;
    max-width: 1200px;

    margin: 0 auto;

    padding: 50px 40px 60px;
}


/* HEADER */

.header {
    text-align: center;
    margin-bottom: 45px;
}

.header h1 {
    margin: 0;

    font-size: 32px;
    font-weight: 500;

    letter-spacing: -1px;
}


/* TOTALE */

.total-section {
    margin-bottom: 50px;

    padding: 28px 32px;

    border: 1px solid #3b2850;
    border-radius: 16px;

    background: #1d1230;
}

.total-header {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 30px;
}

.total-section h2 {
    margin: 0 0 8px;

    font-size: 13px;
    font-weight: 600;

    letter-spacing: 2px;
}

.total-section p {
    margin: 0;

    font-size: 12px;

    color: #a99ab8;
}

.total-section .project-time {
    font-size: 42px;
}


/* DASHBOARD PRINCIPALE */

.main-dashboard {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 50px;

    align-items: start;

    margin-bottom: 55px;
}


/* WEEKLY PROGRESS */

.dashboard-section {
    padding: 30px;

    border: 1px solid #3b2850;
    border-radius: 16px;

    background: #1d1230;
}

.dashboard-section h2 {
    margin: 0 0 30px;

    font-size: 16px;
    font-weight: 500;

    letter-spacing: 1px;
}

.progress-card {
    margin-bottom: 28px;
}

.progress-card:last-child {
    margin-bottom: 0;
}

.progress-header {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 20px;

    margin-bottom: 10px;

    font-size: 13px;
}

.progress-header span:last-child {
    text-align: right;

    font-size: 12px;

    color: #b8a9c7;
}

.progress-bar {
    width: 100%;
    height: 10px;

    overflow: hidden;

    background: #342341;

    border-radius: 999px;
}

.progress-fill {
    width: 0%;
    height: 100%;

    background: #ffffff;

    border-radius: 999px;

    transition: width 0.3s ease;
}


/* TRACKER */

.tracker-section {
    display: flex;

    flex-direction: column;

    gap: 18px;
}


/* PROGETTI */

.project {
    padding: 28px;

    border: 1px solid #3b2850;
    border-radius: 16px;

    background: #1d1230;
}

.project-header {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    gap: 20px;
}

.project h2 {
    margin: 0 0 7px;

    font-size: 13px;
    font-weight: 600;

    letter-spacing: 1.5px;
}

.project p {
    margin: 0;

    font-size: 12px;

    color: #a99ab8;
}

.project-time {
    font-size: 25px;

    white-space: nowrap;

    letter-spacing: -1px;
}


/* TIMER */

.timer-button {
    width: 100%;

    margin-top: 25px;

    padding: 14px;

    border: 1px solid #705687;
    border-radius: 8px;

    background: transparent;

    color: #ffffff;

    font-size: 12px;
    letter-spacing: 2px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.timer-button:hover {
    background: #ffffff;

    border-color: #ffffff;

    color: #160d24;
}

.timer-button.running {
    background: #ffffff;

    border-color: #ffffff;

    color: #160d24;
}


/* ADD TIME */

.manual-section {
    padding: 0;
}

.manual-button {
    width: 100%;

    padding: 16px;

    border: 1px solid #3b2850;
    border-radius: 12px;

    background: #1d1230;

    color: #c9bbd5;

    font-size: 12px;
    letter-spacing: 1.5px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.manual-button:hover {
    background: #29193d;

    color: #ffffff;
}


/* HISTORY */

.history-section {
    width: 100%;

    margin-top: 0;
    margin-bottom: 45px;
}

.history-section h2 {
    margin: 0 0 18px;

    font-size: 16px;
    font-weight: 500;

    letter-spacing: 1px;
}

.history-table-container {
    width: 100%;

    overflow-x: auto;

    border: 1px solid #3b2850;
    border-radius: 16px;

    background: #1d1230;
}

.history-table {
    width: 100%;

    border-collapse: collapse;

    font-size: 13px;

    min-width: 700px;
}

.history-table th {
    padding: 15px 16px;

    text-align: left;

    font-weight: 600;

    color: #c9bbd5;

    border-bottom: 1px solid #3b2850;

    white-space: nowrap;
}

.history-table td {
    padding: 15px 16px;

    border-bottom: 1px solid #2c1c3b;

    white-space: nowrap;
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

.history-table tbody tr:hover {
    background: #241636;
}

.empty-history {
    text-align: center;

    padding: 24px !important;

    color: #8f809d;
}

.history-actions {
    display: flex;

    gap: 6px;
}

.history-actions button {
    padding: 6px 10px;

    border: 1px solid #4b355d;
    border-radius: 6px;

    background: #241636;

    color: #ffffff;

    cursor: pointer;

    font-size: 13px;
}

.history-actions button:hover {
    background: #342145;
}


/* NAVIGAZIONE SETTIMANA */

.week-navigation {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 30px;

    width: 100%;

    margin-top: 10px;
    padding-top: 25px;

    border-top: 1px solid #3b2850;
}

.week-center {
    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 8px;
}

.week-label {
    margin: 0;

    font-size: 11px;

    letter-spacing: 2px;

    color: #a99ab8;
}

.week-button,
.current-week-button {
    border: 1px solid #4b355d;

    background: #1d1230;

    color: #ffffff;

    border-radius: 8px;

    padding: 9px 16px;

    cursor: pointer;

    font-size: 13px;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.week-button:hover,
.current-week-button:hover {
    background: #2a1a3d;

    border-color: #705687;
}

.current-week-button {
    font-size: 12px;
}


/* MODALI */

.modal {
    position: fixed;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(5, 2, 9, 0.75);
}

.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 400px;

    padding: 30px;

    background: #1d1230;

    border: 1px solid #4b355d;

    border-radius: 16px;
}

.modal-content h2 {
    margin: 0 0 25px;

    font-size: 16px;

    letter-spacing: 1px;
}

.modal-content label {
    display: block;

    margin: 18px 0 7px;

    font-size: 11px;

    letter-spacing: 1px;

    color: #a99ab8;
}

.modal-content select,
.modal-content input {
    width: 100%;

    padding: 12px;

    border: 1px solid #4b355d;

    border-radius: 7px;

    background: #140b21;

    color: #ffffff;

    font-size: 15px;
}

.modal-content input:focus,
.modal-content select:focus {
    outline: none;

    border-color: #806397;
}

.modal-buttons {
    display: flex;

    gap: 10px;

    margin-top: 25px;
}

.modal-buttons button {
    flex: 1;

    padding: 12px;

    border: 1px solid #4b355d;

    border-radius: 7px;

    background: transparent;

    color: #ffffff;

    cursor: pointer;
}

.modal-buttons button:hover {
    background: #2a1a3d;
}

.modal-buttons button:last-child {
    background: #ffffff;

    color: #160d24;

    border-color: #ffffff;
}

.modal-buttons button:last-child:hover {
    background: #ddd;
}


/* EDIT MODAL */

#editModal .modal-content {
    max-width: 420px;
}

#editModal label {
    display: block;

    margin-top: 14px;
    margin-bottom: 6px;
}

#editModal input,
#editModal select {
    width: 100%;

    box-sizing: border-box;
}


/* MANUAL MODAL */

#manualModal .modal-content {
    max-width: 420px;
}

#manualModal label {
    display: block;

    margin-top: 14px;
    margin-bottom: 6px;
}

#manualModal input,
#manualModal select {
    width: 100%;

    box-sizing: border-box;
}

.timer-button:disabled,
.manual-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.timer-button:disabled:hover,
.manual-button:disabled:hover {
    background: transparent;
    border-color: #705687;
    color: #ffffff;
}

.manual-button:disabled:hover {
    background: #1d1230;
    color: #c9bbd5;
}


/* MOBILE */

@media (max-width: 700px) {

    .app {
        max-width: 100%;

        padding: 30px 18px 45px;
    }

    .header {
        margin-bottom: 30px;
    }

    .header h1 {
        font-size: 28px;
    }

    .total-section {
        margin-bottom: 30px;

        padding: 22px;
    }

    .total-header {
        flex-direction: column;

        align-items: flex-start;

        gap: 15px;
    }

    .total-section .project-time {
        font-size: 34px;
    }


    /* TUTTO UNO SOTTO L'ALTRO */

    .main-dashboard {
        display: flex;

        flex-direction: column;

        gap: 25px;

        margin-bottom: 35px;
    }

    .dashboard-section {
        width: 100%;

        padding: 22px;
    }

    .tracker-section {
        width: 100%;
    }

    .project {
        padding: 22px;
    }

    .history-section {
        margin-bottom: 35px;
    }

    .history-table-container {
        border-radius: 12px;
    }

    .week-navigation {
        gap: 10px;

        padding-top: 20px;
    }

    .week-button,
    .current-week-button {
        padding: 8px 10px;

        font-size: 12px;
    }

    .progress-header {
        flex-direction: column;

        align-items: flex-start;

        gap: 5px;
    }

    .progress-header span:last-child {
        text-align: left;
    }
}