#right_sidebar {
    position: fixed;
    top: 0;
    right: 0;
    /* Initially hidden via transform */
    width: calc(319 * var(--ws-unit, 1px));
    height: 100%;
    background-color: var(--theme-surface-main, #191919);
    transform: translateX(100%);
    transition: transform var(--duration-apple, 350ms) var(--ease-apple-fluid, cubic-bezier(0.16, 1, 0.3, 1));
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding-top: 0;
    box-sizing: border-box;
}

#right_sidebar.active {
    transform: translateX(0);
}

.main_section.right-sidebar-active {
    margin-right: calc(319 * var(--ws-unit, 1px));
}

.new_event_section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: var(--font-size-base);
}

.new_event_scroll_wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Crucial for nested flex scrolling */
}

.new_event_scroll_content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
}

.new_event_scroll_content::-webkit-scrollbar {
    display: none;
}

.custom-scrollbar-track.sidebar-scrollbar {
    top: 0;
    bottom: 0px;
    right: 0px;
    background-color: transparent;
    /* Ensure transparency */
}

.new_event_section .right_sidebar_label_section {
    width: 100%;
    padding: calc(5 * var(--ws-unit, 1px));
    box-sizing: border-box;
    flex-shrink: 0;
}

.right_sidebar_title_section {
    margin: calc(4 * var(--ws-unit, 1px)) 0;
}

.right_sidebar_title_section p {
    padding: calc(4 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px));
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    color: var(--theme-text-primary, #d1d1d1);
    background-color: transparent;
    border-radius: calc(7 * var(--ws-unit, 1px));
    border: calc(1 * var(--ws-unit, 1px)) solid transparent;
    transition: background-color 0.2s ease;
}

.right_sidebar_title_section:hover p {
    border-color: transparent;
    background-color: var(--bg-hover, #303030);
}

.right_sidebar_title_section p[contenteditable="true"]:focus {
    outline: none;
    background-color: var(--bg-hover, #303030);
    color: var(--theme-text-primary, #d1d1d1);
    border-color: transparent;
}

.right_sidebar_title_section p[contenteditable="true"]:empty::before {
    content: "제목";
    color: var(--theme-text-muted, gray);
    cursor: text;
}

.new_event_section .right_sidebar_description_section {
    flex: 1;
    width: 100%;
    /* Ensure full width */
    padding: calc(5 * var(--ws-unit, 1px));
    box-sizing: border-box;

    border-top: calc(1 * var(--ws-unit, 1px)) solid var(--theme-border, #303030);
    /* Added top border */
}

.right_sidebar_description_section {
    padding: calc(6 * var(--ws-unit, 1px)) 0;
}

.right_sidebar_description_section p {
    padding: calc(4 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px));
    margin: calc(4 * var(--ws-unit, 1px)) 0;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    color: var(--theme-text-primary, #d1d1d1);
    background-color: transparent;
    border-radius: calc(7 * var(--ws-unit, 1px));
    border: calc(1 * var(--ws-unit, 1px)) solid transparent;
    transition: background-color 0.2s ease;
}

.right_sidebar_description_section:hover p {
    border-color: transparent;
    background-color: var(--bg-hover, #303030);
}

.right_sidebar_description_section p[contenteditable="true"]:focus {
    outline: none;
    background-color: var(--bg-hover, #303030);
    color: var(--theme-text-primary, #d1d1d1);
    border-color: transparent;
}

.right_sidebar_description_section p[contenteditable="true"]:empty::before {
    content: "설명";
    color: var(--theme-text-muted, gray);
    cursor: text;
}

.right_sidebar_header_controls {
    display: flex;
    margin: calc(4 * var(--ws-unit, 1px)) 0;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.right_sidebar_icon {
    cursor: pointer;
    width: calc(20 * var(--ws-unit, 1px));
    /* Assuming a default size or ensuring it's clickable */
    height: calc(20 * var(--ws-unit, 1px));
}

.right_sidebar_label {
    color: var(--theme-text-primary, #d1d1d1);
    background-color: transparent;
    font-size: var(--font-size-base);
    margin: 0;
    padding: calc(4 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px));
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(80 * var(--ws-unit, 1px));
    border-radius: var(--radius-sm, calc(6 * var(--ws-unit, 1px)));
    border: calc(1 * var(--ws-unit, 1px)) solid transparent;
    transition: background-color 0.2s ease;
}

.right_sidebar_label:hover {
    border-color: transparent;
    background-color: var(--bg-hover, #303030);
    justify-content: space-between;
}

.right_sidebar_label.active {
    background-color: var(--bg-hover, #303030);
    border-color: transparent;
    justify-content: space-between;
}

#dropdown_toggle,
#dropdown_toggle_exist,
#repeat_dropdown_toggle,
#repeat_dropdown_toggle_exist {
    margin-left: calc(5 * var(--ws-unit, 1px));
    width: calc(12 * var(--ws-unit, 1px));
    height: calc(12 * var(--ws-unit, 1px));
}

#more_options_dropdown {
    position: fixed;
    background-color: var(--bg-secondary);
    border: calc(1 * var(--ws-unit, 1px)) solid var(--border-color);
    border-radius: var(--radius-md);
    z-index: 5002;
    display: flex;
    flex-direction: column;
    width: auto !important;
    padding: 0 0 var(--spacing-xs) 0;
    margin-bottom: 0;
    box-shadow: none !important;
}

#dropdown_menu,
#repeat_dropdown_menu {
    position: fixed;
    background-color: var(--bg-secondary);
    border: calc(1 * var(--ws-unit, 1px)) solid var(--border-color);
    border-radius: var(--radius-md);
    z-index: 5002;
    display: flex;
    flex-direction: column;
    padding: 0 0 var(--spacing-xs) 0;
    margin-bottom: 0;
    box-shadow: none !important;
}


#repeat_dropdown_menu,
#more_options_dropdown {
    min-width: calc(160 * var(--ws-unit, 1px));
}

#dropdown_menu {
    min-width: calc(110 * var(--ws-unit, 1px));
}

#dropdown_menu.hidden:not([data-menu-motion-closing]),
#repeat_dropdown_menu.hidden:not([data-menu-motion-closing]),
#more_options_dropdown.hidden:not([data-menu-motion-closing]) {
    display: none !important;
}

.dropdown_item {
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-size-base);
    padding: 0 var(--spacing-sm, calc(8 * var(--ws-unit, 1px)));
    min-height: calc(32 * var(--ws-unit, 1px));
    margin: var(--spacing-xs, calc(4 * var(--ws-unit, 1px))) var(--spacing-xs, calc(4 * var(--ws-unit, 1px))) 0 var(--spacing-xs, calc(4 * var(--ws-unit, 1px))) !important;
    border-radius: var(--radius-sm);
    position: relative;
    transition: background-color 0.15s, color 0.15s;
    white-space: nowrap;
    user-select: none;
}

.dropdown_item .dropdown-checkmark,
.dropdown_item .type-dropdown-checkmark {
    display: none !important;
}

.dropdown_item .checkmark {
    display: none;
}

.dropdown_item:hover {
    background-color: var(--bg-hover, #2c2c2e);
    color: var(--text-primary, #ffffff);
}

.dropdown_item.selected {
    background-color: var(--bg-hover, #2c2c2e);
    color: var(--text-primary, #ffffff);
    font-weight: 500;
    box-sizing: border-box;
}

/* More Option Item Styles */
.more_option_item {
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: var(--font-size-base);
    padding: 0 var(--spacing-sm);
    min-height: calc(32 * var(--ws-unit, 1px));
    margin: var(--spacing-xs) var(--spacing-xs) 0 var(--spacing-xs) !important;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s, color 0.2s;
}

.more_option_item:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.more_option_item img {
    width: calc(15 * var(--ws-unit, 1px));
    height: calc(15 * var(--ws-unit, 1px));
    margin-right: var(--spacing-sm);
}

.more_option_divider {
    height: calc(1 * var(--ws-unit, 1px));
    background-color: var(--border-color);
    margin: calc(5 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px)) calc(1 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px));
}

.right_sidebar_section {
    padding: calc(10 * var(--ws-unit, 1px));
    display: flex;
    flex-direction: column;
    gap: calc(10 * var(--ws-unit, 1px));
}

.datetime-container {
    width: 100%;
    padding: calc(5 * var(--ws-unit, 1px));
    box-sizing: border-box;

    border-top: calc(1 * var(--ws-unit, 1px)) solid var(--theme-border, #303030);
    /* Added top border */
}

.datetime-row {
    display: flex;
    align-items: center;
}

.datetime-row:first-child {
    margin: calc(4 * var(--ws-unit, 1px)) 0;
    font-size: var(--font-size-base);
}

.date-selection {
    display: flex;
    padding: calc(5 * var(--ws-unit, 1px)) calc(8 * var(--ws-unit, 1px));
    margin-right: calc(6 * var(--ws-unit, 1px));
    color: var(--theme-text-primary, #d1d1d1);
    cursor: pointer;
    border-radius: calc(7 * var(--ws-unit, 1px));
    border: calc(1 * var(--ws-unit, 1px)) solid transparent;
    transition: background-color 0.2s ease;
}

.time-selection {
    display: flex;
    padding: calc(4 * var(--ws-unit, 1px)) calc(7 * var(--ws-unit, 1px));
    margin-right: calc(6 * var(--ws-unit, 1px));
    color: var(--theme-text-primary, #d1d1d1);
    cursor: pointer;
    border-radius: calc(7 * var(--ws-unit, 1px));
    border: calc(1 * var(--ws-unit, 1px)) solid transparent;
    transition: background-color 0.2s ease;
}

.date-selection:hover,
.time-selection:hover,
.date-selection.active,
.time-selection.active,
.time-selection:focus-within {
    border-color: transparent;
    background-color: var(--bg-hover, #303030);
}

.time-selection p {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    color: var(--theme-text-primary, #d1d1d1);
    background-color: transparent;
    border-radius: calc(7 * var(--ws-unit, 1px));
    border: calc(1 * var(--ws-unit, 1px)) solid transparent;
    transition: background-color 0.2s ease;
}

.time-selection p[contenteditable="true"]:focus {
    outline: none;
    background-color: transparent;
    color: var(--theme-text-primary, #d1d1d1);
    border-color: transparent;
}

.time-selection p[contenteditable="true"]:empty::before,
.time-selection p[contenteditable="true"]:has(> br:only-child)::before {
    content: "12:00 PM";
    color: var(--theme-text-muted, gray);
    cursor: text;
}

#datetime-time,
#datetime-time_exist,
#datetime-arrow,
#datetime-arrow_exist {
    margin: calc(2 * var(--ws-unit, 1px)) calc(10 * var(--ws-unit, 1px)) 0 0;
    width: calc(15 * var(--ws-unit, 1px));
    height: calc(15 * var(--ws-unit, 1px));
}

.option-toggles {
    display: flex;
    flex-direction: column;
    margin: calc(4 * var(--ws-unit, 1px)) 0 calc(6 * var(--ws-unit, 1px)) 0;
}

.toggle-switch {
    display: flex;
    align-items: center;
    color: var(--theme-text-primary, #d1d1d1);

    padding: calc(6 * var(--ws-unit, 1px)) calc(5 * var(--ws-unit, 1px));
    font-size: var(--font-size-base);
}

.toggle-input {
    display: none;
}

.toggle-label {
    position: relative;
    margin-right: calc(10 * var(--ws-unit, 1px));

    width: calc(24 * var(--ws-unit, 1px));
    height: calc(12 * var(--ws-unit, 1px));
    background-color: var(--theme-surface-active, #505050);
    border-radius: calc(10 * var(--ws-unit, 1px));
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-label::after {
    content: '';
    position: absolute;
    top: 0px;
    left: calc(1 * var(--ws-unit, 1px));
    width: calc(12 * var(--ws-unit, 1px));
    height: calc(12 * var(--ws-unit, 1px));
    background-color: #d1d1d1;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-input:checked+.toggle-label {
    background-color: #8B5CF6;
}

.toggle-input:checked+.toggle-label::after {
    transform: translateX(calc(11 * var(--ws-unit, 1px)));
}


.repeat_options_section {
    color: var(--theme-text-primary, #d1d1d1);
    background-color: transparent;
    font-size: var(--font-size-base);
    margin: 0 0 calc(4 * var(--ws-unit, 1px)) 0;
    padding: calc(5 * var(--ws-unit, 1px)) calc(5 * var(--ws-unit, 1px));
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;

    border-radius: calc(7 * var(--ws-unit, 1px));
    border: calc(1 * var(--ws-unit, 1px)) solid transparent;
    transition: background-color 0.2s ease;
}

.repeat_options_section:hover {
    border-color: transparent;
    background-color: var(--bg-hover, #303030);
    justify-content: space-between;
}

.repeat_options_section.active,
.repeat_options_section.open {
    background-color: var(--bg-hover, #303030);
    border-color: transparent;
    justify-content: space-between;
}

#icon_repeat_options,
#icon_repeat_options_exist {
    margin: calc(2 * var(--ws-unit, 1px)) calc(10 * var(--ws-unit, 1px)) 0 0;
    width: calc(15 * var(--ws-unit, 1px));
    height: calc(15 * var(--ws-unit, 1px));
}

.repeat_options_left {
    display: flex;
    align-items: center;
}
