/* ============================================
   TEDEXE - Modern UI Design
   ============================================ */

   :root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #43e97b;
    --danger-color: #ff4757;
    --warning-color: #ffa502;
    --info-color: #4facfe;
    
    --bg-primary: #0a0e27;
    --bg-secondary: #141b2d;
    --card-bg: #1a2332;
    --border-color: rgba(102, 126, 234, 0.15);
    
    --text-color: #e8eaf6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --sidebar-width: 260px;
    --header-height: 70px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--card-bg) 100%);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.logo-link {
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
}

.logo {
    padding: 0 !important;
    display: block !important;
    border-bottom: 1px solid var(--border-color) !important;
    background: var(--bg-secondary) !important;
}

/* Banner Image - Tự nhiên theo kích thước ảnh gốc */
.logo-banner {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
}

/* Logo Text */
.logo-text {
    font-size: 1.8rem !important;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 25px 15px !important;
    font-weight: 700 !important;
}

/* Fallback cho .logo img (nếu không có class) */
.logo img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
}

/* Navigation */
.nav-menu {
    padding: 20px 15px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 6px;
    border-radius: 12px;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transform: scaleY(0);
    transition: var(--transition);
}

.nav-item:hover, .nav-item.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

.nav-item:hover::before, .nav-item.active::before {
    transform: scaleY(1);
}

.nav-item i {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 15px;
}

.nav-group {
    margin: 15px 0;
}

.nav-group-title {
    padding: 12px 18px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-sub {
    padding-left: 45px;
    font-size: 0.95rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
}

.content-wrapper {
    flex: 1;
    width: 100%;
    padding: 30px 0;
}

@media (max-width: 1024px) {
    .main-content {
        padding: 0 15px;
    }
    
    .footer {
        width: calc(100% + 30px); /* Bù lại padding 15px * 2 */
        margin-left: -15px;
        margin-right: -15px;
    }
}

/* Header */
.top-header {
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: transparent;
    color: var(--text-color);
    font-size: 1.5rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
}

.search-box input {
    padding: 10px 15px 10px 45px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    width: 300px;
}

.search-box input:focus {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-balance {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.1) 0%, rgba(56, 249, 215, 0.1) 100%);
    border: 1px solid rgba(67, 233, 123, 0.3);
    border-radius: 12px;
    font-weight: 600;
    color: var(--success-color);
}

.user-balance i {
    font-size: 1.2rem;
}

/* Notifications */
.notifications {
    position: relative;
}

.notification-btn {
    background: transparent;
    color: var(--text-color);
    font-size: 1.3rem;
    padding: 10px;
    border-radius: 10px;
    transition: var(--transition);
    position: relative;
}

.notification-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 350px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.notification-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    align-items: flex-start;
}

.notification-item:hover {
    background: rgba(102, 126, 234, 0.08);
}

.notification-item.unread {
    background: rgba(102, 126, 234, 0.05);
    border-left: 3px solid var(--primary-color);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon i {
    font-size: 1.2rem;
}

.notification-icon.success {
    background: rgba(67, 233, 123, 0.1);
    color: var(--success-color);
}

.notification-icon.info {
    background: rgba(79, 172, 254, 0.1);
    color: var(--info-color);
}

.notification-icon.gift {
    background: rgba(255, 165, 2, 0.1);
    color: var(--warning-color);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-content p {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.4;
}

.notification-content small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.notification-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-header h4 i {
    color: var(--primary-color);
}

/* User Menu */
.user-menu-container {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 15px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
}

.user-menu-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--primary-color);
}

.user-menu-btn-guest {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
    cursor: pointer;
}

.user-menu-btn-guest:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--primary-color);
}

.user-menu-btn-guest .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu-btn-guest .user-avatar i {
    font-size: 1rem;
    color: white;
}

.guest-dropdown {
    min-width: 180px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar i {
    font-size: 1.2rem;
    color: white;
}

/* Admin avatar badge */
.user-menu-btn .user-avatar[data-role="admin"]::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: 2px solid var(--card-bg);
    border-radius: 50%;
}

.user-menu-btn {
    position: relative;
}

.username {
    font-weight: 600;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    overflow: hidden;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-color);
    transition: var(--transition);
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.dropdown-item.logout {
    color: var(--danger-color);
}

.dropdown-item.logout:hover {
    background: rgba(255, 71, 87, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* ============================================
   CONTENT AREA
   ============================================ */

.content {
    flex: 1;
    padding: 30px 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 768px) {
    .content {
        padding: 20px 15px;
    }
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb i {
    font-size: 0.7rem;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #38f9d7 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #ff6348 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #ffd32a 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #00f2fe 100%);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Custom Select Styles */
.custom-select-wrapper {
    position: relative;
}

.custom-select {
    width: 100%;
    padding: 14px 45px 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
}

.custom-select:focus {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    outline: none;
}

.custom-select option {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 10px;
}

.select-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: transform 0.3s ease;
}

.select-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
}

.custom-select:focus + .select-icon {
    transform: translateY(-50%) rotate(180deg);
}

.custom-select:focus + .select-icon svg {
    stroke: var(--primary-color);
}

/* Custom Input */
.custom-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.custom-input:focus {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Custom Textarea */
.custom-textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: all 0.3s ease;
}

.custom-textarea:focus {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(67, 233, 123, 0.1);
    border: 1px solid rgba(67, 233, 123, 0.3);
    color: var(--success-color);
}

.alert-error {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--danger-color);
}

.alert-warning {
    background: rgba(255, 165, 2, 0.1);
    border: 1px solid rgba(255, 165, 2, 0.3);
    color: var(--warning-color);
}

.alert-info {
    background: rgba(79, 172, 254, 0.1);
    border: 1px solid rgba(79, 172, 254, 0.3);
    color: var(--info-color);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tr {
    transition: var(--transition);
}

table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* Footer */
.footer {
    width: calc(100% + 40px); /* Bù lại padding của main-content (20px * 2) */
    margin-left: -20px;
    margin-right: -20px;
    padding: 30px 0;
    margin-top: auto; /* Đẩy footer xuống dưới cùng */
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
    text-align: center;
    position: relative;
}

.footer-content {
    max-width: 100%;
    padding: 0 30px;
    margin: 0 auto;
}

.footer-content p {
    margin: 8px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer-content a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .search-box input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .search-box {
        display: none;
    }
    
    .user-balance span {
        display: none;
    }
    
    .username {
        display: none;
    }
    
    .content {
        padding: 20px 15px;
    }
}

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.6s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo svg {
    width: 40px;
    height: 40px;
    stroke: var(--primary-color);
}

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    margin-bottom: 25px;
}

.forgot-password-link {
    margin-top: 8px;
    text-align: right;
}

.forgot-password-link a {
    color: var(--primary-color);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.forgot-password-link a:hover {
    color: var(--secondary-color);
    transform: translateX(-3px);
}

.auth-links {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.auth-links a {
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.auth-links a:hover {
    color: var(--primary-color);
}

.auth-links svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.auth-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-secondary);
}

.auth-footer p {
    margin: 10px 0;
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   CATEGORIES & PRODUCTS
   ============================================ */

.section-header {
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 1.8rem;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
}

.section-header h2 i {
    color: var(--primary-color);
}

.section-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

.categories-section {
    margin-bottom: 35px;
}

.category-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.category-tab.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.category-tab i {
    font-size: 1.1rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    transform: translateY(-5px);
}

.product-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.product-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.product-image {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.product-title {
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-color);
}

.product-description {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.product-description p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Verified Badge Styles - Twitter/X Style */
.verified-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 !important;
    color: var(--text-color) !important;
    font-size: 0.9rem !important;
    line-height: 1.5;
}

/* Verified Badge SVG Container */
.verified-badge {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px;
    min-height: 14px;
    display: inline-block !important;
    vertical-align: middle !important;
    flex-shrink: 0;
    filter: drop-shadow(0 0 3px rgba(29, 155, 240, 0.6));
}

/* Group chứa hình bông hoa - XOAY */
.verified-badge .seal-rotate {
    -webkit-animation: verifiedRotate 3s linear infinite;
    -moz-animation: verifiedRotate 3s linear infinite;
    -o-animation: verifiedRotate 3s linear infinite;
    animation: verifiedRotate 3s linear infinite;
    -webkit-transform-origin: 11px 11px;
    -moz-transform-origin: 11px 11px;
    -o-transform-origin: 11px 11px;
    transform-origin: 11px 11px;
    will-change: transform;
}

/* Group chứa dấu tick - ĐỨNG YÊN (không có animation) */
.verified-badge .check-static {
    /* Không có animation, nên đứng yên */
}

/* Animation xoay liên tục cho verified seal - hỗ trợ đa trình duyệt */
@-webkit-keyframes verifiedRotate {
    0% { 
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% { 
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

@-moz-keyframes verifiedRotate {
    0% { 
        -moz-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% { 
        -moz-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

@-o-keyframes verifiedRotate {
    0% { 
        -o-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% { 
        -o-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

@keyframes verifiedRotate {
    0% { 
        -webkit-transform: rotate(0deg);
        -moz-transform: rotate(0deg);
        -o-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% { 
        -webkit-transform: rotate(360deg);
        -moz-transform: rotate(360deg);
        -o-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

/* Hiệu ứng hover - xoay nhanh hơn */
.verified-line:hover .verified-badge {
    filter: drop-shadow(0 0 6px rgba(29, 155, 240, 0.9));
}

.verified-line:hover .verified-badge .seal-rotate {
    -webkit-animation: verifiedRotateFast 1.5s linear infinite;
    -moz-animation: verifiedRotateFast 1.5s linear infinite;
    animation: verifiedRotateFast 1.5s linear infinite;
}

@-webkit-keyframes verifiedRotateFast {
    0% { 
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% { 
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

@keyframes verifiedRotateFast {
    0% { 
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% { 
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

.verified-line > span:last-child {
    flex: 1;
    display: inline-block;
}

.product-features {
    margin-bottom: 20px;
    flex: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--text-secondary);
}

.feature-item i {
    color: var(--success-color);
    font-size: 0.9rem;
}

.product-info {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.info-item {
    text-align: center;
}

.info-item span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.info-item strong {
    font-size: 1.1rem;
    color: var(--text-color);
}

.info-item .price {
    color: var(--success-color);
    font-weight: 700;
}

.product-footer {
    margin-top: auto;
}

.btn-block {
    width: 100%;
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-primary { color: var(--primary-color); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ============================================
   ADMIN DASHBOARD
   ============================================ */

.admin-dashboard {
    padding: 0 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 2rem;
    margin: 0 0 5px 0;
    color: var(--text-color);
}

.stat-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.admin-section {
    margin-bottom: 35px;
}

.admin-section h2 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
}

.admin-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.admin-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* ============================================
   ANNOUNCEMENT BOX
   ============================================ */

.announcement-box {
    display: flex;
    gap: 20px;
    padding: 25px 30px;
    margin-bottom: 25px;
    border-radius: 16px;
    border: 2px solid;
    animation: slideUp 0.6s ease;
}

.announcement-warning {
    background: linear-gradient(135deg, rgba(255, 165, 2, 0.1) 0%, rgba(255, 165, 2, 0.05) 100%);
    border-color: rgba(255, 165, 2, 0.3);
}

.announcement-info {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(79, 172, 254, 0.05) 100%);
    border-color: rgba(79, 172, 254, 0.3);
}

.announcement-success {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.1) 0%, rgba(67, 233, 123, 0.05) 100%);
    border-color: rgba(67, 233, 123, 0.3);
}

.announcement-danger {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.1) 0%, rgba(255, 71, 87, 0.05) 100%);
    border-color: rgba(255, 71, 87, 0.3);
}

.announcement-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.announcement-warning .announcement-icon {
    background: rgba(255, 165, 2, 0.2);
    color: var(--warning-color);
}

.announcement-info .announcement-icon {
    background: rgba(79, 172, 254, 0.2);
    color: var(--info-color);
}

.announcement-success .announcement-icon {
    background: rgba(67, 233, 123, 0.2);
    color: var(--success-color);
}

.announcement-danger .announcement-icon {
    background: rgba(255, 71, 87, 0.2);
    color: var(--danger-color);
}

.announcement-content {
    flex: 1;
}

.announcement-content h3 {
    margin: 0 0 12px 0;
    font-size: 1.3rem;
    color: var(--text-color);
}

.announcement-text p {
    margin: 10px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.announcement-text strong {
    color: var(--text-color);
    font-weight: 600;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.contact-item i {
    width: 20px;
    color: var(--primary-color);
}

.contact-item a {
    color: var(--primary-color);
    font-weight: 600;
    transition: var(--transition);
}

.contact-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.warning-text {
    margin: 15px 0 0 0 !important;
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   AUTH PAGES - LOGIN, REGISTER, FORGOT PASSWORD
   ============================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(118, 75, 162, 0.15) 0%, transparent 50%);
    z-index: 0;
}

.auth-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.particle:nth-child(1) {
    left: 10%;
    top: 20%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.particle:nth-child(2) {
    left: 80%;
    top: 30%;
    animation-delay: 5s;
    animation-duration: 30s;
}

.particle:nth-child(3) {
    left: 60%;
    top: 70%;
    animation-delay: 10s;
    animation-duration: 20s;
}

.particle:nth-child(4) {
    left: 30%;
    top: 80%;
    animation-delay: 15s;
    animation-duration: 28s;
}

.particle:nth-child(5) {
    left: 90%;
    top: 60%;
    animation-delay: 8s;
    animation-duration: 22s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-50px) translateX(30px) scale(1.2);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-100px) translateX(-20px) scale(0.8);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-50px) translateX(-40px) scale(1.1);
        opacity: 0.6;
    }
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    padding: 20px;
}

.auth-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 45px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    animation: slideUp 0.6s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 35px;
}

.auth-logo {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: popIn 0.5s ease 0.2s both;
}

.auth-logo svg {
    width: 36px;
    height: 36px;
    stroke: var(--primary-color);
    stroke-width: 2;
}

.auth-header h1 {
    font-size: 2rem;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeIn 0.5s ease 0.3s both;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
    animation: fadeIn 0.5s ease 0.4s both;
}

.auth-form {
    margin: 30px 0;
}

.auth-form .form-group {
    margin-bottom: 24px;
}

.auth-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.auth-form label svg {
    width: 18px;
    height: 18px;
    stroke: var(--primary-color);
    flex-shrink: 0;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form input:focus {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
    outline: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.toggle-password:hover {
    background: rgba(102, 126, 234, 0.1);
}

.toggle-password svg {
    width: 22px;
    height: 22px;
    stroke: var(--text-secondary);
    transition: stroke 0.3s ease;
}

.toggle-password:hover svg {
    stroke: var(--primary-color);
}

.form-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 25px;
}

.forgot-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-link svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.forgot-link:hover {
    color: var(--primary-color);
}

.btn-block {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-block svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.btn-block:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.btn-block:active {
    transform: translateY(-1px);
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 30px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 15px;
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
}

.auth-footer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-footer a,
.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.back-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.auth-footer a:hover,
.back-link:hover {
    color: var(--primary-dark);
    gap: 10px;
}

.alert {
    padding: 16px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

.alert svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-error {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--danger-color);
}

.alert-error svg {
    stroke: var(--danger-color);
}

.alert-success {
    background: rgba(67, 233, 123, 0.1);
    border: 1px solid rgba(67, 233, 123, 0.3);
    color: var(--success-color);
}

.alert-success svg {
    stroke: var(--success-color);
}

.alert div,
.alert span {
    flex: 1;
    line-height: 1.6;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .auth-box {
        padding: 35px 25px;
    }
    
    .auth-header h1 {
        font-size: 1.6rem;
    }
}

/* ============================================
   CUSTOM DROPDOWN / SELECT STYLING
   ============================================ */

select,
.custom-select,
select.form-control,
.form-group select,
.modal select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 14px 45px 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
}

select:hover,
.custom-select:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

select:focus,
.custom-select:focus {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    outline: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

select:active,
.custom-select:active {
    transform: translateY(0);
}

/* Select option styling */
select option {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 12px;
    font-size: 1rem;
}

select option:hover,
select option:checked {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    color: var(--primary-color);
}

/* Disabled state */
select:disabled,
.custom-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
}

/* Select with wrapper for icon positioning */
.select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.select-wrapper select {
    width: 100%;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--primary-color);
    pointer-events: none;
    transition: all 0.3s ease;
}

.select-wrapper:hover::after {
    border-top-color: var(--primary-dark);
    transform: translateY(-50%) scale(1.1);
}

/* Small select variant */
select.select-sm {
    padding: 10px 40px 10px 14px;
    font-size: 0.9rem;
    border-radius: 10px;
}

/* Large select variant */
select.select-lg {
    padding: 16px 50px 16px 20px;
    font-size: 1.1rem;
    border-radius: 14px;
}

/* Success state */
select.select-success {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.05) 0%, rgba(56, 249, 215, 0.05) 100%);
}

/* Error state */
select.select-error {
    border-color: var(--danger-color);
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.05) 0%, rgba(255, 107, 107, 0.05) 100%);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Loading state */
select.select-loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2'%3E%3Cpath d='M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83'/%3E%3C/svg%3E");
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { background-position: right 12px center; }
    to { background-position: right 12px center; transform: rotate(360deg); }
}

/* Enhanced form-group select */
.form-group select,
.form-section select {
    margin-top: 5px;
}

/* Modal select styling */
.modal select {
    background-color: rgba(255, 255, 255, 0.05);
}

.modal select:focus {
    background-color: rgba(102, 126, 234, 0.1);
}

/* Admin table select */
.admin-table select {
    padding: 8px 35px 8px 12px;
    font-size: 0.9rem;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    select,
    .custom-select {
        font-size: 0.95rem;
        padding: 12px 40px 12px 16px;
    }
}

/* ==================== SUPPORT CHAT SYSTEM ==================== */

/* Floating Chat Button */
.chat-float-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    animation: pulse 2s infinite;
}

.chat-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.chat-float-btn i {
    color: white;
    font-size: 1.6rem;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6), 0 0 0 10px rgba(102, 126, 234, 0.1);
    }
}

/* Chat Box Popup */
.chat-box {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    height: 550px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 999;
    animation: slideUp 0.3s ease;
    overflow: hidden; /* Đảm bảo không tràn ra ngoài */
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0; /* Không cho shrink */
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-info > i {
    font-size: 1.8rem;
}

.chat-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.chat-status {
    font-size: 0.85rem;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.chat-refresh-btn,
.chat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto !important; /* Auto scroll */
    overflow-x: hidden !important; /* Không scroll ngang */
    background: var(--background-color);
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    position: relative;
    -webkit-overflow-scrolling: touch; /* Smooth scroll trên iOS */
    height: 0; /* Important for flexbox overflow */
    min-height: 200px;
}

/* Scrollbar cho chat messages */
.chat-messages::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin: 4px 0;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.6);
    border-radius: 4px;
    border: 2px solid var(--background-color);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

/* Force no overflow cho tất cả elements trong chat-messages */
.chat-messages *,
.chat-messages *::before,
.chat-messages *::after {
    max-width: 100%;
    box-sizing: border-box;
}

.chat-welcome {
    text-align: center;
    padding: 40px 20px;
}

.chat-welcome i {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.chat-welcome h3 {
    color: var(--text-color);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.chat-welcome p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Chat Message Wrapper */
.message-wrapper {
    width: 100%;
    display: block;
    clear: both;
    margin-bottom: 15px;
    overflow: hidden;
    box-sizing: border-box;
}

.message-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

/* Chat Message Bubbles */
.chat-message {
    padding: 12px 15px;
    border-radius: 18px;
    max-width: 75%;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    display: inline-block;
    box-sizing: border-box;
    vertical-align: top;
}

.user-message {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-bottom-right-radius: 4px;
    float: right;
}

.admin-message {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
    float: left;
}

.message-sender {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.message-content {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 8px;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    text-align: right;
    margin-top: 5px;
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.9);
}

.message-status {
    font-size: 0.8rem;
    font-style: italic;
    opacity: 0.8;
    margin-top: 5px;
}

/* Message Attachments */
.message-attachment {
    margin-top: 10px;
}

.attachment-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
    display: block;
    transition: all 0.3s;
}

.attachment-image:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.attachment-file:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

.attachment-file i {
    font-size: 1.1rem;
}

/* Chat Input Area */
.chat-input-area {
    padding: 15px;
    background: var(--card-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 15px 15px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0; /* Không cho shrink */
}

.chat-attach-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: var(--primary-color);
    width: 50px;
    height: 50px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chat-attach-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.chat-attach-btn i {
    font-size: 1.2rem;
}

.chat-input-wrapper {
    flex: 1;
    min-width: 0; /* Cho phép shrink */
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
    overflow: hidden;
}

.chat-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--background-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 15px;
    color: var(--text-color);
    font-size: 0.95rem;
    resize: none;
    font-family: inherit;
    transition: all 0.3s;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.file-preview {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-preview-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.file-preview-item .file-name {
    flex: 1;
    color: var(--text-color);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-file-btn {
    background: rgba(255, 71, 87, 0.2);
    border: none;
    color: #ff4757;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.remove-file-btn:hover {
    background: rgba(255, 71, 87, 0.3);
    transform: scale(1.1);
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-send-btn i {
    font-size: 1.2rem;
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid;
}

.toast.success {
    border-left-color: #2ecc71;
}

.toast.error {
    border-left-color: #e74c3c;
}

.toast.info {
    border-left-color: #3498db;
}

.toast.warning {
    border-left-color: #f39c12;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.toast.error .toast-icon {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.toast.info .toast-icon {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.toast.warning .toast-icon {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

.toast-content {
    flex: 1;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 4px;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOutRight 0.3s ease forwards;
}

/* Responsive Toast */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* Responsive Chat */
@media (max-width: 768px) {
    .chat-box {
        width: calc(100vw - 30px);
        right: 15px;
        bottom: 90px;
        height: 500px;
    }
    
    .chat-messages {
        padding: 12px; /* Giảm padding trên mobile */
    }
    
    .chat-message {
        max-width: 80%;
        padding: 10px 12px;
    }
    
    .message-content {
        font-size: 0.9rem;
    }
    
    .chat-header {
        padding: 15px; /* Giảm padding header */
    }
    
    .chat-input-area {
        padding: 12px; /* Giảm padding input area */
    }
    
    .chat-float-btn {
        right: 15px;
        bottom: 15px;
        width: 55px;
        height: 55px;
    }
    
    .chat-float-btn i {
        font-size: 1.4rem;
    }
}
