body {
    background: url('bg/bgmain.png') no-repeat center center fixed;
    background-size: cover;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Glassmorphism Card Style */
.custom-card {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #fff;
    /* Ensure text is readable */
}

/* Footer Glassmorphism */
footer {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    font-family: 'Consolas', monospace !important;
    font-weight: 700;
    font-size: 1.5rem;

    /* Gradient Text */
    background: linear-gradient(90deg, #007cf0 0%, #7928ca 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;

    /* Glow Effect */
    filter: drop-shadow(0 0 5px rgba(121, 40, 202, 0.4));
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    filter: drop-shadow(0 0 10px rgba(121, 40, 202, 0.6));
    transform: scale(1.02);
}

@media (max-width: 991px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: color 0.2s;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #ffffff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.content {
    flex: 1;
    display: flex;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 20px;
}

/* Sidebar Glassmorphism & Modern Styling */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    padding-top: 20px;
}

.sidebarinside {
    position: sticky;
    top: 80px;
    /* Increased from 60px to clear the larger navbar brand */
    max-height: calc(100vh - 80px);
    /* Adjust max-height accordingly */
    overflow-y: auto;
    padding-right: 8px;
    /* Space for scrollbar */
}

/* Scrollbar styling for sidebar */
.sidebarinside::-webkit-scrollbar {
    width: 5px;
}

.sidebarinside::-webkit-scrollbar-track {
    background: transparent;
}

.sidebarinside::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebarinside::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Shared Sidebar & Offcanvas Styles */
.sidebar .nav-link,
.offcanvas-body .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 10px 16px;
    border-radius: 8px;
    /* Rounded rectangle instead of pill */
    transition: all 0.2s ease;
    font-weight: 500;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover,
.offcanvas-body .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateX(4px);
}

/* Active State */
.nav-link.active {
    background-color: rgba(0, 93, 187, 0.15);
    /* Slightly more transparent */
    color: #4da3ff;
    font-weight: 600;
    box-shadow: 0 0 20px rgba(0, 93, 187, 0.2);
    border-left: 3px solid #4da3ff;
    /* Glowing vertical accent */
    padding-left: 13px;
    /* Adjust padding to account for border */
}

/* Icon Glow */
.sidebar .nav-link img,
.offcanvas-body .nav-link img {
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
    /* Subtle base glow */
    transition: filter 0.3s ease;
}

.sidebar .nav-link:hover img,
.offcanvas-body .nav-link:hover img {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.6));
}

.sidebar .nav-link.active i,
.sidebar .nav-link.active img,
.offcanvas-body .nav-link.active i,
.offcanvas-body .nav-link.active img {
    filter: drop-shadow(0 0 8px rgba(77, 163, 255, 0.8));
    /* Stronger glow for active */
}

/* Utility for spacing */
.ls-1 {
    letter-spacing: 1.5px;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Offcanvas (Mobile) Specifics */
.offcanvas-header {
    background-color: rgba(30, 30, 30, 0.95);
    /* Slightly more opaque for header */
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.offcanvas-body {
    background-color: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    padding: 20px;
}

/* Glassmorphism Accordion */
.accordion-item {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.accordion-button {
    background: transparent;
    color: #fff;
    box-shadow: none;
}

.accordion-button:not(.collapsed) {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: none;
}

.accordion-button::after {
    filter: invert(1);
    /* Make the arrow icon white */
}

.accordion-body {
    color: #fff;
}

/* Glassmorphism Table inside Custom Card */
.custom-card .table {
    color: #fff;
    --bs-table-bg: transparent;
    --bs-table-color: #fff;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.1);
}

.custom-card .table thead th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.custom-card .table td,
.custom-card .table th {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Inner Card for nested content */
.inner-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.inner-card .card-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.inner-card .card-footer {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Glass Inputs & Modals (Shared) */
.glass-modal {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.glass-input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    backdrop-filter: blur(5px);
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(77, 163, 255, 0.5) !important;
    color: #fff !important;
    box-shadow: 0 0 10px rgba(77, 163, 255, 0.2) !important;
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.glass-input option {
    background: #333;
    color: #fff;
}

/* Chat Messages Glassmorphism (Shared) */
/* Chat Messages Glassmorphism (Shared) */
.chat-messages {
    height: 600px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    /* For Admin resize */
    resize: vertical;
    min-height: 250px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages .message {
    display: flex;
    gap: 10px;
    max-width: 85%;
}

.chat-messages .message-content {
    display: flex;
    flex-direction: column;
}

.chat-messages .message .text {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.1;
    /* Reduced line spacing */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);

    /* Fix for long messages */
    word-wrap: break-word;
    overflow-wrap: anywhere;
    /* Better than break-word for long URLs */
    word-break: break-word;
    /* Standard modern wrapping */
    white-space: pre-wrap;
    max-width: 100%;
}

/* User Message (Right) - Blue */
.chat-messages .message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-messages .message.user .message-content {
    align-items: flex-end;
}

.chat-messages .message.user .text {
    background: rgba(0, 123, 255, 0.25);
    border: 1px solid rgba(0, 123, 255, 0.3);
    color: white;
    border-bottom-right-radius: 2px;
    text-align: left;
    /* Keep text left-aligned inside formatting */
}

/* System/Admin Message (Left) - Grey */
.chat-messages .message.system {
    align-self: flex-start;
    flex-direction: row;
}

.chat-messages .message.system .message-content {
    align-items: flex-start;
}

.chat-messages .message.system .text {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border-bottom-left-radius: 2px;
}

/* Avatars */
.chat-messages .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-messages .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Date Separator */
.chat-date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    position: relative;
}

.chat-date-separator span {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Images in Chat */
.chat-image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-image-preview:hover {
    transform: scale(1.02);
}

.chat-messages .message .timestamp {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
    padding: 0 2px;
}

.msg-container a {
    color: #4da3ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.msg-container a:hover {
    color: #80bdff;
    text-decoration: underline;
}

/* New Message Animation */
@keyframes newMsgFlash {
    0% {
        background-color: rgba(60, 111, 209, 0.5);
    }

    100% {
        background-color: transparent;
    }
}


.new-message-highlight {
    animation: newMsgFlash 1.5s ease-out;
    border-radius: 12px;
}

/* Shop Country Dropdown Styles */
.shop-country-dropdown {
    position: relative;
}

.shop-country-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    /* Modern border radius */
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
    /* Glass effect */
}

.shop-country-trigger:hover,
.shop-country-trigger:focus {
    border-color: #0d6efd;
    background: rgba(255, 255, 255, 0.1);
}

.shop-country-dropdown.open .shop-country-trigger {
    border-color: #0d6efd;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.shop-country-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.shop-country-arrow {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.2s;
}

.shop-country-dropdown.open .shop-country-arrow {
    transform: rotate(180deg);
}

.shop-flag-img {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    vertical-align: middle;
}

.shop-country-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(30, 30, 40, 0.95);
    border: 1px solid rgba(13, 110, 253, 0.3);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.shop-country-dropdown.open .shop-country-options {
    display: block;
}

.shop-country-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

.shop-country-search {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.9rem;
}

.shop-country-search::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.shop-country-list {
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.shop-country-list::-webkit-scrollbar {
    width: 5px;
}

.shop-country-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.shop-country-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    transition: background 0.15s;
}

.shop-country-option:hover {
    background: rgba(13, 110, 253, 0.2);
    color: #fff;
}

.shop-country-option.active {
    background: rgba(13, 110, 253, 0.3);
    color: #6bb3ff;
}

.shop-country-option.hidden {
    display: none;
}