/* Global Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c63ff;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
}

/* Navbar Styles */
.navbar {
    background: linear-gradient(90deg, var(--primary-color) 40%, var(--secondary-color) 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* Card Styles */
.product-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    height: 100%;
}

/* Product Card Image Container */
.product-card .img-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 15px 15px 0 0;
}

.product-card .img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .img-container img {
    transform: scale(1.1);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(108,99,255,0.1), rgba(13,110,253,0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.product-card:hover::before {
    opacity: 1;
}



.product-card .card-body {
    padding: 1.25rem;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}

.product-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

/* Badge Styles */
.badge-price {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.badge-price::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* Button Styles */
.btn-gradient {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-gradient::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-gradient:hover::after {
    width: 300px;
    height: 300px;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    color: white;
}

/* Sidebar Styles */
.filter-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.filter-card h5 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.list-group-item {
    border: none;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

/* Footer Styles */
footer {
    background: linear-gradient(90deg, var(--primary-color) 40%, var(--secondary-color) 100%);
    border-radius: 15px 15px 0 0;
    margin-top: 3rem;
    padding: 3rem 0;
}

.social-links a {
    transition: all 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
    opacity: 0.8;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .product-card {
        margin-bottom: 1rem;
    }
    
    .filter-card {
        margin-bottom: 1rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* General Styles */
body {
    font-family: 'Segoe UI', 'Roboto', 'Inter', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #222;
}

/* Header Styles */
.navbar {
    border-radius: 1.2rem;
    background: linear-gradient(90deg,#0d6efd 40%,#6c63ff 100%);
    box-shadow: 0 2px 12px rgba(13,110,253,0.08);
    margin-bottom: 1.5rem;
}

.navbar .navbar-brand {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: #fff !important;
    text-shadow: 0 2px 8px rgba(13,110,253,0.10);
}

.navbar-nav .nav-link {
    color: #fff !important;
    font-weight: 500;
    font-size: 1.08rem;
    border-radius: 0.7rem;
    margin: 0 0.2rem;
    transition: background 0.18s, color 0.18s;
}

.navbar-nav .nav-link.active, .navbar-nav .nav-link:hover {
    background: rgba(255,255,255,0.12);
    color: #fff !important;
}

/* Nút trên navbar */
.navbar .btn-outline-light {
    border-radius: 2rem;
    font-weight: 500;
    padding: 0.4em 1.2em;
    border-width: 2px;
    transition: background 0.18s, color 0.18s;
}

/* Product Card Styles */
.card {
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 0;
    word-break: break-word;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}



/* Sidebar Styles */
.sidebar .card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar .list-group-item {
    border: none;
    padding: 0.75rem 1rem;
}

.sidebar .list-group-item:hover {
    background-color: #f8f9fa;
}

.sidebar {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8faff 60%, #eaf6ff 100%) !important;
    color: #222 !important;
    box-shadow: 0 4px 24px rgba(44,62,80,0.06);
    border-radius: 1.2rem 0 0 1.2rem;
    padding-top: 0;
}

.sidebar .logo {
    font-size: 2rem;
    font-weight: bold;
    padding: 32px 0 24px 0;
    text-align: center;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #1a2a3a 0%, #2c3e50 100%);
    color: #fff;
    border-radius: 1.2rem 1.2rem 0 0;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 0.5rem;
}

.sidebar-nav a {
    color: #222 !important;
    opacity: 1 !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 0.7rem;
    font-size: 1.08rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 4px 0;
}

.sidebar-nav a.active, .sidebar-nav a:hover {
    color: #0d6efd !important;
    opacity: 1 !important;
}

.sidebar-nav a .fa-solid, .sidebar-nav a .fa {
    color: #222 !important;
    min-width: 22px;
    text-align: center;
    font-size: 1.2rem;
}

@media (max-width: 991.98px) {
    .sidebar { display: none !important; }
}

/* Footer Styles */
footer {
    margin-top: 3rem;
}

.social-links a {
    font-size: 1.5rem;
    margin-right: 1rem;
}

/* Product Detail Styles */
.product-detail-img {
    max-height: 400px;
    object-fit: contain;
    width: 100%;
}

/* Cart Styles */
.cart-item {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
}

.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    max-width: 100%;
}

/* Form Styles */
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.25);
}

/* Button Styles */
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .product-detail-img {
        max-height: 300px;
    }
}
@media (max-width: 992px) {
    .sidebar {
        min-height: unset;
        margin-bottom: 2rem;
    }
    .product-detail-img {
        max-height: 220px;
    }
    .cart-item img {
        width: 80px;
        height: 80px;
    }
}
@media (max-width: 768px) {
    .sidebar {
        margin-bottom: 2rem;
        min-height: unset;
    }
    .product-detail-img {
        max-height: 180px;
    }
    .cart-item img {
        width: 60px;
        height: 60px;
    }
    .footer .row > div {
        margin-bottom: 1.5rem;
    }
}
@media (max-width: 576px) {
    .product-detail-img {
        max-height: 120px;
    }
    .cart-item img {
        width: 40px;
        height: 40px;
    }
    .navbar-brand {
        font-size: 1.1rem;
    }
    .footer .row > div {
        margin-bottom: 1rem;
    }
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
}

.col-md-9 {
    min-height: 500px;
}

/* Đảm bảo các bảng, form, card không bị tràn trên mobile */
.table-responsive, .card, .form-control, .btn, .row, .col, .container {
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}

.container {
    max-width: 1440px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Header Admin */
.admin-header {
    background: #fff;
    border-radius: 0 0 1.2rem 1.2rem;
    box-shadow: 0 2px 12px rgba(13,110,253,0.08);
    z-index: 1001;
}

/* Offcanvas sidebar (Bootstrap) */
.offcanvas .sidebar-nav a {
    color: #222;
    background: none;
    border-radius: 0.7rem;
    font-weight: 500;
}
.offcanvas .sidebar-nav a.active, .offcanvas .sidebar-nav a:hover {
    background: linear-gradient(90deg,#0d6efd 60%,#6c63ff 100%);
    color: #fff;
}

/* Đảm bảo bảng, card, badge đồng bộ */
.table thead th {
    background: #f4f6f9;
    font-weight: 600;
}
.card {
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(13,110,253,0.04);
}
.card-header {
    border-radius: 1rem 1rem 0 0;
    font-weight: 600;
}
.badge {
    font-size: 1em;
    border-radius: 0.5em;
    padding: 0.5em 1em;
}

/* Nút nhỏ trong bảng */
.btn-sm {
    font-size: 0.95em;
    padding: 0.35em 0.8em;
    border-radius: 0.5em;
}

/* --- UI/UX nâng cấp cho giao diện user --- */

/* Card sản phẩm */
.card.product-card {
    border-radius: 1.2rem;
    box-shadow: 0 4px 24px rgba(44,62,80,0.08);
    border: none;
    transition: all 0.3s ease;
    background: #fff;
    overflow: hidden;
}
.card.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 32px rgba(44,62,80,0.16);
    border: 1.5px solid rgba(52,152,219,0.2);
}

.card.product-card .card-body {
    padding: 1.5rem;
    background: #fff;
}
.card.product-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}
.card.product-card .card-text {
    color: #3498db;
    font-size: 1.08rem;
    font-weight: 500;
}
.card.product-card .btn {
    border-radius: 2rem;
    font-weight: 500;
    padding: 0.4em 1.2em;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    color: #fff;
    transition: all 0.3s ease;
}
.card.product-card .btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52,152,219,0.2);
}

/* Badge giá, giảm giá, trạng thái */
.badge-price {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    font-size: 1.05em;
    border-radius: 0.7em;
    padding: 0.5em 1.1em;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(52,152,219,0.15);
}

/* Sidebar user, bộ lọc */
.user-sidebar, .filter-card {
    border-radius: 1.2rem;
    box-shadow: 0 2px 12px rgba(44,62,80,0.06);
    background: linear-gradient(135deg, #f8faff 60%, #eaf6ff 100%) !important;
    color: #222 !important;
    padding: 1.2rem 1rem;
    margin-bottom: 1.5rem;
}
.user-sidebar h5, .filter-card h5 {
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Nút, input, form */
.btn-primary, .btn-gradient {
    background: linear-gradient(90deg,#0d6efd 60%,#6c63ff 100%);
    border: none;
    color: #fff;
    font-weight: 500;
    border-radius: 2rem;
    padding: 0.5em 1.5em;
    transition: background 0.18s, color 0.18s;
}
.btn-primary:hover, .btn-gradient:hover {
    background: linear-gradient(90deg,#6c63ff 60%,#0d6efd 100%);
    color: #fff;
}
.form-control, .form-select {
    border-radius: 1.2rem;
    border: 1.5px solid #e0e7ff;
    font-size: 1.05rem;
    padding: 0.7em 1.1em;
    background: #f8faff;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.form-control:focus, .form-select:focus {
    border-color: #6c63ff;
    box-shadow: 0 0 0 0.2rem rgba(108,99,255,0.12);
    background: #fff;
}

/* Profile, avatar, đơn hàng */
.profile-card, .order-card {
    border-radius: 1.2rem;
    box-shadow: 0 2px 12px rgba(13,110,253,0.06);
    background: #fff;
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
}
.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #6c63ff;
    margin-bottom: 1rem;
}

/* Hiệu ứng hover, transition chung */
a, .btn, .card, .form-control, .form-select {
    transition: all 0.18s;
}

/* Responsive nâng cao */
@media (max-width: 1200px) {
    .card.product-card .img-container { height: 180px; }
}
@media (max-width: 992px) {
    .card.product-card .img-container { height: 140px; }
    .profile-card, .order-card { padding: 1.2rem 0.7rem; }
}
@media (max-width: 768px) {
    .navbar .navbar-brand { font-size: 1.2rem; }
    .card.product-card .img-container { height: 100px; }
    .profile-avatar { width: 60px; height: 60px; }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg,#f4f6f9 25%,#e0e7ff 50%,#f4f6f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.2s infinite linear;
    border-radius: 0.7rem;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Tối ưu responsive */
@media (max-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    .product-card .img-container {
        height: 200px;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    .product-card .img-container {
        height: 180px;
    }
    .navbar-brand {
        font-size: 1.8rem;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 960px;
    }
    .product-card .img-container {
        height: 160px;
    }
    .navbar-brand {
        font-size: 1.5rem;
    }
    .filter-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 720px;
    }
    .product-card .img-container {
        height: 140px;
    }
    .navbar-brand {
        font-size: 1.3rem;
    }
    .card-title {
        font-size: 1rem;
    }
    .badge-price {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    .btn-gradient {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .container {
        max-width: 540px;
        padding-left: 10px;
        padding-right: 10px;
    }
    .product-card .img-container {
        height: 120px;
    }
    .navbar-brand {
        font-size: 1.1rem;
    }
    .card-title {
        font-size: 0.9rem;
    }
    .badge-price {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    .btn-gradient {
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
    .filter-card {
        padding: 1rem;
    }
    .filter-card h5 {
        font-size: 1rem;
    }
}

/* Tối ưu hiệu năng */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-card .img-container img,
    .btn-gradient,
    .badge-price {
        transition: none;
    }
    .product-card::before,
    .btn-gradient::after,
    .badge-price::before {
        display: none;
    }
}

/* Tối ưu dark mode */
@media (prefers-color-scheme: dark) {
    .product-card {
        background: #1a1a1a;
    }
    .product-card .card-body {
        background: rgba(26, 26, 26, 0.95);
    }
    .card-title {
        color: #fff;
    }
    .filter-card {
        background: #1a1a1a;
        color: #fff;
    }
    .list-group-item {
        background: #1a1a1a;
        color: #fff;
    }
    .list-group-item:hover {
        background: #2a2a2a;
    }
}

/* Toast thông báo giỏ hàng */
.toast-container {
    z-index: 1080;
}
.toast {
    min-width: 260px;
    font-size: 1.05rem;
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(13,110,253,0.12);
    background: linear-gradient(90deg,#0d6efd 60%,#6c63ff 100%);
    color: #fff;
    border: none;
}
.toast .btn-close {
    filter: invert(1);
}

/* Ẩn spinner của input number trên mọi trình duyệt */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Tăng chiều rộng input số lượng và căn giữa */
.input-group input[type=number] {
    min-width: 48px;
    max-width: 60px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    border-left: none;
    border-right: none;
    box-shadow: none !important;
}
.input-group .btn {
    min-width: 36px;
    font-size: 1.1rem;
    padding: 0.25rem 0.5rem;
}

/* Sidebar, filter-card, user-sidebar, and info cards with light blue gradient */
.sidebar, .filter-card, .user-sidebar, .category-card, .new-products-card {
    background: linear-gradient(135deg, #f8faff 60%, #eaf6ff 100%) !important;
    color: #222 !important;
    box-shadow: 0 4px 24px rgba(44,62,80,0.06);
    border-radius: 1.2rem;
}

/* Card title, icon, and text color for contrast */
.sidebar h5, .filter-card h5, .user-sidebar h5, .category-card h5, .new-products-card h5 {
    color: #2980b9 !important;
    font-weight: 700;
}

.sidebar .list-group-item, .filter-card .list-group-item, .user-sidebar .list-group-item {
    background: transparent !important;
    color: #222 !important;
    border-radius: 0.7rem;
    transition: background 0.18s, color 0.18s;
}
.sidebar .list-group-item:hover, .filter-card .list-group-item:hover, .user-sidebar .list-group-item:hover {
    background: #eaf6ff !important;
    color: #3498db !important;
}

/* Sản phẩm mới, danh mục, filter card, ... */
.card.new-products-card, .card.category-card, .card.filter-card {
    background: linear-gradient(135deg, #f8faff 60%, #eaf6ff 100%) !important;
    color: #222 !important;
    border-radius: 1.2rem;
    box-shadow: 0 4px 24px rgba(44,62,80,0.06);
}

/* Đảm bảo các card nhỏ không bị đen */
.card {
    background: #fff;
}

/* Card sản phẩm mới trên trang chủ */
.new-products-card {
    background: linear-gradient(135deg, #f8faff 60%, #eaf6ff 100%) !important;
    color: #222 !important;
    border-radius: 1.2rem;
    box-shadow: 0 4px 24px rgba(44,62,80,0.06);
}
.new-products-card .card-header {
    background: transparent;
    border-bottom: none;
    color: #2980b9;
    font-weight: 700;
}
.new-products-card .list-group-item {
    background: transparent !important;
    color: #222 !important;
    border: none;
    border-radius: 0.7rem;
    transition: background 0.18s, color 0.18s;
}
.new-products-card .list-group-item:hover {
    background: #eaf6ff !important;
    color: #3498db !important;
}

/* Responsive table for order history */
@media (max-width: 767.98px) {
  .table-responsive-stack tr {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
    background: #fff;
  }
  .table-responsive-stack td, .table-responsive-stack th {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    padding: 0.5rem 1rem;
  }
  .table-responsive-stack thead {
    display: none;
  }
  .table-responsive-stack td:before {
    content: attr(data-label);
    font-weight: bold;
    display: block;
    margin-bottom: 0.25rem;
    color: #007bff;
  }
}

.footer-newsletter {
    display: flex;
    align-items: center;
    gap: 10px;
}
.footer-newsletter input[type="email"] {
    flex: 1;
    min-width: 180px;
}
.footer-newsletter button,
.footer-newsletter .btn {
    margin-left: 10px;
} 