@import url('https://fonts.googleapis.com/css2?family=Oxygen:wght@400;700&display=swap');

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9f7;
}

/* Title and headings styling */
header h1, .page-title {
    font-family: 'Oxygen', sans-serif;
    font-size: 27px;
    font-weight: 700; /* Bold */
    color: #273d62; /* Dark text color */
    margin: 20px 0; /* Add some margin for spacing */
    text-align: left; /* Align the title to the left */
}

header {
    text-align: left;
    margin-bottom: 10px;
    color: #3B4F71;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0 auto;
    padding: 20px;
    background-color: #f8f9f7;
    max-width: 600px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 0 10px;
}

.date-emoji-container {
    display: flex;
    align-items: center;
}

.selected-date {
    font-family: 'Noto Sans', sans-serif;
    font-size: 15px;
    font-weight: 400; /* Regular */
    color: #273d62; /* Dark text color */
}

.day-emoji-container {
    display: flex;
    align-items: center;
    margin-left: 20px; /* Fixed 20 pixel offset */
    position: relative; /* For positioning the emoji picker */
}

.entries {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.entry {
    margin-bottom: 20px;
}

.entry-category {
    font-family: 'Noto Sans', sans-serif;
    font-size: 13px;
    font-weight: 700; /* Bold */
    margin-bottom: 5px;
    color: #3B4F71;
}

.entry-text {
    width: 100%;
    max-width: 100%;
    min-height: 60px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    box-sizing: border-box;
}

.week-overview {
    padding: 10px 0;
    text-align: center;
}

.week-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 10px;
}

.week-number {
    font-family: 'Noto Sans', sans-serif;
    font-size: 15px;
    font-weight: 400; /* Regular */
    color: #273d62; /* Dark text color */
    flex-grow: 1;
    text-align: left;
}

.week-nav-buttons {
    display: flex;
    gap: 10px; /* Add some space between the buttons */
}

.week-nav-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
    padding: 5px;
}

.week-nav-button:hover {
    color: #000;
}

.days {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #273d62; /* Top border */
    border-bottom: 1px solid #273d62; /* Bottom border */
    padding: 10px 0; /* Add some padding for spacing */
}

.day {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #e8ebe7;
    border: 1px solid #273d62;
    cursor: pointer;
    color: white; /* Set text color to white */
    text-shadow: 
        -1px -1px 0 #273d62,  
         1px -1px 0 #273d62,
        -1px  1px 0 #273d62,
         1px  1px 0 #273d62; /* Dark blue outline */
}

.day.entered {
    background-color: #629abc;
    color: white;
}

.category-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    gap: 5px; /* Add some space between elements */
}

.entry-emoji-container {
    display: flex;
    align-items: center;
    margin-left: 0; /* No margin needed */
    position: relative;
}

.entry-category {
    flex-grow: 1; /* Allow the category name to take up available space */
    text-align: left;
    margin-top: 10px;
}

.trash-button {
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 0; /* No margin needed */
    font-size: 18px;
    color: #aaa;
}

.trash-button:hover {
    color: #000;
}

#add-category-container {
    display: flex;
    flex-direction: column;
    /* Stack children elements vertically */
    justify-content: center;
    margin-top: 20px;
    padding: 0px;
}

#add-category-button {
    font-size: 24px;
    padding: 8px 16px; /* Add some padding for better aesthetics */
    width: 30px; /* Adjust width to fit the content */
    cursor: pointer;
    background-color: #629abc; /* Blue background */
    color: white; /* White text */
    border: none; /* Remove any default border */
    border-radius: 5px; /* Slightly rounded corners */
    display: inline-flex; /* Ensure the icon is centered */
    align-items: center; /* Center the icon vertically */
    justify-content: center; /* Center the icon horizontally */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Optional: add a subtle shadow */
    transition: background-color 0.3s; /* Smooth transition for hover effect */
}

#add-category-button:hover {
    background-color: #0056b3; /* Darker blue for hover effect */
}

.custom-dropdown {
    position: relative;
}

.suggestions {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
}

.suggestions div {
    padding: 8px;
    cursor: pointer;
}

.suggestions div:hover {
    background-color: #f0f0f0;
}

/* Backup and Restore Section */
.backup-restore {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 10px;
}

.backup-restore-button {
    font-size: 1em;
    padding: 10px 20px;
    background-color: #629abc;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.backup-restore-button:hover {
    background-color: #629abc;
}

#status-message {
    text-align: center;
    margin-top: 10px;
    color: green;
    font-size: 1.1em;
}

/* Bottom Action Bar */
.bottom-action-bar {
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #629abc;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.action-button {
    background: none;
    border: none;
    font-size: 1.5em;
    color: white;
    cursor: pointer;
}

.action-button:hover {
    color: #629abc;
}

/* Chart View */
#chart-view {
    padding: 20px;
}

.chart-controls {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

#category-select,
#hashtag-select,
#start-date,
#end-date {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
}

#update-chart-button {
    padding: 10px;
    background-color: #629abc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    width: 100%;
}

#update-chart-button:hover {
    background-color: #0056b3;
}

#emoji-chart {
    margin-top: 20px;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #aaa;
    margin-left: auto;
}

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

/* General emoji styling */
.emoji {
    font-size: 1.5em;
    cursor: pointer;
}

.emoji-icon {
    display: inline-block;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
}

/* Small emoji size */
.emoji-icon-small {
    width: 16px;
    height: 16px;
}

/* Medium emoji size */
.emoji-icon-medium {
    width: 32px;
    height: 32px;
}

/* Large emoji size */
.emoji-icon-large {
    width: 128px;
    height: 128px;
}

/* Styles for emoji options within the picker */
.emoji-option {
    display: inline-block;
    width: 32px; /* Ensure this matches the intended size */
    height: 32px; /* Ensure this matches the intended size */
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    margin: 5px; /* Adjust for desired spacing */
    cursor: pointer;
    border-radius: 5px; /* Optional: Add a bit of border-radius */
    overflow: hidden; /* Ensure no overflow */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    transition: transform 0.2s; /* Optional: Add a hover effect */
}

.emoji-option:hover {
    transform: scale(1.1); /* Slightly enlarge on hover */
}

.emoji-picker {
    display: none;
    position: absolute;
    top: 100%; /* Positioned below the emoji */
    transform: translateX(-50%);
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 10px;
    z-index: 10;
    white-space: nowrap; /* Ensure the picker doesn't wrap its content */
    overflow: visible; /* Allow overflow if the content is larger */
    width: auto; /* Set to auto to adjust based on content */
    left: 100px;
}

.emoji-picker.show {
    display: flex;
    justify-content: space-around;
}

/* Hashtag Overlay */
.hashtag-overlay {
    position: absolute;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
}

.hashtag-option {
    padding: 8px;
    cursor: pointer;
}

.hashtag-option:hover {
    background-color: #f0f0f0;
}

/* New Category Input */
#new-category-name {
    flex-grow: 1;
    width: 60%;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin-right: 10px;
    margin-bottom: 10px;
}

#confirm-add-category {
    font-size: 1em;
    padding: 10px 20px;
    background-color: #629abc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#confirm-add-category:hover {
    background-color: #0056b3;
}

/* General Hidden Class */
.hidden {
    display: none;
}

/* Media Queries for Responsiveness */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .emoji-row,
    .week-overview {
        padding: 5px 0;
    }

    .entry-text {
        max-width: calc(100% - 20px);
    }

    #new-category-name {
        font-size: 0.9em;
    }

    #confirm-add-category {
        padding: 8px 16px;
        font-size: 0.9em;
    }
}

/* Prevent zooming on input focus on mobile devices */
input,
textarea {
    font-size: 16px;
}

/* Help Content */
.content {
    padding: 20px;
}

.content h2 {
    color: #629abc;
}

.content p {
    font-size: 1em;
    line-height: 1.5em;
    margin-bottom: 20px;
}

#status-message {
    text-align: center;
    margin-top: 10px;
    color: green;
    font-size: 1.1em;
}
