/* Collapsed Sidebar Styles for Form Builder */

/* Collapsed sidebar state */
.app-container.form-builder-mode #app-sidebar {
    width: 60px;
    transition: width 0.3s ease;
}

.app-container.form-builder-mode #app-sidebar .sidebar-header {
    padding: 1rem 0.5rem;
}

.app-container.form-builder-mode #app-sidebar .sidebar-header img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Hide text in navigation items and style icons */
.app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a {
    justify-content: center !important;
    padding: 0.5rem !important;
    position: relative;
    margin: 0.25rem !important;
    white-space: nowrap;
}

/* Hide all text elements in navigation links */
.app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a span {
    display: none !important;
}

.app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a .nav-text {
    display: none !important;
}

.app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a .nav-badge {
    display: none !important;
}

/* Hide any text nodes and other elements except icons */
.app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a > *:not(i):not(.fas):not(.far):not(.fab) {
    display: none !important;
}

/* Ensure direct text content is hidden by setting font-size to 0 */
.app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a {
    font-size: 0 !important;
    line-height: 0 !important;
}

/* Also hide text in bottom navigation */
.app-container.form-builder-mode #app-sidebar .sidebar-bottom-nav ul li a {
    font-size: 0 !important;
    line-height: 0 !important;
}

/* Hide text in dark mode toggle specifically */
.app-container.form-builder-mode #app-sidebar #dark-mode-toggle {
    font-size: 0 !important;
    line-height: 0 !important;
}

/* Hide text in logout button */
.app-container.form-builder-mode #app-sidebar .sidebar-logout-button {
    font-size: 0 !important;
    line-height: 0 !important;
}

/* Reset font size for icons only */
.app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a i {
    margin-right: 0;
    font-size: 1.1rem !important;
    line-height: normal !important;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(108, 117, 125, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a:hover i {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--dds-red-100);
}

.app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a.active i {
    background-color: var(--dds-red-100);
    color: white;
}

/* Hide user details in footer */
.app-container.form-builder-mode #app-sidebar .user-details {
    display: none !important;
}

.app-container.form-builder-mode #app-sidebar .sidebar-logout-button {
    justify-content: center !important;
    padding: 0.5rem !important;
    margin: 0.25rem !important;
    position: relative;
}

.app-container.form-builder-mode #app-sidebar .sidebar-logout-button span {
    display: none !important;
}

/* Reset font size for logout button icon */
.app-container.form-builder-mode #app-sidebar .sidebar-logout-button i {
    margin-right: 0;
    font-size: 1.1rem !important;
    line-height: normal !important;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(108, 117, 125, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.app-container.form-builder-mode #app-sidebar .sidebar-logout-button:hover i {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--dds-red-100);
}

.app-container.form-builder-mode #app-sidebar .sidebar-bottom-nav ul li a {
    justify-content: center !important;
    padding: 0.5rem !important;
    margin: 0.25rem !important;
    position: relative;
}

.app-container.form-builder-mode #app-sidebar .sidebar-bottom-nav ul li a span {
    display: none !important;
}

/* Reset font size for bottom nav icons */
.app-container.form-builder-mode #app-sidebar .sidebar-bottom-nav ul li a i {
    margin-right: 0;
    font-size: 1.1rem !important;
    line-height: normal !important;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(108, 117, 125, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.app-container.form-builder-mode #app-sidebar .sidebar-bottom-nav ul li a:hover i {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--dds-red-100);
}

/* Special styling for dark mode toggle */
.app-container.form-builder-mode #app-sidebar #dark-mode-toggle {
    justify-content: center !important;
    padding: 0.5rem !important;
    margin: 0.25rem !important;
    position: relative;
}

.app-container.form-builder-mode #app-sidebar #dark-mode-toggle i {
    margin-right: 0;
    font-size: 1.1rem !important;
    line-height: normal !important;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(108, 117, 125, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.app-container.form-builder-mode #app-sidebar #dark-mode-toggle:hover i {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--dds-red-100);
}

/* Tooltips for collapsed sidebar */
.app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a::after,
.app-container.form-builder-mode #app-sidebar .sidebar-bottom-nav ul li a::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
    background-color: #333333 !important;
    color: #ffffff !important;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10000 !important;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
    min-width: max-content;
    font-family: var(--font-body) !important;
}

.app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a:hover::after,
.app-container.form-builder-mode #app-sidebar .sidebar-bottom-nav ul li a:hover::after {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Tooltip for logout button */
.app-container.form-builder-mode #app-sidebar .sidebar-logout-button::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
    background-color: #333333 !important;
    color: #ffffff !important;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10000 !important;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
    min-width: max-content;
    font-family: var(--font-body) !important;
}

.app-container.form-builder-mode #app-sidebar .sidebar-logout-button:hover::after {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Tooltip for dark mode toggle */
.app-container.form-builder-mode #app-sidebar #dark-mode-toggle::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
    background-color: #333333 !important;
    color: #ffffff !important;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10000 !important;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
    min-width: max-content;
    font-family: var(--font-body) !important;
}

.app-container.form-builder-mode #app-sidebar #dark-mode-toggle:hover::after {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Adjust main content area when sidebar is collapsed */
.app-container.form-builder-mode .main-column-wrapper {
    margin-left: 0;
}

/* Special styling for the Form Builder V2 navigation item */
.app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a[data-navigate="/forms/builder-v2"] {
    background-color: rgba(220, 38, 38, 0.15);
    border-left: 3px solid var(--dds-red-100);
}

.app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a[data-navigate="/forms/builder-v2"] .nav-badge {
    display: none;
}

/* Dark mode adjustments for collapsed sidebar */
[data-theme="dark"] .app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a::after,
[data-theme="dark"] .app-container.form-builder-mode #app-sidebar .sidebar-bottom-nav ul li a::after,
[data-theme="dark"] .app-container.form-builder-mode #app-sidebar .sidebar-logout-button::after,
[data-theme="dark"] .app-container.form-builder-mode #app-sidebar #dark-mode-toggle::after,
body.dark-mode .app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a::after,
body.dark-mode .app-container.form-builder-mode #app-sidebar .sidebar-bottom-nav ul li a::after,
body.dark-mode .app-container.form-builder-mode #app-sidebar .sidebar-logout-button::after,
body.dark-mode .app-container.form-builder-mode #app-sidebar #dark-mode-toggle::after {
    background-color: var(--card-bg);
    color: var(--text-default);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Responsive behavior for collapsed sidebar */
@media (max-width: 768px) {
    .app-container.form-builder-mode #app-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .app-container.form-builder-mode #app-sidebar .sidebar-nav ul {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
    }
    
    .app-container.form-builder-mode #app-sidebar .sidebar-nav ul li {
        flex-shrink: 0;
    }
    
    .app-container.form-builder-mode .main-column-wrapper {
        margin-left: 0;
    }
    
    /* Hide tooltips on mobile */
    .app-container.form-builder-mode #app-sidebar .sidebar-nav ul li a::after,
    .app-container.form-builder-mode #app-sidebar .sidebar-bottom-nav ul li a::after {
        display: none;
    }
}
