/* --- Reset & Base --- */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0; padding: 0; box-sizing: border-box;
}

body {
    background-color: #282a36 !important;
    color: #f8f8f2 !important;
    font-family: 'Lexend', sans-serif !important;
}

/* --- Layout chính để tách Sidebar và Content --- */
#main-wrapper {
    display: flex;
    min-height: 100vh;
}

.page-wrapper {
    margin-left: 280px; /* Độ rộng của sidebar để không bị đè */
    width: calc(100% - 280px);
    background-color: transparent !important;
}

/* --- Tối ưu Sidebar LoopSoft --- */
.left-sidebar {
    width: 280px;
    height: 100vh;
    background: #1e1f29 !important; /* Tối sâu của Dracula */
    position: fixed;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    padding: 0 10px; /* Khoảng cách bao quanh để tạo khối */
    border-right: 1px solid rgba(255, 255, 255, 0.03);
}

/* Logo */
.sidebar-header {
    padding: 30px 10px;
    text-align: center;
}
.logo-wrapper img {
    max-width: 150px;
    filter: drop-shadow(0 0 8px rgba(189, 147, 249, 0.4));
}

/* Balance */
.sidebar-balance { padding: 0 10px 20px 10px; }
.balance-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}
.balance-title { color: #6272a4; font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.balance-amount { color: #50fa7b; font-size: 22px; font-weight: 800; }
.balance-amount small { font-size: 11px; color: #f8f8f2; opacity: 0.6; font-weight: 500; }

/* Menu cuộn được */
.scroll-sidebar { overflow-y: auto; flex-grow: 1; }
.scroll-sidebar::-webkit-scrollbar { width: 0px; }

/* Menu Items */
.sidebar-nav ul { list-style: none !important; padding: 0 !important; }

.sidebar-item { margin-bottom: 5px; }

.sidebar-link {
    display: flex !important;
    align-items: center;
    padding: 14px 20px !important;
    color: #a0a0b0 !important; /* Màu xám mờ của LoopSoft */
    border-radius: 16px;
    font-weight: 600;
    transition: 0.3s;
    font-size: 13.5px;
    text-decoration: none;
}

.sidebar-link i {
    margin-right: 15px;
    font-size: 18px;
    color: #bd93f9; /* Icon tím Dracula */
}

/* Trạng thái Selected (Tím sáng và bo góc chuẩn) */
.sidebar-item.selected .sidebar-link,
.sidebar-link:hover {
    background: rgba(189, 147, 249, 0.1) !important;
    color: #bd93f9 !important; /* Trắng hoặc Tím khi được chọn */
}

.nav-small-cap {
    color: #6272a4;
    font-size: 11px;
    font-weight: 800;
    padding: 25px 0 10px 20px;
    letter-spacing: 2px;
}

/* User Profile Footer Bottom */
.sidebar-user-footer {
    padding: 20px 10px 10px;
    margin-top: auto; /* Đẩy xuống đáy */
}

.user-info-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.user-avatar-letter {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #ff79c6 0%, #bd93f9 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    font-size: 20px;
    margin-right: 12px;
}

.user-meta { flex-grow: 1; display: flex; flex-direction: column; }
.user-meta-name { color: #fff; font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.user-meta-role { color: #6272a4; font-size: 10px; font-weight: 600; }

.user-logout { color: #ff5555; font-size: 16px; transition: 0.3s; padding: 5px; }
.user-logout:hover { color: #fff; }

.footer-section {
    background-color: #12121c;
    padding: 60px 40px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-family: 'Lexend', sans-serif;
}

.footer-title {
    color: #bd93f9; /* Neon Purple from Dracula */
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 25px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #6272a4; /* Muted Blue */
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: 0.3s;
}

.footer-links a:hover {
    color: #f8f8f2;
}

.footer-links i {
    width: 20px;
    color: #8be9fd; /* Cyan accent */
    margin-right: 10px;
}

/* System Status Card */
.status-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 25px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.status-label {
    color: #6272a4;
    font-size: 11px;
    font-weight: 700;
}

.status-value {
    color: #bd93f9;
    font-size: 11px;
    font-weight: 800;
}

.status-value.uptime {
    color: #50fa7b; /* Neon Green */
}

.status-divider {
    border-color: rgba(255, 255, 255, 0.05);
    margin: 15px 0;
}

.status-quote {
    font-style: italic;
    font-size: 12px;
    color: #f8f8f2;
    margin: 0;
    text-align: center;
}

/* Footer Bottom */
.footer-divider {
    border-color: rgba(255, 255, 255, 0.05);
    margin: 40px 0 20px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    color: #6272a4;
    font-size: 12px;
    font-weight: 700;
    margin: 0;
}

.payment-icons {
    color: #6272a4;
    font-size: 20px;
    display: flex;
    gap: 15px;
}

.auth-buttons-fixed {
    position: fixed; /* Cố định vị trí khi cuộn trang */
    top: 50px;       /* Cách mép trên 50px */
    right: 50px;     /* Cách mép phải 50px */
    z-index: 9999;   /* Đảm bảo nó luôn nằm trên cùng của các phần tử khác */
    display: flex;
    gap: 15px;       /* Khoảng cách giữa 2 nút */
}

/* Hiệu ứng nổi lên khi hover đã làm ở bước trước */
.btn-auth {
    font-family: 'Lexend', sans-serif;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 24px;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.btn-auth:hover {
    transform: translateY(-5px); /* Bay lên */
    box-shadow: 0 10px 25px rgba(255, 45, 133, 0.3); /* Bóng đổ màu hồng tím */
}

.btn-login {
    background: linear-gradient(135deg, #7612ff 0%, #ff2d85 100%);
    color: white !important;
}

.btn-register {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white !important;
}
/* Filter Buttons */
.btn-filter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #6272a4;
    padding: 8px 25px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 12px;
    transition: 0.3s;
}

.btn-filter.active, .btn-filter:hover {
    background: var(--drac-pur);
    color: #fff;
    box-shadow: 0 0 15px rgba(189, 147, 249, 0.4);
}

/* Product Card Deep Design */
.product-card {
    background: rgba(30, 30, 45, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 35px; /* Bo góc cực sâu */
    padding: 25px;
    height: 100%;
    transition: 0.4s ease;
}

.product-card:hover {
    transform: translateY(-10px);
    border-color: var(--drac-pnk);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.img-container {
    position: relative;
    border-radius: 25px;
    overflow: hidden;
}

.product-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 25px;
}

.badge-cat {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: #50fa7b;
    padding: 5px 15px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    border: 1px solid #50fa7b;
}

.product-title {
    font-weight: 800;
    color: #fff;
    font-size: 1.2rem;
}

.product-des {
    font-size: 12px;
    color: #6272a4;
    line-height: 1.6;
    height: 40px;
    overflow: hidden;
}

.price-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 15px;
    margin-top: 15px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.price-label { font-size: 11px; color: #6272a4; font-weight: 700; text-decoration: line-through; }
.price-value { font-weight: 800; color: #fff; }
.text-pink { color: var(--drac-pnk); }

.btn-buy {
    background: var(--drac-pnk);
    color: #fff;
    padding: 10px 20px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
    border: none;
}

.link-detail {
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    opacity: 0.6;
}

.link-detail:hover { opacity: 1; color: var(--drac-pnk); }

/* Container bọc phần giá */
.price-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 15px 20px;
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Nhãn Lifetime phía trên % */
.access-type-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #6272a4;
    margin-bottom: 2px;
}

/* Con số -30% màu xanh neon */
.sale-percent {
    font-size: 22px;
    font-weight: 800;
    color: #50fa7b; /* Xanh lá Dracula neon */
    font-style: italic;
    line-height: 1;
}

/* Khối số tiền bên phải */
.price-numbers {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Giá cũ có gạch ngang màu đỏ rực */
.old-price {
    font-size: 16px;
    color: #6272a4;
    position: relative;
    font-weight: 500;
}

.old-price::after {
    content: "";
    position: absolute;
    left: -2px;
    top: 50%;
    width: calc(100% + 4px);
    height: 2px;
    background: #ff5555; /* Màu đỏ gạch ngang */
    transform: translateY(-50%);
}

/* Giá mới siêu to khổng lồ */
.new-price {
    font-size: 28px;
    font-weight: 800;
    color: #50fa7b;
    letter-spacing: -1px;
}

.new-price small {
    font-size: 12px;
    color: #f8f8f2;
    opacity: 0.6;
    margin-left: 2px;
}
.sale-tag{
    color:#50fa7b;
}
/* ================= ADMIN PANEL DARK DRACULA ================= */

/* Card */
.card {
    background: rgba(30, 31, 41, 0.8) !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    backdrop-filter: blur(10px);
}

.card-body {
    padding: 25px !important;
}

/* Tabs */
.nav-tabs {
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}

.nav-tabs .nav-link {
    color: #6272a4 !important;
    font-weight: 700;
    border: none !important;
    padding: 12px 20px;
    border-radius: 12px;
    transition: 0.3s;
}

.nav-tabs .nav-link:hover {
    color: #bd93f9 !important;
    background: rgba(189,147,249,0.08);
}

.nav-tabs .nav-link.active {
    background: rgba(189,147,249,0.15) !important;
    color: #bd93f9 !important;
    box-shadow: 0 0 15px rgba(189,147,249,0.3);
}

/* Label */
label {
    color: #f8f8f2 !important;
    font-weight: 600;
    font-size: 13px;
}

/* Input */
.form-control {
    background: rgba(0,0,0,0.3) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    color: #fff !important;
    border-radius: 12px !important;
    padding: 10px 14px;
    transition: 0.3s;
}

.form-control:focus {
    border-color: #bd93f9 !important;
    box-shadow: 0 0 10px rgba(189,147,249,0.3) !important;
    background: rgba(0,0,0,0.4) !important;
}

/* Select */
select.form-control {
    background: rgba(0,0,0,0.3) !important;
    color: #fff !important;
}

/* Placeholder */
::placeholder {
    color: #6272a4 !important;
}

/* Button */
.btn-primary {
    background: linear-gradient(135deg, #bd93f9, #ff79c6) !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 700;
    padding: 10px 25px;
    transition: 0.3s;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(189,147,249,0.4);
}

/* Note text (i tag) */
i {
    color: #6272a4;
    font-size: 12px;
}

/* Tab content spacing */
.tab-content {
    margin-top: 20px;
}

/* Form line fix */
.form-line {
    width: 100%;
}

/* Input spacing đẹp hơn */
.col-sm-4, .col-sm-12 {
    margin-bottom: 15px;
}
#mobile-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 9999;
    background: #bd93f9;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    display: none; /* Mặc định ẩn trên PC */
}

/* Lớp phủ mờ khi mở menu */
#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 999;
    display: none;
}

@media (max-width: 991.98px) {
    #mobile-toggle { display: block; } /* Hiện nút trên Mobile */

    .left-sidebar {
        position: fixed;
        left: -280px; /* Đẩy sidebar ra ngoài màn hình */
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transition: 0.3s all ease;
        background: #1a1a2e;
    }

    /* Khi Sidebar có class 'active' thì trượt vào */
    .left-sidebar.active {
        left: 0;
    }

    /* Page wrapper tràn màn hình trên mobile */
    .page-wrapper {
        margin-left: 0 !important;
        width: 100%;
        padding-top: 60px; /* Chừa chỗ cho nút menu */
    }

    /* Hiện lớp phủ khi menu mở */
    .sidebar-open #sidebar-overlay {
        display: block;
    }
}

#close-sidebar {
    position: relative;
    z-index: 1001; /* Cao hơn nội dung sidebar */
    display: inline-block;
}

/* Đảm bảo sidebar trên mobile luôn nằm trên cùng */
@media (max-width: 991.98px) {
    .left-sidebar {
        z-index: 9999 !important;
    }
    #sidebar-overlay {
        z-index: 9998 !important;
    }
}