/* Layout CSS */

.app-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Sidebar */
.sidebar-container {
    width: var(--sidebar-width);
    height: 100%;
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-color-light);
    transition: width var(--transition-time);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
}

.sidebar-logo {
    height: var(--header-height);
    line-height: var(--header-height);
    text-align: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color-light);
}

.sidebar-logo a {
    display: inline-block;
    width: 100%;
    height: 100%;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 18px;
    vertical-align: middle;
}

.sidebar-logo img {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 12px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.menu-item {
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.menu-title {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 50px;
    line-height: 50px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s;
}

.menu-title:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.menu-title i {
    margin-right: 10px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.menu-title .arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s;
}

.menu-item.active > .menu-title {
    color: var(--primary-color);
    background-color: #ecf5ff;
    border-right: 3px solid var(--primary-color);
}

.submenu {
    display: none;
    background-color: #fafafa;
}

.submenu .menu-title {
    padding-left: 54px;
    height: 40px;
    line-height: 40px;
}

/* Removed: .menu-item.expanded > .submenu { display: block; } */

.menu-item.expanded > .menu-title .arrow {
    transform: rotate(180deg);
}

/* Main Container */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--bg-color);
}

/* Header */
.header-container {
    height: var(--header-height);
    background-color: var(--bg-white);
    box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
}

.hamburger {
    font-size: 20px;
    cursor: pointer;
    margin-right: 20px;
    color: var(--text-regular);
}

.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-regular);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    margin: 0 8px;
    color: var(--text-placeholder);
}

.header-right {
    display: flex;
    align-items: center;
}

.header-action {
    padding: 0 12px;
    cursor: pointer;
    color: var(--text-regular);
    transition: all 0.3s;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header-action:hover {
    background-color: #f6f6f6;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Content */
.app-main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    position: relative;
}

.iframe-container {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-white);
    border-radius: 4px;
}

/* Collapsed Sidebar */
.app-wrapper.collapsed .sidebar-container {
    width: var(--sidebar-width-collapsed);
}

.app-wrapper.collapsed .sidebar-logo span {
    display: none;
}

.app-wrapper.collapsed .menu-title span,
.app-wrapper.collapsed .menu-title .arrow {
    display: none;
}

.app-wrapper.collapsed .submenu {
    /* Removed: display: none !important; */
    display: none;
}

.app-wrapper.collapsed .menu-item:hover .submenu {
    /* Removed: display: block !important; */
    display: block;
    position: absolute;
    left: var(--sidebar-width-collapsed);
    top: 0;
    width: 200px;
    background: var(--bg-white);
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0 4px 4px 0;
}

.app-wrapper.collapsed .menu-item:hover .submenu .menu-title {
    padding-left: 20px;
}
