/* ========================================
   AG ONE Work - Sidebar Component
   Two-Column Layout (Icons | Text)
   ======================================== */

/* Sidebar Container */
.sidebar {
    width: 282px;
    height: 100vh;
    background-color: rgb(5, 21, 61);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    font-family: 'Noto Sans', sans-serif;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

/* Sidebar Decoration (Bottom Gradient) */
.sidebar-decoration {
    position: absolute !important;
    width: 470px !important;
    height: 293px !important;
    left: -133px !important;
    bottom: -60px !important;
    background: conic-gradient(from -86.34deg at 51.64% 19.73%, #39CBD0 0deg, #B650F1 174.6deg, #2962F5 360deg) !important;
    filter: blur(50px) !important;
    transform: rotate(-139.32deg) !important;
    opacity: 0.8 !important;
    pointer-events: none !important;
    z-index: 1 !important;
    transition: all 0.3s ease;
}

.sidebar-decoration::before {
    content: '';
    display: none;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-sizing: border-box;
    width: 100%;
    height: 112px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.sidebar-logo {
    height: 40px;
    width: auto;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-logo img {
    max-height: 40px;
    max-width: 180px;
    height: auto;
    width: auto;
    display: block;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s;
    color: rgb(140, 158, 187);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Sidebar Content (Two-Column Layout) */
.sidebar-content {
    display: flex;
    flex: 1;
    width: 100%;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Icon Column (Left) */
.sidebar-icons {
    width: 56px;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: auto;
}

.sidebar-icons::-webkit-scrollbar {
    display: none;
}

.icon-button {
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-right: 4px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    position: relative;
}

.icon-button svg {
    width: 20px;
    height: 20px;
    stroke: rgb(159, 174, 198);
    stroke-width: 2;
}

.icon-button.active {
    background: linear-gradient(267deg, rgba(74, 122, 255, 0.5) 11.41%, rgba(0, 29, 107, 0.3) 127.13%);
    border-right-color: rgb(132, 244, 251);
}

/* For icon buttons without submenu (like Recruits), only show left active state */
.icon-button.icon-button-no-submenu.active {
    background: transparent;
    border-right-color: transparent;
}

.icon-button.active svg {
    stroke: rgb(191, 250, 253);
}

.icon-button.icon-button-no-submenu.active svg {
    stroke: rgb(191, 250, 253);
}

.icon-button:hover {
    background: rgba(74, 122, 255, 0.2);
}

/* Separator */
.sidebar-separator {
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* Text Column (Right) */
.sidebar-text {
    width: 225px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.sidebar-text::-webkit-scrollbar {
    display: none;
}

/* Section Label */
.section-label {
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 16px 0 16px;
    background: transparent;
    border-right: 4px solid transparent;
    box-sizing: border-box;
    color: rgb(159, 174, 198);
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.section-label:hover {
    background: rgba(255, 255, 255, 0.02);
}

.section-label.active {
    background: rgba(255, 255, 255, 0.03);
    color: rgb(255, 255, 255);
}

/* Section Label Single (for menu items without submenus like Recruits) */
.section-label-single {
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 16px 0 16px;
    background: transparent;
    border-right: 4px solid transparent;
    box-sizing: border-box;
    color: rgb(159, 174, 198);
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.section-label-single:hover {
    background: rgba(255, 255, 255, 0.02);
}

.section-label-single.active {
    background: linear-gradient(267deg, rgba(74, 122, 255, 0.5) 11.41%, rgba(0, 29, 107, 0.3) 127.13%);
    border-right-color: rgb(132, 244, 251);
    color: rgb(255, 255, 255);
}

/* Section Items */
.section-items {
    width: 100%;
}

/* When a section is active, hide all following sections (prevents overlap) */
.sidebar-text .section.active~.section {
    display: none;
}

/* Text Item */
.text-item {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 16px 0 20px;
    background: transparent;
    border: none;
    border-right: 4px solid transparent;
    cursor: pointer;
    transition: background-color 0.12s ease;
    box-sizing: border-box;
    color: rgb(255, 255, 255);
    font-size: 14px;
    font-weight: 400;
    text-align: left;
    position: relative;
    text-decoration: none;
}

.text-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.text-item.active,
.text-item[aria-current="page"] {
    background: linear-gradient(267deg, rgba(74, 122, 255, 0.5) 11.41%, rgba(0, 29, 107, 0.3) 127.13%);
    border-right-color: rgb(132, 244, 251);
}

/* Responsive & Collapsed States */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .sidebar-separator {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .sidebar-header .sidebar-logo {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Focus States */
.sidebar-toggle:focus-visible,
.icon-button:focus-visible,
.section-label:focus-visible,
.text-item:focus-visible {
    outline: 2px solid rgb(132, 244, 251);
    outline-offset: 2px;
}

/* Sidebar Footer (HR Button) */
.sidebar-footer {
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.hr-button {
    width: 100%;
    background: rgb(255, 255, 255);
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.hr-button:hover {
    background: rgb(249, 250, 251);
}

.hr-button svg {
    stroke: rgb(99, 102, 241);
    flex-shrink: 0;
}

.hr-button-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.hr-button-label {
    font-size: 10px;
    font-weight: 600;
    color: rgb(107, 114, 128);
    letter-spacing: 0.5px;
}

.hr-button-role {
    font-size: 14px;
    font-weight: 600;
    color: rgb(17, 24, 39);
}

/* Role selector (header right) styling to match Figma */
.role-selector {
    background: rgb(255, 255, 255);
    color: rgb(36, 46, 61);
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 400;
    border: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.role-selector svg {
    stroke: var(--muted-foreground, #26303D);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modal Content */
.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 680px;
    padding: 40px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Recruit Flow Modal - Overlay */
.recruit-flow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Recruit Flow Modal - Content Container */
.recruit-flow-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    padding: 32px;
}

/* Recruit Flow Modal - Header */
.recruit-flow-header {
    margin-bottom: 32px;
}

.recruit-flow-title {
    font-size: 24px;
    font-weight: 600;
    color: rgb(17, 24, 39);
    margin-bottom: 12px;
}

.recruit-flow-description {
    font-size: 14px;
    color: rgb(107, 114, 128);
    line-height: 1.6;
}

/* Recruit Flow Modal - Options */
.recruit-flow-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.recruit-flow-option {
    border: 2px solid rgb(229, 231, 235);
    border-radius: 12px;
    padding: 24px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.recruit-flow-option:hover {
    border-color: rgb(191, 219, 254);
    background: rgb(249, 250, 251);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.recruit-flow-option-icon {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.recruit-flow-option-icon.integrated {
    background: rgb(59, 130, 246);
}

.recruit-flow-option-icon.manual {
    background: rgb(249, 115, 22);
}

.recruit-flow-option-icon svg {
    stroke: white;
}

.recruit-flow-option-title {
    font-size: 16px;
    font-weight: 600;
    color: rgb(17, 24, 39);
    margin-bottom: 8px;
}

.recruit-flow-option-description {
    font-size: 13px;
    color: rgb(107, 114, 128);
    line-height: 1.5;
}

/* Recruit Flow Modal - Responsive */
@media (max-width: 768px) {
    .recruit-flow-options {
        grid-template-columns: 1fr;
    }

    .recruit-flow-content {
        padding: 24px;
    }
}

/* Switch View Modal */
.switch-view-modal {
    max-width: 400px;
    padding: 24px;
}

.modal-header-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title-switch {
    font-size: 18px;
    font-weight: 600;
    color: rgb(17, 24, 39);
    margin: 0;
}

.modal-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close-btn:hover {
    background: rgb(243, 244, 246);
}

.modal-close-btn svg {
    stroke: rgb(107, 114, 128);
}

/* Sign Out Confirmation Modal */
.signout-confirm-modal {
    max-width: 400px;
    padding: 24px;
}

.signout-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    flex-direction: row-reverse;
}

.signout-confirm-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    border: none;
}

.signout-confirm-btn.signout-cancel {
    background: rgb(243, 244, 246);
    color: rgb(55, 65, 81);
}

.signout-confirm-btn.signout-cancel:hover {
    background: rgb(229, 231, 235);
}

.signout-confirm-btn.signout-confirm {
    background: var(--button-default-bg, #3366ff);
    color: var(--button-default-text, #ffffff);
}

.signout-confirm-btn.signout-confirm:hover {
    opacity: 0.9;
}

/* Role Options */
.role-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-option {
    background: rgb(249, 250, 251);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    width: 100%;
}

.role-option:hover {
    background: rgb(243, 244, 246);
}

.role-option.selected {
    background: rgb(239, 246, 255);
    border-color: rgb(59, 130, 246);
}

.role-option-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.role-option-indicator {
    width: 16px;
    height: 16px;
    border: 2px solid rgb(209, 213, 219);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
}

.role-option.selected .role-option-indicator {
    border-color: rgb(59, 130, 246);
    background: rgb(59, 130, 246);
    position: relative;
}

.role-option.selected .role-option-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.role-option-text {
    flex: 1;
}

.role-option-title {
    font-size: 14px;
    font-weight: 600;
    color: rgb(17, 24, 39);
    margin-bottom: 4px;
}

.role-option-desc {
    font-size: 13px;
    color: rgb(107, 114, 128);
    line-height: 1.4;
}

.role-option-check {
    font-size: 16px;
    color: rgb(59, 130, 246);
    font-weight: 600;
    margin-left: 8px;
}

/* Responsive - Mobile Sidebar Auto-Collapse */
@media (max-width: 768px) {

    /* Make sidebar collapsed by default on mobile (when not explicitly set) */
    .sidebar:not(.collapsed) {
        width: 80px;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 999;
    }

    .sidebar:not(.collapsed) .sidebar-logo,
    .sidebar:not(.collapsed) .sidebar-text,
    .sidebar:not(.collapsed) .sidebar-separator {
        display: none !important;
    }

    .sidebar:not(.collapsed) .sidebar-icons {
        width: 100%;
    }

    .sidebar:not(.collapsed) .sidebar-header {
        justify-content: center;
        padding: 0;
    }

    .sidebar:not(.collapsed) .sidebar-toggle {
        margin: 0;
    }

    /* When explicitly collapsed class is added, expand as overlay */
    .sidebar.collapsed {
        width: 282px;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 999;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.4);
    }

    .sidebar.collapsed .sidebar-logo {
        display: flex !important;
    }

    .sidebar.collapsed .sidebar-text,
    .sidebar.collapsed .sidebar-separator {
        display: flex !important;
    }

    .sidebar.collapsed .sidebar-icons {
        width: 56px;
    }

    .sidebar.collapsed .sidebar-header {
        justify-content: space-between;
        padding: 0 24px;
    }
}

/* Brand Footer Styling */
.sidebar-brand-footer {
    padding: 24px !important;
    position: relative !important;
    z-index: 10 !important;
    flex-shrink: 0 !important;
    margin-top: auto !important;
    background: transparent !important;
}

.brand-title {
    color: #FFFFFF !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    font-family: 'Noto Sans', sans-serif !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    margin-top: 4px !important;
    font-family: 'Noto Sans', sans-serif !important;
}

.sidebar.collapsed .sidebar-brand-footer {
    display: none !important;
}