:root {
    --primary-color: #0ABAB5;
    --secondary-color: #A3D9A5;
    --info-color: #5bc0de;
    --warning-color: #FFA726;
    --danger-color: #EF5350;
    --text-color: #333333;
    --text-light: #777777;
    --background-color: #FFFFFF;
    --background-light: #F5F5F5;
}

body {
    font-family: 'Roboto', 'Helvetica', sans-serif;
    color: var(--text-color);
    background-color: var(--background-light);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header styles */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
}

nav.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
    z-index: 9999;
}

.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    z-index: 1000;
    padding: 0.5rem;
    line-height: 1;
}

.mobile-nav-toggle i {
    pointer-events: none; /* 這確保圖示不會捕獲點擊事件 */
}

.logo {
    display: flex;
    align-items: center;
}

.logo-image {
    width: 118px;
    height: auto;
    margin-right: 10px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin: 0 0.5rem 0 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.custom-dropdown {
    position: relative;
    display: inline-block;
}

.custom-dropbtn {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.custom-dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 130px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    right: 0;  /* 讓下拉內容靠右對齊 */
    border-radius: 4px;
    overflow: hidden;
}

.custom-dropdown-content a {
    color: black;
    margin: 0;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
}

.custom-dropdown-content a:hover {
    background-color: #f1f1f1;
}

.custom-dropdown:hover .custom-dropdown-content {
    display: block;
}

.custom-dropdown:hover .custom-dropbtn {
    background-color: #0998a3;  /* 使用稍深的主色調 */
}

/* Button styles */
.btn-default {
	padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn {
	background-color: var(--primary-color);
	color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-danger {
	background-color: var(--danger-color);
    color: white;
}

.btn-logout-layout, .btn-primary-layout {
	background-color: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.btn-logout-layout:hover, .btn-primary-layout:hover {
    background-color: #098f8a; /* 稍微深一點的主色調 */
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.button-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.button-group {
	margin-left: 5px;
}

.col-5p {
    width: 5.2%;
}

.col-min100p {
    min-width: 100px;
}

.col-min110p {
    min-width: 110px;
}

.col-min140p {
    min-width: 140px;
}

.col-min150p {
    min-width: 150px;
}

.col-min200p {
    min-width: 200px;
}

/* 圖片彈窗 */
.clickable-image {
    cursor: pointer;
    transition: opacity 0.3s;
}

.clickable-image:hover {
    opacity: 0.7;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80vh;
    object-fit: contain;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}


/* Login page styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 218px); /* 減去頁首和頁尾的高度 */
    padding: 2rem 0;
}

.login-form {
    background-color: var(--background-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
}

.login-logo .logo-image {
    width: 280px;
    height: auto;
}

.login-form h2 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    margin-top: 0;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.login-form .btn-login,
.btn-login {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.login-form .btn-login:hover,
.btn-login:hover {
    background-color: #098f8a; /* 稍微深一點的主色調 */
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.login-links {
    text-align: center;
    margin-top: 1rem;
}

.login-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

/* Alert styles */
.alert {
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* Dashboard styles */
.dashboard {
    padding: 2rem 0;
}

.dashboard__title {
    margin-bottom: 2rem;
}

.dashboard__stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--background-color);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: calc(50% - 1rem);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.dashboard__recent-orders,
.dashboard__popular-products {
    background-color: var(--background-color);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: var(--background-light);
}

.td_control{
	display: table-cell;
}

.dashboard__popular-products ul {
    list-style-type: none;
    padding: 0;
}

.dashboard__popular-products li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd;
}

.forgot-account-message {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
    color: #666;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}


/* Select2 樣式覆蓋 */
.select2-container--bootstrap4 .select2-selection--single {
    height: calc(1.5em + 0.75rem + 2px) !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    color: #6c757d;
    line-height: calc(1.5em + 0.75rem);
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    position: absolute;
    top: 50%;
    right: 3px;
    width: 20px;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
    top: 60%;
    border-color: #6c757d transparent transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0 4px;
    width: 0;
    height: 0;
    left: 50%;
    margin-left: -4px;
    margin-top: -2px;
    position: absolute;
}

/* 分頁樣式 */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    position: relative;
    z-index: 1;
    width: fit-content;
}

.pagination {
    display: flex;
    list-style-type: none;
    padding: 0;
}

.pagination li {
    margin: 0 0.25rem;
}

.pagination a {
    display: block;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
}

.pagination .active a {
    background-color: var(--primary-color);
    color: white;
}

.page-size-selector {
    display: flow;
    align-items: center;
    margin-top: -1rem;
}

.page-size-selector label {
    margin-right: 0.5rem;
}

.page-size-selector select {
    padding: 0.25rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 搜索表單樣式 */
.search-form {
    margin-bottom: 1rem;
}

.search-form input[type="text"],
.search-form select {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-form input[type="submit"] {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-form input[type="submit"]:hover {
    background-color: var(--secondary-color);
}


/* userprofile styles */
.agm-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 218px);
    padding: 2rem 0;
}

.agm-form {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    
}

.agm-form h2 {
    text-align: center;
    margin-bottom: 20px;
}

.agm-form-group {
    margin-bottom: 15px;
}

.agm-form-group label {
    display: block;
    margin-bottom: 5px;
}

.agm-form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.agm-btn {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.agm-btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.agm-btn-primary:hover {
    background-color: #098f8a; /* 稍微深一點的主色調 */
    color: white;
}

.agm-btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.agm-btn-secondary:hover {
    background-color: #5a6268;
    color: white;
}

.agm-btn-danger {
	padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
	background-color: var(--danger-color);
    color: white;
}

.agm-btn-danger:hover {
	background-color: #721c24;
}

.agm-links {
    text-align: center;
    margin-top: 1rem;
}

.agm-link {
    color: var(--primary-color);
    text-decoration: none;
}

.agm-link:hover {
    text-decoration: underline;
}

.agm-mgb {
	margin-bottom: 0.5rem;
}


/* Footer styles */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Responsive design */
@media (max-width: 1024px) {
    .dashboard__stats {
        flex-direction: column;
    }

    .stat-card {
        width: 100%;
        margin-bottom: 1rem;
    }

    .login-form {
        padding: 1.5rem;
    }
    
    .login-logo .logo-image {
        width: 80px;
    }

    .logo-image {
        width: 30px;
    }

    .logo-text {
        font-size: 1.2rem;
    }
    
     nav.container {
        flex-direction: column;
        align-items: flex-start;
    }

    .mobile-nav-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 80%;
        max-width: 180px;
        background-color: var(--primary-color);
        padding: 4rem 1rem 1rem;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 999;
        flex-direction: column;
        align-items: flex-start;
        overflow-y: auto;
    }

    /* .nav-links {
        margin-top: 1rem;
        flex-wrap: wrap;
    } */

    .nav-links a {
        margin: 0.25rem;
    }

    .nav-links.active {
        transform: translateX(0);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    }

    .nav-links a, .custom-dropbtn {
        margin: 0.5rem 0;
        width: 100%;
        text-align: left;
    }
    
    .custom-dropdown {
        display: block;
        margin-top: 10px;
        width: 100%;
    }

    .custom-dropbtn {
        width: 100%;
        text-align: left;
    }

    .custom-dropdown-content {
        /* width: 100%;
        position: static; */
        position: static;
        display: none;
        background-color: rgba(255, 255, 255, 0.1);
        box-shadow: none;
        width: 100%;
        padding-left: 1rem;
    }

    .custom-dropdown-content a {
        color: white;
    }

    .custom-dropdown-content.show {
        display: block;
    }
    
}

@media (max-height: 600px) {
    .login-container {
        align-items: flex-start;
        padding-top: 1rem;
    }
}