/* ===================================
   TOOLBAR STYLES - COMPREHENSIVE
   =================================== */

/* ===================================
   1. TOOLBAR CONTAINER
   =================================== */
#topBar {
    position: fixed;
    top: 20px;
    left: 95px;  /* Adjusted for 53px hamburger menu with spacing */
    z-index: 1000000;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 16px;
    width: calc(100% - 40px);
    max-width: 900px;
}

/* Default dark theme */
body:not(.frutiger-mode):not(.light-mode):not(.night-mode):not(.picnic-mode):not(.with-background) #topBar {
    background: #131313;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Theme variations */
body.night-mode #topBar {
    background: #0a0a0a;
    border: none;
}

body.picnic-mode #topBar {
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-mode #topBar {
    background: #FFFFFF;
    border: 1px solid #F5F7FB;
}

body.with-background #topBar {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* ===================================
   2. MAIN TOOLBAR BUTTONS
   =================================== */
#toolbar button:not(.dropdown-item),
.add-button,
.setting-btn,
.save-button,
#drawingModeBtn,
#eraserModeBtn {
    padding: 6px 14px;
    background: transparent;
    border: none;
    color: #7e8590;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease-out;
    font-family: 'Nunito', 'Claire Sans', sans-serif !important;
    display: flex;
    align-items: center;
    gap: 9px;
}

#toolbar button:not(.dropdown-item):hover,
.add-button:hover,
.setting-btn:hover,
.save-button:hover,
#drawingModeBtn:hover,
#eraserModeBtn:hover {
    background-color: #9191ff;
    color: #ffffff;
}

#toolbar button:not(.dropdown-item):active,
.add-button:active,
.setting-btn:active,
.save-button:active,
#drawingModeBtn:active,
#eraserModeBtn:active {
    transform: scale(0.98);
}

/* Special button states */
.save-button {
    background: #3b82f6;
    border-color: #2563eb;
}

.save-button:hover {
    background: #60a5fa;
    border-color: #3b82f6;
}

#drawingModeBtn.active {
    background: #5353ff;
    border-color: #3838dd;
}

#eraserModeBtn.active {
    background: #ff5353;
    border-color: #dd3838;
}

/* Light mode button adjustments */
.light-mode #toolbar button:not(.dropdown-item),
.light-mode .add-button,
.light-mode .setting-btn,
.light-mode .save-button {
    background: #F5F7FB;
    border: 1px solid #F5F7FB !important;
    color: #7f7f7f;
}

.light-mode #toolbar button:not(.dropdown-item):hover,
.light-mode .add-button:hover,
.light-mode .setting-btn:hover,
.light-mode .save-button:hover {
    background: #ECECEC;
    border-color: #ECECEC !important;
}

/* ===================================
   3. BOARD SELECTOR
   =================================== */
#whiteboardSwitcher {
    background: transparent;
    padding-right: 16px;
    border-radius: 10px;
    border: none;
    height: 36px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    transition: all 0.15s ease;
}

#whiteboardSwitcher:hover {
    background: #3a3a3a;
}

.board-selector {
    padding: 8px 16px;
    background: #2a2a2a;
    border: 2px solid #1a1a1a !important;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #7e8590;
    font-size: 0.80rem;
    font-weight: 600;
    font-family: 'Nunito', sans-serif !important;
    user-select: none;
}

.board-selector:hover {
    background: #3a3a3a;
    border-color: #2a2a2a !important;
}

.board-selector-text {
    color: #7e8590;
    font-family: 'Nunito', sans-serif !important;
}

.board-selector-arrow {
    transition: transform 0.2s;
    color: #999;
}

.board-selector.active .board-selector-arrow {
    transform: rotate(180deg);
}

#boardName {
    padding: 4px 8px;
    border-radius: 6px;
    cursor: text;
    transition: background 0.2s;
    font-size: 0.80rem;
    color: #7e8590;
    font-weight: 600;
    font-family: 'Nunito', sans-serif !important;
}

.light-mode #boardName {
    color: #7f7f7f;
}

#boardName:hover, 
#boardName:focus {
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.light-mode #boardName:hover,
.light-mode #boardName:focus {
    background: #F5F7FB;
    outline: none;
}

/* Light mode board selector */
.light-mode .board-selector {
    background: #F5F7FB;
    border: 1px solid #F5F7FB !important;
    color: #7f7f7f;
}

.light-mode .board-selector:hover {
    background: #ECECEC;
    border-color: #ECECEC !important;
}

/* ===================================
   4. FILE & BOOKMARK BUTTONS
   =================================== */
.file-structure-container, 
.bookmarks-container {
    position: relative;
    display: inline-block;
    z-index: 1000001;
}

.file-structure-trigger, 
.bookmarks-trigger {
    padding: 8px 16px;
    background: #2a2a2a;
    border: 2px solid #1a1a1a !important;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 36px;
}

.file-structure-trigger:hover, 
.bookmarks-trigger:hover {
    background: #3a3a3a;
    border-color: #2a2a2a !important;
}

.file-structure-trigger p, 
.bookmarks-trigger p {
    margin: 0;
    color: #ddd;
    font-size: 0.80rem;
    font-weight: 600;
    font-family: 'Nunito', sans-serif !important;
}

/* Light mode */
.light-mode .file-structure-trigger,
.light-mode .bookmarks-trigger {
    background: #F5F7FB;
    border: 1px solid #F5F7FB !important;
}

.light-mode .file-structure-trigger:hover,
.light-mode .bookmarks-trigger:hover {
    background: #ECECEC;
    border-color: #ECECEC !important;
}

/* ===================================
   5. SETTINGS BUTTON
   =================================== */
.settings-container {
    position: relative;
}

.setting-btn {
    /* Inherits from main toolbar button styles above */
}

/* Settings button text */
.setting-btn span {
    font-family: 'Nunito', sans-serif !important;
}

/* Settings button animation parts */
.bar {
    width: 8px;
    height: 1.5px;
    background-color: rgb(229, 229, 229);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 2px;
}

.bar::before {
    content: "";
    width: 2px;
    height: 2px;
    background-color: rgb(60, 60, 60);
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid white;
    transition: all 0.3s;
    box-shadow: 0px 0px 3px white;
}

.bar1::before {
    transform: translateX(-3px);
}

.bar2::before {
    transform: translateX(3px);
}

.setting-btn:hover .bar1::before {
    transform: translateX(3px);
}

.setting-btn:hover .bar2::before {
    transform: translateX(-3px);
}

/* ===================================
   6. DROPDOWN MENUS
   =================================== */

/* Board dropdown */
.board-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: #131313;
    border-radius: 12px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    flex-direction: column;
    gap: 4px;
    z-index: 1000002;
    min-width: 180px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#whiteboardSwitcher:hover .board-dropdown,
.board-dropdown:hover {
    opacity: 1;
    visibility: visible;
    display: flex;
}

.board-dropdown .list {
    list-style-type: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    margin: 0;
}

.board-dropdown .element {
    display: flex;
    align-items: center;
    color: #ddd;
    gap: 12px;
    transition: all 0.2s ease;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Nunito', sans-serif !important;
    font-size: 0.80rem;
    font-weight: 500;
}

.board-dropdown .element:hover {
    background: #2a2a2a;
}

.board-dropdown .element.active {
    color: #ffffff;
    background-color: lightblue;
}

/* Hide separator completely */
.board-dropdown .separator,
.board-dropdown .seperator {
    display: none !important;
}

/* Settings menu */
.settings-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: #131313;
    border-radius: 12px;
    padding: 8px;
    z-index: 1000002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-container:hover .settings-menu,
.settings-menu:hover {
    opacity: 1;
    visibility: visible;
    display: flex;
}

.settings-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ddd;
    font-family: 'Nunito', sans-serif !important;
    font-size: 0.80rem;
    font-weight: 500;
}

.settings-option:hover {
    background: #2a2a2a;
}

.settings-option.separator {
    border-top: 1px solid #2b2a2a;
    margin: 0.36rem 0;
    padding: 0;
    cursor: default;
}

.settings-option.separator:hover {
    background: transparent;
}

/* Add dropdown */
.add-dropdown-container {
    position: relative;
}

.add-button .dropdown-arrow {
    margin-left: 4px;
}

.add-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: #131313;
    border-radius: 12px;
    padding: 8px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000002;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.add-dropdown-container:hover .add-dropdown-menu,
.add-dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ddd;
    font-family: 'Nunito', sans-serif !important;
    font-size: 0.80rem;
    font-weight: 500;
    text-align: left;
    height: auto;
    justify-content: flex-start;
    width: 100%;
    margin: 0;
}

.dropdown-item:hover {
    background: #2a2a2a;
}

/* File structure dropdown */
.file-structure-dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 5px);
    width: 220px;
    background: #131313;
    border-radius: 12px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000002;
    max-height: 400px;
    overflow-y: auto;
}

.file-structure-container:hover .file-structure-dropdown,
.file-structure-dropdown:hover {
    opacity: 1;
    visibility: visible;
}

.file-structure-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.file-structure-list li {
    padding: 10px 12px;
    color: #ddd;
    font-family: 'Nunito', sans-serif !important;
    font-size: 0.80rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 2px 0;
}

.file-structure-list li:hover {
    background: #2a2a2a;
}

.file-structure-list li.category-item {
    padding-left: 32px;
}

.file-structure-list li.card-item {
    padding-left: 52px;
    font-size: 11px;
    color: #9ca3af;
}

/* Customization submenu */
.customization-submenu {
    position: absolute;
    left: calc(100% + 5px);
    top: 0;
    background: #131313;
    border-radius: 12px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 150px;
    pointer-events: none;
    z-index: 1001;
}

.settings-option.has-submenu:hover .customization-submenu,
.customization-submenu:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.15s ease, visibility 0s;
}

.bg-option {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ddd;
    font-size: 0.80rem;
    font-weight: 500;
    font-family: 'Nunito', sans-serif !important;
    user-select: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bg-option:hover {
    background: #2a2a2a;
}

.bg-option.active {
    background: #2b2a2a;
    font-weight: 600;
}

/* Light mode dropdown adjustments */
.light-mode .add-dropdown-menu,
.light-mode .settings-menu {
    background: #FFFFFF;
    border: 1px solid #F5F7FB;
}

.light-mode .dropdown-item,
.light-mode .settings-option {
    color: #7f7f7f;
}

.light-mode .dropdown-item:hover,
.light-mode .settings-option:hover {
    background-color: #F5F7FB;
    color: #7f7f7f;
}
