/*------------------------------------------------------------------
[Master Layout Styles]

1. .page-container / Defines the main two-column layout for pages with a sidebar.
2. .page-sidebar / Styling for the left sidebar container.
3. .page-main-content / Styling for the right main content area.

-------------------------------------------------------------------*/
.page-container {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    /* Defines the space between sidebar and main content */
    padding: 0;
}

.page-sidebar {
    width: 280px;
    /* Fixed width for the sidebar */
    flex-shrink: 0;
    /* Prevents the sidebar from shrinking */
    background-color: var(--secondary-bg);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    position: sticky;
    top: 100px;
    /* Adjust based on header height */
}

.page-main-content {
    flex-grow: 1;
    /* Allows the main content to take up the remaining space */
    min-width: 0;
    /* Prevents content from overflowing */
}


/* General Page Layout */
/* .main-content {
    flex-grow: 1;

} */
.main-content {
    flex-grow: 1;
        padding: 24px 32px;
    padding-top: calc(var(--header-height) + 24px);

}
/* Breadcrumb */
.breadcrumb {
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-size: 16px;
    padding: 12px 0px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.breadcrumb a {
    color: var(--text-accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 8px;
}

.breadcrumb .current {
    color: var(--text-primary);
}


/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    color: #c9d1d9;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: 1px solid #30363d;
    color: #8b949e;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: #8b949e;
    margin-bottom: 20px;
}

.modal-form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-confirm {
    background-color: #238636;
    color: #fff;
    border: 1px solid #30363d;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}

/* Custom Select Styles */
.custom-select-wrapper {
    flex-grow: 1;
    position: relative;
}

.custom-select {
    position: relative;
    font-family: inherit;
}

.custom-select-trigger {
    background-color: #0d1117;
    border: 1px solid #30363d;
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #8b949e;
}

.custom-select.open .custom-select-trigger,
.custom-select.active .custom-select-trigger {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.arrow {
    width: 10px;
    height: 10px;
    border-left: 2px solid #8b949e;
    border-bottom: 2px solid #8b949e;
    transform: rotate(-45deg);
    transition: transform 0.3s ease;
}

.custom-select.open .arrow,
.custom-select.active .arrow {
    transform: rotate(135deg);
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-top: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    display: none;
    z-index: 2100;
    /* Increased z-index to ensure it appears above modal content */
}

.custom-select.open .custom-options,
.custom-select.active .custom-options {
    display: block;
}

.custom-option {
    padding: 12px 15px;
    cursor: pointer;
    color: #c9d1d9;
}

.custom-option:hover,
.custom-option.selected {
    background-color: #1f6feb;
    color: #fff;
}


/*
 * 组件样式文件 - 可复用组件定义
 * 包含按钮、卡片、模态框、标签等通用组件
 */


/* General button focus state */
.btn:focus,
.btn:active,
button:focus,
button:active {
    outline: none !important;
    box-shadow: none !important;
}

/* 按钮组件扩展样式 */
.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-green);
    color: var(--accent-green);
}

.btn-outline:hover {
    background: var(--accent-green);
    color: var(--primary-bg);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red), #cc3333);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #cc3333, #aa2222);
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-yellow), #dd9900);
    color: var(--primary-bg);
}

.btn-info {
    background: linear-gradient(135deg, var(--accent-blue), #3366cc);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #238636, #1e7e34);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e7e34, #155d27);
}


/* 加载状态按钮 */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    0% {
        transform: translateY(-50%) rotate(0deg);
    }

    100% {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* 卡片组件变体 */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--accent-green);
    box-shadow: var(--shadow-medium);
}

.card-header {
    padding: 0px;
    border-bottom: 1px solid var(--border-color);
    background: var(--secondary-bg);
}

.card-footer {

    justify-content: space-between;
    align-items: center;
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* 高亮卡片 */
.card-highlighted {
    border-color: var(--accent-green);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.card-highlighted::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-green), #00ccaa);
}

/* 模态框组件 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: var(--border-radius-small);
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: var(--accent-red);
    background: rgba(255, 68, 68, 0.1);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 标签/徽章组件 */
.tag,
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--border-radius-small);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-primary,
.badge-primary {
    background: var(--accent-green);
    color: var(--primary-bg);
}

.tag-secondary,
.badge-secondary {
    background: var(--secondary-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.tag-danger,
.badge-danger {
    background: var(--accent-red);
    color: white;
}

.tag-warning,
.badge-warning {
    background: var(--accent-yellow);
    color: var(--primary-bg);
}

.tag-info,
.badge-info {
    background: var(--accent-blue);
    color: white;
}

.tag-success,
.badge-success {
    background: var(--accent-green);
    color: var(--primary-bg);
}

/* 进度条组件 */
.progress {
    width: 100%;
    height: 8px;
    background: var(--secondary-bg);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), #00ccaa);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* 输入框组件 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23888888' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

/* 复选框和单选框 */
.form-checkbox,
.form-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 10px;
}

.form-checkbox input,
.form-radio input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-green);
}

/* 通知组件 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(135deg, var(--accent-green), #00cc6a);
}

.notification-error {
    background: linear-gradient(135deg, var(--accent-red), #cc3333);
}

.notification-warning {
    background: linear-gradient(135deg, var(--accent-yellow), #dd9900);
}

.notification-info {
    background: linear-gradient(135deg, var(--accent-blue), #3366cc);
}

/* 工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--primary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    margin-bottom: 5px;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--border-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 加载骨架屏 */
.skeleton {
    background: linear-gradient(90deg, var(--secondary-bg) 25%, var(--tertiary-bg) 50%, var(--secondary-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius-small);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 15px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* 状态指示器 */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--border-radius-small);
    font-size: 0.85rem;
    font-weight: 500;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-online {
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent-green);
}

.status-online::before {
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

.status-offline {
    background: rgba(136, 136, 136, 0.1);
    color: var(--text-muted);
}

.status-offline::before {
    background: var(--text-muted);
}

.status-busy {
    background: rgba(255, 68, 68, 0.1);
    color: var(--accent-red);
}

.status-busy::before {
    background: var(--accent-red);
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* 分页组件 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 40px 0;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--secondary-bg);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-small);
    transition: all 0.3s ease;
}

.pagination-item:hover,
.pagination-item.active {
    background: var(--accent-green);
    color: var(--primary-bg);
    border-color: var(--accent-green);
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    color: var(--text-muted);
}

.breadcrumb-link {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: var(--accent-green);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}