/* Base styles */
body {
    background-color: #1c1c1e;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen;
    margin: 0;
}

.dashboard {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
    z-index: 1000; /* Ensure header is above the ribbon */
}

h1 {
    color: #ff9500;
    font-size: 36px;
    margin: 0;
}

.settings-button {
    position: absolute;
    right: 0;
    top: 0;
    background: none;
    border: none;
    color: #ff9500;
    font-size: 30px;
    cursor: pointer;
    padding: 10px;
}

.settings-button:hover {
    color: #ffffff;
}

.widget {
    background-color: #2c2c2e;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.widget button,
.widget input[type="number"] {
    width: 100%;
    max-width: 300px;
    padding: 15px;
    border-radius: 15px;
    border: none;
    margin: 10px 0;
    font-size: 18px;
}

.widget button {
    background-color: #ff9500;
    color: #121212;
    font-weight: bold;
}

.widget input[type="number"] {
    background-color: #3a3a3c;
    color: #ffffff;
    text-align: center;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-widget {
    background-color: #2c2c2e;
    padding: 15px;
    border-radius: 20px;
    text-align: center;
    overflow: hidden;
    word-wrap: break-word;
}

.stat-widget h2 {
    color: #ff9500;
    margin-bottom: 10px;
    font-size: 18px;
}

.stat-widget p {
    font-size: 24px;
    font-weight: bold;
}

.comparison-value,
.comparison-percentage {
    margin: 5px 0;
}

.chart-container {
    background-color: #2c2c2e;
    border-radius: 20px;
    padding: 15px;
    position: relative;
    margin-top: 20px;
    height: 400px; /* Added height limit */
    margin-bottom: 40px; /* Add margin to separate charts */
}

#hourly-chart-container {
    padding-bottom: 20px; /* Added padding to accommodate labels */
}

.chart-toggle-button {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #ff9500;
    color: #121212;
    border: none;
    padding: 10px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.chart-toggle-button:hover {
    background-color: #ffa733;
}

canvas {
    max-width: 100%;
    height: 100%;
}

/* Media queries for mobile devices */
@media (max-width: 600px) {
    h1 {
        font-size: 28px;
        margin-top: 60px; /* Increase margin to prevent overlap */
    }

    .settings-button {
        font-size: 24px;
        top: 10px; /* Adjust top position */
        right: 10px; /* Adjust right position */
        position: fixed; /* Change to fixed positioning */
        z-index: 1000; /* Ensure it stays above other elements */
    }

    .widget button,
    .widget input[type="number"] {
        font-size: 16px;
    }

    .stat-widget h2 {
        font-size: 16px;
    }

    .stat-widget p {
        font-size: 20px;
    }

    .chart-toggle-button {
        font-size: 12px;
        padding: 8px 12px;
    }

    .modal-content {
        margin-top: 30%;
    }

    .ribbon {
        width: 100px;
        height: 100px;
        z-index: 999; /* Lower z-index to stay below the header */
    }

    .ribbon span {
        width: 150px;
        padding: 8px 0;
        font-size: 20px; /* Adjust font size for better visibility */
        top: 15px;
        left: -40px;
    }

    header {
        padding-top: 20px; /* Further increase padding to prevent overlap with ribbon */
        z-index: 1000; /* Ensure header is above the ribbon */
    }
}

.date-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.nav-button {
    background-color: #ff9500;
    color: #121212;
    border: none;
    padding: 10px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    margin: 0 10px;
}

.nav-button:disabled {
    background-color: #7f7f7f;
    cursor: not-allowed;
}

.date-navigation span {
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
}

/* Ensure all elements use border-box sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

.bottom-bar {
    /* position: fixed; */
    /* bottom: 0; */
    width: 100%;
    background-color: #2c2c2e;
    color: #ffffff;
    text-align: center;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 14px;
}

.bottom-bar span {
    margin: 5px 0;
}

.ribbon {
    position: absolute;
    top: 0;
    left: 0;
    width: 150px;
    height: 150px;
    overflow: hidden;
    pointer-events: none;
    z-index: 1000;
}

.ribbon span {
    position: absolute;
    display: block;
    width: 225px;
    padding: 10px 0;
    background: orange;
    color: black;
    text-align: center;
    font-weight: bold;
    transform: rotate(-45deg);
    top: 25px;
    left: -50px;
    font-size: 25px; /* Increase font size */
}

/* Styles for the Quit Plan Calendar */
.quit-plan-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #3a3a3c; /* Added background color for better visibility */
}

.quit-plan-table th,
.quit-plan-table td {
    border: 1px solid #444;
    padding: 10px;
    text-align: center;
    color: #ffffff;
}

.quit-plan-table th {
    background-color: #3a3a3c;
}

.quit-plan-table tr:nth-child(even) {
    background-color: #2c2c2e;
}

.quit-plan-table tr:nth-child(odd) {
    background-color: #1c1c1e;
}

.greyed-out {
    opacity: 0.5;
    pointer-events: none;
}

#quitPlanCalendar.greyed-out {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px; /* Adjust as needed */
    text-align: center;
}
/* Make the Quit Plan Calendar scrollable */
#quitPlanCalendar {
    max-height: 275px;
    /* Adjust height as needed */
    overflow-y: auto;
    width: 100%;
}

/* Remove scrollbar arrow buttons and add rounded corners for #quitPlanCalendar */
#quitPlanCalendar::-webkit-scrollbar-button {
    display: none;
}

#quitPlanCalendar::-webkit-scrollbar-thumb {
    border-radius: 8px;
    /* Increase for more rounded corners */
}

/* Style the scrollbar for Quit Plan Calendar */
#quitPlanCalendar::-webkit-scrollbar {
    width: 8px;
}

#quitPlanCalendar::-webkit-scrollbar-track {
    background: #2c2c2e;
}

#quitPlanCalendar::-webkit-scrollbar-thumb {
    background-color: orange;
    border-radius: 4px;
}

/* Optional: Scrollbar styles for Firefox */
#quitPlanCalendar {
    scrollbar-width: thin;
    scrollbar-color: orange #2c2c2e;
}

/* Highlight the current day in the quit plan schedule */
.quit-plan-table .current-day {
    background-color: rgba(76, 217, 100, 0.2);
    /* Highlight with a light green background */
}

/* Add scrollable container for Quit Plan Calendar */
.quit-plan-calendar-container {
    max-height: 275px;
    /* Adjust height as needed */
    overflow-y: auto;
    width: 100%;
    padding: 10px 0;
    /* Optional: Add padding for spacing */
}

/* Style adjustments if necessary */
.quit-plan-calendar-container table {
    width: 100%;
    border-collapse: collapse;
}

/* Shake animation */
@keyframes shake {
    0% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: shake 0.5s;
}

.undo-error-message {
    color: red;
    text-align: center;
    margin-top: 5px;
}

.greyed-out {
    opacity: 0.5;.greyed-out {
            opacity: 0.5;
            pointer-events: none;
        }
    };

/* Add styles for the affirmation container */
.affirmation-container {
    margin-top: 10px;
    padding: 10px;
    background-color: #f0f8ff;
    color: #333;
    font-size: 1.2em;
    text-align: center;
    border-radius: 5px;
}