/* Additional improvements for admin styles */ 

/* 管理後台樣式改進 */

:root {
    --primary-color: #4B0082;
    --primary-light: #6A0DAD;
    --primary-dark: #380062;
    --secondary-color: #6a5acd;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #f44336;
    --text-dark: #333;
    --text-muted: #666;
    --text-light: #fff;
    --border-color: #ddd;
    --shadow: 0 2px 5px rgba(0,0,0,0.1);
    --sidebar-width: 240px;
    --header-height: 60px;
    --font-family: 'Microsoft JhengHei', Arial, sans-serif;
}

/* 基本樣式重設 */
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    color: var(--text-dark);
    background-color: #f7f8fc;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* 管理後台頁首 */
.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: white;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
}

.admin-header .brand {
    display: flex;
    align-items: center;
}

.admin-header .logo {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
}

.admin-header .brand-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

.admin-header .nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-header .nav-item {
    color: var(--text-muted);
    font-size: 0.95rem;
    position: relative;
    transition: color 0.2s ease;
}

.admin-header .nav-item:hover {
    color: var(--primary-color);
}

.admin-header .nav-item.active {
    color: var(--primary-color);
}

.admin-header .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.admin-header .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(75, 0, 130, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.9rem;
    margin-left: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.admin-header .user-avatar:hover {
    background-color: var(--primary-color);
    color: white;
}

.admin-header .user-avatar.admin {
    background-color: var(--primary-color);
    color: white;
}

/* 管理後台容器 */
.admin-container {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
}

/* 側邊欄 */
.admin-sidebar {
    width: var(--sidebar-width);
    background-color: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 90;
    transition: all 0.3s ease;
}

.admin-sidebar .sidebar-header {
    padding: 20px 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
}

.admin-sidebar .sidebar-menu {
    padding: 15px 0;
}

.admin-sidebar .menu-category {
    margin-bottom: 20px;
}

.admin-sidebar .category-title {
    padding: 8px 15px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: color 0.2s ease;
}

.admin-sidebar .category-title:hover {
    color: var(--primary-color);
}

.admin-sidebar .category-title .category-chevron {
    font-size: 0.75rem;
    transition: transform 0.25s ease;
}

.admin-sidebar .menu-category.collapsed .category-title .category-chevron {
    transform: rotate(-90deg);
}

/* 子選單收縮動畫 */
.admin-sidebar .category-submenu {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    opacity: 1;
}

.admin-sidebar .menu-category.collapsed .category-submenu {
    max-height: 0;
    opacity: 0;
}

.admin-sidebar .menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-sidebar .menu-items li {
    position: relative;
}

.admin-sidebar .menu-items li a {
    display: block;
    padding: 10px 15px 10px 40px;
    color: var(--text-dark);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    position: relative;
}

.admin-sidebar .menu-items li a:before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-muted);
    transition: all 0.2s ease;
}

.admin-sidebar .menu-items li a:hover {
    background-color: rgba(75, 0, 130, 0.1);
    color: var(--primary-color);
}

.admin-sidebar .menu-items li a:hover:before {
    background-color: var(--primary-color);
}

.admin-sidebar .menu-items li.active a {
    background-color: rgba(75, 0, 130, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.admin-sidebar .menu-items li.active a:before {
    background-color: var(--primary-color);
    width: 8px;
    height: 8px;
}

/* 主內容區域 */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    background-color: #f7f8fc;
    min-height: calc(100vh - var(--header-height));
}

/* 響應式調整 */
@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .admin-header .brand-name {
        display: none;
    }
}

/* 頁尾 */
.admin-footer {
    text-align: center;
    padding: 15px 0;
    background-color: white;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 20px;
}

.admin-footer a {
    color: var(--primary-color);
}

/* 通用元素 */
.button {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.button:hover {
    background-color: var(--primary-dark);
}

.button.secondary {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.button.secondary:hover {
    background-color: var(--primary-light);
}

.button.danger {
    background-color: var(--danger-color);
}

.button.danger:hover {
    background-color: #d32f2f;
}

.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* 麵包屑導航 */
.breadcrumb {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    background-color: white;
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.breadcrumb-item {
    padding: 10px 15px;
    font-size: 0.9rem;
    position: relative;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    position: absolute;
    right: 0;
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-muted);
} 