@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Regular.woff2') format('woff2'),
       url('fonts/Inter-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Bold.woff2') format('woff2'),
       url('fonts/Inter-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
    /* Main colors - màu sắc tươi sáng hơn */
    --primary-color: #8e44ad;
    --primary-light: #9b59b6;
    --primary-dark: #7d3c98;
    --secondary-color: #3498db;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #1abc9c;
    --gray-color: #95a5a6;
    
    /* Font mới */
    --main-font: 'Poppins', sans-serif;
    
    /* Category colors - màu sắc sống động hơn */
    --dapps-color: #9c27b0;
    --node-color: #673ab7;
    --docker-color: #03a9f4;
    --mainnet-color: #009688;
    --general-color: #607d8b;
    --trading-color: #ff9800;
    
    /* Other variables */
    --max-width: 1200px;
    --border-radius: 15px; /* Bo tròn hơn */
    --box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* Đổ bóng rõ hơn */
    --transition: all 0.3s ease-in-out;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* Đổ bóng rõ hơn */
    --border-color: #ddd;
    
    /* Thêm gradient màu cho header và các phần tử */
    --gradient-primary: linear-gradient(45deg, #8e44ad, #9b59b6);
    --gradient-dapps: linear-gradient(45deg, #9c27b0, #b039c6);
    --gradient-node: linear-gradient(45deg, #673ab7, #7e57c2);
    --gradient-docker: linear-gradient(45deg, #03a9f4, #29b6f6);
    --gradient-mainnet: linear-gradient(45deg, #009688, #26a69a);
    --gradient-general: linear-gradient(45deg, #607d8b, #78909c);
    --gradient-trading: linear-gradient(45deg, #ff9800, #ffb74d);

    /* Admin Control Panel variables */
    --white-color: #fff;
    --border-radius-large: 12px;
    --border-radius-small: 4px;
    --text-muted-color: #757575;
    --background-muted-color: #f0f0f0;
    --border-color-light: #e0e0e0;
    --background-color-light: #f9f9f9;
    --text-color-dark: #333;

    --notification-color-important: #ffc107; /* Amber/Yellow */
    --notification-color-event: #4CAF50;     /* Green */
    --notification-color-technical: #2196F3;  /* Blue */
    --notification-color-regulation: #f44336; /* Red */
    --notification-color-general: #90a4ae;    /* Blue Grey */

    --notification-background-color: #ffffff;
    --notification-item-hover-bg: #f5f5f5;
    --notification-title-color: var(--dark-color, #2c3e50);
    --notification-body-color: #555;
    --notification-timestamp-color: #777;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body, input, button, textarea, select {
    font-family: 'Inter', 'Be Vietnam Pro', Roboto, 'Noto Sans', Arial, sans-serif !important;
    font-weight: 400;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    font-size: 17px; /* Increased base font size */
    scroll-behavior: smooth;
}

body {
    font-family: var(--main-font);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f7fa; /* Màu nền sáng hơn */
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased; /* Làm mượt font trên webkit browsers */
    -moz-osx-font-smoothing: grayscale; /* Làm mượt font trên Firefox */
    text-rendering: optimizeLegibility; /* Cải thiện cách hiển thị font */
}

p, li, span, a, button, label, input, textarea, select {
    letter-spacing: 0.01em; /* Tăng nhẹ khoảng cách giữa các chữ cái */
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.01em; /* Giảm nhẹ khoảng cách cho tiêu đề */
    font-weight: 600; /* Đảm bảo tiêu đề rõ ràng */
    line-height: 1.3; /* Khoảng cách dòng tốt hơn cho tiêu đề */
}

input, textarea, select, button {
    font-family: var(--main-font); /* Đảm bảo nhất quán font cho các phần tử form */
}

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

ul {
    list-style: none;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px; /* Padding lớn hơn */
    border-radius: var(--border-radius);
    border: none;
    font-size: 15px; /* Font lớn hơn */
    font-weight: 600; /* Font đậm hơn */
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Thêm đổ bóng */
}

.btn i {
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient-primary); /* Dùng gradient thay vì màu đơn */
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #7d3c98, #8e44ad); /* Gradient tối hơn */
    transform: translateY(-3px); /* Hiệu ứng nổi rõ hơn */
    box-shadow: 0 6px 12px rgba(142, 68, 173, 0.25); /* Đổ bóng rõ hơn */
}

.btn-secondary {
    background-color: white;
    color: var(--dark-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--light-color);
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--dark-color);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Header styles */
header {
    background: linear-gradient(135deg, #ffffff, #f5f7fa); /* Gradient nhẹ nhàng */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Đổ bóng rõ hơn */
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    order: 1;
}

.logo img {
    width: 36px;
    height: 36px;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.1);
}

.logo h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--dark-color);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    letter-spacing: -0.02em;
    text-align: left;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1;
}

.logo span {
    color: var(--primary-color);
    background: linear-gradient(45deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Base style for header-main-actions for desktop ordering */
.header-main-actions {
    display: contents; /* Allow children to be ordered by header .container */
}

.header-controls {
    display: contents; /* Allow children to be ordered by header .container */
}

.search-box {
    display: flex;
    align-items: center;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 5px 10px;
    transition: var(--transition);
    order: 2;
    flex-grow: 0;
    max-width: 250px;
    margin-left: auto;
}

.search-box:focus-within {
    box-shadow: 0 0 0 2px rgba(142, 68, 173, 0.2);
}

.search-box input {
    flex-grow: 1;
    border: none;
    background: none;
    padding: 5px;
    outline: none;
    font-size: 14px;
    width: 100%;
}

.search-box button {
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    padding: 5px;
}

.search-box button:hover {
    color: var(--primary-color);
}

/* Need to target notification and new topic buttons for ordering */
/* Assuming IDs #notifications-btn and #new-topic-btn */
#notifications-btn {
    order: 3;
}

#new-topic-btn {
    order: 4;
}

.notification-count {
    background-color: var(--danger-color);
    color: white;
    font-size: 12px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Language switcher */
.language-switcher {
    display: flex;
    gap: 5px;
    order: 5;
    margin-left: auto;
}

.language-switcher button {
    width: 36px;
    height: 26px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    order: 6;
}

.language-switcher button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.language-switcher button:hover:not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Notification banner */
.notification-banner {
    padding: 12px 20px;
    color: white;
    position: relative;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: banner-slide-down 0.5s ease-out;
    text-align: center;
}

@keyframes banner-slide-down {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.notification-banner.event {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
}

.notification-banner.technical {
    background: linear-gradient(45deg, #3498db, #2980b9);
}

.notification-banner.regulation {
    background: linear-gradient(45deg, #f39c12, #e67e22);
}

.notification-banner.important {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

.notice-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.notice-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notice-text {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    display: inline-block;
}

.notice-close {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.8;
    transition: var(--transition);
    padding: 5px;
    flex-shrink: 0;
}

.notice-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* NEW: Default yellow banner style */
.banner-default-yellow {
    background-color: #ffc107 !important; 
    color: #333; 
}

/* Notifications Panel */
#notifications-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 350px;
    max-width: calc(100vw - 40px);
    max-height: 80vh;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 1001; /* Tăng z-index cao hơn overlay */
    overflow: hidden;
    transition: all 0.3s ease;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.notifications-list {
    max-height: calc(80vh - 60px);
    overflow-y: auto;
}

/* Main content styles */
main {
    padding: 30px 0 60px;
    min-height: calc(100vh - 180px);
    transition: all 0.3s ease;
}

/* Categories section */
.categories-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.categories-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.categories-section h3 i {
    color: var(--primary-color);
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-btn {
    padding: 8px 16px;
    border-radius: 30px; /* Bo tròn hoàn toàn */
    background-color: white;
    color: var(--dark-color);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); /* Thêm đổ bóng nhẹ */
}

.category-btn.active {
    color: white;
    border-color: transparent;
}

.category-btn[data-category="all"].active {
    background: var(--gradient-primary);
}

.category-btn[data-category="dapps"].active {
    background: var(--gradient-dapps);
}

.category-btn[data-category="node"].active {
    background: var(--gradient-node);
}

.category-btn[data-category="docker"].active {
    background: var(--gradient-docker);
}

.category-btn[data-category="mainnet"].active {
    background: var(--gradient-mainnet);
}

.category-btn[data-category="general"].active {
    background: var(--gradient-general);
}

.category-btn[data-category="trading"].active {
    background: var(--gradient-trading);
}

.category-btn:hover:not(.active) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Topics section */
.topics-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

h2 {
    font-size: 18px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

h2 i {
    color: var(--primary-color);
}

.view-options {
    display: flex;
    gap: 10px;
}

.view-options span {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.view-options span:hover,
.view-options span.active {
    background-color: var(--primary-light);
    color: white;
}

/* Topics list */
#topics-list {
    display: grid;
    gap: 15px;
    transition: all 0.3s ease;
}

#topics-list.list-view {
    grid-template-columns: 1fr;
}

#topics-list.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Style for the 'No topics found' message */
#topics-list > p:only-child {
    color: #FF0000 !important; /* Bright red text */
    background-color: yellow !important; /* Yellow background */
    font-size: 20px !important;
    font-weight: bold !important;
    padding: 20px !important;
    text-align: center !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    border: 2px dashed blue !important; /* Blue dashed border for extra visibility */
}

.topic-item {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
    border-left: 5px solid transparent; /* Viền trong suốt trước khi hover */
    overflow: hidden;
    position: relative;
}

/* Thêm pseudoelement để tạo hiệu ứng từ dưới lên */
.topic-item::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    height: 100%;
    width: 5px; /* Độ rộng của viền */
    transition: all 0.5s ease;
}

/* Hiệu ứng hover */
.topic-item:hover::before {
    top: 0; /* Di chuyển từ dưới lên */
    box-shadow: 0 0 15px 2px; /* Tỏa sáng nhẹ với màu tương ứng */
    animation: pulse-light 1s infinite alternate; /* Animation nhanh hơn */
}

@keyframes pulse-light {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Thêm style cho tiêu đề topic */
.topic-title {
    cursor: pointer;
    color: #222;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 3px;
}

.topic-title:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

.topic-title:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.topic-title:hover:after {
    width: 100%;
}

/* Hiệu ứng làm nổi bật card khi hover */
.topic-item {
    transition: all 0.3s ease;
    border-radius: 8px;
}

.topic-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

/* Style cho view-more link */
.view-more {
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.view-more:hover {
    color: var(--primary-color);
    padding-right: 5px;
}

.view-more i {
    transition: transform 0.3s ease;
}

.view-more:hover i {
    transform: translateX(3px);
}

/* Màu cho từng danh mục */
.topic-item[data-category="dapps"]::before {
    background-color: var(--dapps-color);
}

.topic-item[data-category="node"]::before {
    background-color: var(--node-color);
}

.topic-item[data-category="docker"]::before {
    background-color: var(--docker-color);
}

.topic-item[data-category="mainnet"]::before {
    background-color: var(--mainnet-color);
}

.topic-item[data-category="general"]::before {
    background-color: var(--general-color);
}

.topic-item[data-category="trading"]::before {
    background-color: var(--trading-color);
}

/* Hiệu ứng khi hover cho topic item */
.topic-item:hover {
    transform: translateY(-5px); /* Hiệu ứng nổi khi hover */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); /* Đổ bóng rõ hơn khi hover */
}

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.topic-info {
    flex-grow: 1;
}

.topic-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--gray-color);
    flex-wrap: wrap;
}

.topic-category {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.category-dapps {
    background: var(--gradient-dapps); /* Dùng gradient */
}

.category-node {
    background: var(--gradient-node); /* Dùng gradient */
}

.category-docker {
    background: var(--gradient-docker); /* Dùng gradient */
}

.category-mainnet {
    background: var(--gradient-mainnet); /* Dùng gradient */
}

.category-general {
    background: var(--gradient-general); /* Dùng gradient */
}

.category-trading {
    background: var(--gradient-trading); /* Dùng gradient */
}

.topic-content {
    font-size: 14px;
    color: var(--dark-color);
    margin-bottom: 15px;
    line-height: 1.5;
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.topic-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    background-color: rgba(142, 68, 173, 0.1);
    color: var(--primary-color);
    margin-right: 6px;
    transition: var(--transition);
    border: 1px solid rgba(142, 68, 173, 0.1);
}

.topic-tag:hover {
    background-color: rgba(142, 68, 173, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(142, 68, 173, 0.1);
}

.topic-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--gray-color);
}

.view-more {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.view-more:hover {
    color: var(--primary-dark);
    transform: translateX(3px);
}

.view-more i {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.view-more:hover i {
    transform: translateX(2px);
}

/* New topic form */
.card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    font-family: var(--main-font);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.1);
}

.upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    color: var(--gray-color);
}

.upload-label:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(142, 68, 173, 0.05);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Footer */
/* The following footer styles will be removed as they might conflict with Tailwind CSS in index.html */
/* footer {
    background-color: var(--dark-color);
    color: white;
    padding: 50px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.footer-logo img {
    width: 35px;
    height: 35px;
}

.footer-logo h3 {
    font-size: 20px;
    font-weight: 600;
}

.footer-links h4,
.footer-social h4 {
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--light-color);
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: var(--gray-color);
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    transform: translateX(3px);
}

.social-icons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-icons a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: var(--gray-color);
} */

/* Overlay */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    backdrop-filter: none; /* Bỏ hiệu ứng blur */
    transition: all 0.3s ease;
}

/* Custom Footer Styles for Desktop */
@media (min-width: 768px) { /* Tailwind's 'md' (768px) breakpoint */
    .custom-desktop-footer-layout {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }

    .footer-right-group {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem; /* Equivalent to Tailwind's gap-4 */
    }

    .footer-right-group > div {
        display: flex !important;
        align-items: center !important;
    }
}

/* Responsive design - improved */
@media (max-width: 1200px) {
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 992px) {
    html {
        font-size: 15px;
    }
    
    .header-controls {
        gap: 10px;
    }
    
    .search-box {
        width: 220px;
    }
    main {
        padding: 25px 0 50px; /* Giảm padding cho main */
    }
}

@media (max-width: 900px) {
    header .container {
        flex-wrap: wrap;
    }
    
    .header-controls {
        order: 3;
        width: 100%;
        margin-top: 10px;
        justify-content: space-between;
    }
    
    .search-box {
        width: calc(100% - 220px); /* Điều chỉnh lại để vừa vặn hơn */
        max-width: 350px; /* Giới hạn độ rộng tối đa */
        margin-right: auto; /* Đẩy các nút khác về bên phải */
    }
    
    .language-switcher {
        margin-left: 0;
    }
    
    .topic-header {
        flex-direction: column;
        gap: 8px; /* Giảm gap */
    }
    
    .topic-category {
        margin-left: 0;
        align-self: flex-start; /* Căn trái category tag */
    }
    
    #topics-list.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Tăng minmax cho grid view */
    }
}

@media (max-width: 768px) {
    main {
        padding: 20px 0 40px;
    }
    
    .card {
        padding: 20px;
    }

    .btn {
        font-size: 14px;
    }
    
    #notifications-panel {
        width: 100%;
        right: 0;
        top: 0;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        box-shadow: none; /* Bỏ shadow khi full màn hình */
    }
    
    .notifications-list {
        max-height: calc(100vh - 60px);
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .form-header {
        margin-top: 10px;
        padding-bottom: 10px; /* Giảm padding */
    }

    header .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        flex-wrap: wrap;
    }

    .logo {
        order: 1;
        width: 100%;
        margin-bottom: 10px;
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    .logo img {
        width: 50px;
        height: 50px;
    }
    .logo h1 {
        font-size: 2.2rem;
        text-align: center;
        line-height: 1.2;
    }

    .header-main-actions { 
        order: 2;
        display: flex;
        flex-direction: column;
        width: 100%; 
        align-items: flex-start;
        gap: 10px; 
    }

    .header-main-actions #notifications-btn,
    .header-main-actions #new-topic-btn {
        width: 100%;
        text-align: left; 
        padding: 10px 15px;
        font-size: 14px;
        justify-content: flex-start; 
    }
    
    .header-controls { 
        order: 3;
        width: 100%; 
        display: flex;
        flex-direction: column; 
        align-items: flex-end; /* Đổi từ flex-start để canh phải .search-box */
        gap: 10px; 
        flex-grow: 0;
    }

    .search-box {
        order: 1;
        width: 50%; /* Giảm chiều rộng còn 1/2, bỏ !important nếu có */
        max-width: none; 
        flex-grow: 0;
    }
    
    #login-info { 
        order: 4;
        display: block;
        width: 100%; 
        text-align: center; 
        margin-top: 10px; 
    }

    .language-switcher { 
        order: initial;
        position: fixed;
        bottom: 25px;    
        right: 25px;     
        z-index: 1001; 
        background-color: rgba(255, 255, 255, 0.9); 
        padding: 5px;
        border-radius: var(--border-radius);
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        margin-left: 0;
    }

    .language-switcher button {
    }

    .topic-meta {
        flex-direction: column;
        gap: 5px;
        font-size: 12px;
    }

    .topic-header .topic-category {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .topic-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 12px;
    }
    
    #topics-list.grid-view {
        grid-template-columns: 1fr;
    }

    .topic-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .topic-detail-meta {
        gap: 10px;
        font-size: 13px;
    }

    .topic-detail-body {
        font-size: 15px;
    }

    .reply-author-name {
        font-size: 13px;
    }
    .reply-content, .nested-reply-item .reply-content {
        font-size: 13px;
    }
    .reply-form textarea {
        font-size: 13px;
        min-height: 60px;
    }

    .header-main-actions button#notifications-btn {
        position: relative; /* Cần thiết để định vị huy hiệu bên trong */
        padding-right: 25px !important; /* Tăng padding để có không gian cho huy hiệu lớn hơn một chút nếu cần */
    }

    .header-main-actions .notification-count {
        position: absolute;
        top: 2px; /* Điều chỉnh vị trí theo chiều dọc */
        right: 5px; /* Điều chỉnh vị trí theo chiều ngang */
        background-color: red !important;
        color: white !important;
        border-radius: 50% !important; /* Đảm bảo hình tròn */
        font-size: 0.7rem !important; /* Kích thước chữ số bên trong huy hiệu */
        width: 18px !important;      /* Chiều rộng của huy hiệu */
        height: 18px !important;     /* Chiều cao của huy hiệu */
        line-height: 18px !important;/* Căn giữa số theo chiều dọc */
        text-align: center !important; /* Căn giữa số theo chiều ngang */
        font-weight: bold !important;
        box-shadow: 0 0 3px rgba(0,0,0,0.3) !important; /* Thêm đổ bóng nhẹ cho nổi bật */
        display: inline-flex !important; /* Để line-height và text-align hoạt động tốt */
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important; /* Reset padding nếu có */
    }
}

@media (max-width: 600px) {
    html {
        font-size: 14px;
    }
    
    header {
        padding: 10px 0;
    }
    
    header .container {
        gap: 10px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }

    .logo img {
        width: 40px;
        height: 40px;
    }
    
    .notification-banner {
        padding: 10px 15px;
    }
    
    .notice-content {
        gap: 10px;
    }
    
    .notice-icon {
        font-size: 18px;
    }
    
    .notice-text {
        font-size: 13px;
    }
    
    .category-buttons {
        padding-bottom: 10px;
        display: flex;
        flex-wrap: wrap;
    }
    
    .category-btn {
        flex-shrink: 0;
        scroll-snap-align: start;
        white-space: nowrap;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .search-box {
        width: 100%;
        margin-top: 10px;
        order: 2;
    }

    .header-controls .btn-icon, 
    .header-controls .language-switcher {
        order: 1;
    }

    .header-controls {
        width: auto;
        margin-top: 0;
        order: 1;
        justify-content: flex-end;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .topic-meta {
        flex-direction: column;
        gap: 5px;
        font-size: 12px;
    }

    .topic-header .topic-category {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .topic-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 12px;
    }
    
    #topics-list.grid-view {
        grid-template-columns: 1fr;
    }

    .topic-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .topic-detail-meta {
        gap: 10px;
        font-size: 13px;
    }

    .topic-detail-body {
        font-size: 15px;
    }

    .reply-author-name {
        font-size: 13px;
    }
    .reply-content, .nested-reply-item .reply-content {
        font-size: 13px;
    }
    .reply-form textarea {
        font-size: 13px;
        min-height: 60px;
    }

    #notifications-btn, #new-topic-btn {
    }
    
    .logo {
    }

    .language-switcher {
        bottom: 10px;
        right: 45px;
    }
}

@media (max-width: 480px) {
    #new-topic-form {
        padding: 15px;
        border-radius: var(--border-radius);
    }
    
    .form-header {
        margin-top: 10px;
        padding-bottom: 10px;
    }
    
    #close-new-topic {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
    }
    #close-new-topic i {
        font-size: 14px;
    }

    .topic-title {
        font-size: 1.1rem;
    }

    .topic-content {
        font-size: 13px;
    }

    .modal-content {
        padding: 20px;
        max-width: calc(100% - 30px);
    }

    .modal-content h2 {
        font-size: 1.3rem;
    }

    .form-group input {
        font-size: 14px;
        padding: 8px 10px;
    }

    .modal-actions button {
        padding: 8px 15px;
        font-size: 13px;
    }

    .admin-btn { 
        bottom: 20px;
    }

    .language-switcher {
        padding: 3px;
    }
    .language-switcher button {
        width: 28px;
        height: 20px;
        font-size: 10px;
    }
}

@media (max-width: 400px) {
    .header-controls {
        flex-direction: row;
        align-items: center;
        gap: 5px;
    }

    .header-controls .btn-icon {
        padding: 3px;
        font-size: 18px;
    }
    
    .language-switcher button {
        width: 30px;
        height: 22px;
        font-size: 11px;
    }
    
    .notification-count {
    }
    
    #notifications-btn {
        position: relative;
    }
    
    .logo h1 {
        font-size: 1.6rem;
    }
    .logo img {
        width: 35px;
        height: 35px;
    }

    .language-switcher {
        right: 40px;
    }
}

/* Topic Detail View Styles */
#topic-detail {
    background-color: white;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.topic-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.topic-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.topic-actions button {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.topic-actions button i {
    font-size: 14px;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background-color: #1976D2;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #da190b;
}

/* Hiệu ứng hover cho các nút */
.topic-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Hiệu ứng khi click */
.topic-actions button:active {
    transform: translateY(0);
    box-shadow: none;
}

.topic-detail-content {
    margin-bottom: 30px;
    padding: 25px;
}

.topic-detail-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.topic-detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    color: var(--gray-color);
    font-size: 14px;
    flex-wrap: wrap;
}

.topic-detail-body {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.7;
}

.topic-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.topic-replies {
    margin-bottom: 30px;
}

.topic-replies h3 {
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topic-replies h3 i {
    color: var(--primary-color);
}

#replies-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reply-item {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 12px 15px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
}

.reply-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.reply-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.reply-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reply-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
}

.reply-info {
    display: flex;
    flex-direction: column;
}

.reply-author-name {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 14px;
}

.reply-date {
    font-size: 11px;
    color: var(--gray-color);
}

.reply-actions {
    display: flex;
    gap: 8px;
}

.reply-actions button {
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.reply-actions button:hover {
    color: var(--primary-color);
}

.reply-content {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.reply-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--gray-color);
}

.reply-reactions {
    display: flex;
    gap: 10px;
}

.reaction {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.reaction:hover {
    color: var(--primary-color);
}

.new-reply {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 30px;
}

.new-reply h3 {
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.new-reply h3 i {
    color: var(--primary-color);
}

/* Nested replies styling */
.nested-replies {
    margin-left: 30px;
    margin-top: 10px;
    border-left: 2px solid var(--border-color);
    padding-left: 15px;
}

.nested-reply-item {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: calc(var(--border-radius) - 2px);
    padding: 10px 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nested-reply-item .reply-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.nested-reply-item .reply-content {
    font-size: 13px;
    line-height: 1.45;
}

.reply-to-reply {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.reply-form {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    display: none;
}

.reply-form.active {
    display: block;
}

.reply-form textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px;
    margin-bottom: 8px;
    min-height: 70px;
    font-size: 13px;
}

.reply-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    color: #8e44ad;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus {
    border-color: #8e44ad;
    outline: none;
    box-shadow: 0 0 0 2px rgba(142, 68, 173, 0.2);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.modal-actions .btn-primary {
    background-color: #8e44ad;
    color: white;
    border: none;
}

.modal-actions .btn-primary:hover {
    background-color: #9b59b6;
}

.modal-actions .btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.modal-actions .btn-secondary:hover {
    background-color: #e5e5e5;
}

/* Enhanced form styles */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    padding-right: 40px;
}

.form-content {
    transition: all 0.3s ease;
}

.error-message {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.error-message.active {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Tags input styles */
.tags-input-container {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 5px;
    min-height: 46px;
    background-color: white;
    transition: all 0.3s ease;
}

.tags-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.1);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    display: flex;
    align-items: center;
    background-color: var(--primary-light);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    transition: all 0.2s ease;
    margin: 2px;
}

.tag:hover {
    background-color: var(--primary-dark);
}

.tag .remove-tag {
    margin-left: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.tag .remove-tag:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

#tags-input {
    flex: 1;
    min-width: 50px;
    border: none;
    outline: none;
    padding: 5px;
    font-size: 14px;
    font-family: var(--main-font);
}

.tags-hint {
    font-size: 12px;
    color: var(--gray-color);
    margin-top: 5px;
}

/* Form success message */
.form-success {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
}

.form-success.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.success-icon {
    font-size: 60px;
    color: var(--success-color);
    margin-bottom: 20px;
    animation: success-bounce 0.6s ease;
}

@keyframes success-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-30px); }
    60% { transform: translateY(-15px); }
}

.form-success h3 {
    margin-bottom: 30px;
    text-align: center;
}

/* Modal animations */
.modal-enter {
    animation: modalEnter 0.3s ease forwards;
}

.modal-leave {
    animation: modalLeave 0.3s ease forwards;
}

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

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

/* Enhanced form responsiveness */
@media (max-width: 600px) {
    .tags-input-container {
        padding: 8px 5px;
    }
    
    .tag {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .form-header h2 {
        font-size: 18px;
    }
    
    .success-icon {
        font-size: 50px;
    }
}

/* Form tạo chủ đề mới - cải thiện vị trí */
#new-topic-form {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 25px;
    overflow: visible;
}

/* Tiêu đề form */
#new-topic-form .form-header {
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

#new-topic-form .form-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Cải thiện form controls */
#new-topic-form .form-group {
    margin-bottom: 20px;
}

#new-topic-form .form-group label {
    font-weight: 500;
    display: block;
    margin-bottom: 8px;
    color: #333;
}

#new-topic-form .form-group input,
#new-topic-form .form-group select,
#new-topic-form .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

/* Đặt lại vị trí các nút */
#new-topic-form .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 15px;
}

#new-topic-form #close-new-topic {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.05);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Nút Tạo chủ đề */
#new-topic-form #submit-topic {
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
}

#new-topic-form #cancel-topic {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 5px;
}

@media (max-width: 768px) {
    #new-topic-form {
        margin: 10px auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    #new-topic-form {
        padding: 15px;
    }
    
    #new-topic-form .form-header h2 {
        font-size: 1.3rem;
    }
}

/* Hiển thị hình ảnh trong chi tiết bài viết */
.topic-image {
    margin: 15px 0;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.topic-image img.detail-image {
    max-width: 100%;
    max-height: 400px; /* Giảm max-height cho ảnh chi tiết trên mobile */
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.topic-image img.detail-image:hover {
    transform: scale(1.02);
}

.topic-detail-body {
    margin: 20px 0;
    line-height: 1.7;
}

/* Hiển thị danh sách hình ảnh trong bài viết */
.topic-images-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.gallery-item {
    flex: 0 0 calc(33.333% - 10px);
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .gallery-item {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 480px) {
    .gallery-item {
        flex: 0 0 100%;
    }
    
    .topic-image img.detail-image {
        max-height: 250px; /* Giảm nữa max-height ảnh trên màn hình rất nhỏ */
    }
}

.image-error {
    padding: 30px;
    background-color: #f8f9fa;
    border: 1px dashed #ddd;
    border-radius: 8px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

.image-error .icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.topic-image {
    position: relative;
    overflow: hidden;
}

/* Styles for pinned posts */
.pinned-topic {
    position: relative;
    color: var(--primary-dark);
}

.pinned-icon {
    color: var(--primary-color);
    margin-right: 8px;
    transform: rotate(45deg);
}

.topic-item.pinned {
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 8px 30px rgba(142, 68, 173, 0.15);
}

.topic-item.pinned::before {
    background-color: var(--primary-color);
}

/* Styles for topic actions */
.topic-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.topic-actions button {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.topic-actions button i {
    font-size: 14px;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background-color: #1976D2;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #da190b;
}

/* Hiệu ứng hover cho các nút */
.topic-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Hiệu ứng khi click */
.topic-actions button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Admin user indicator */
.admin-user {
    color: var(--primary-color);
    font-weight: bold;
}

#login-info {
    margin-left: auto;
    padding: 8px 15px;
    font-size: 14px;
    order: 6;
}

/* User role styles in replies */
.user-role {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    background-color: var(--gray-color);
    color: white;
}

.role-admin {
    background-color: var(--primary-color);
    color: white;
}

.role-user {
    background-color: var(--gray-color);
    color: white;
}

/* Responsive styles for actions */
@media (max-width: 600px) {
    .topic-actions {
        flex-wrap: wrap;
    }
    
    .topic-actions button {
        flex: 1;
        justify-content: center;
    }
}

/* Admin Button States */
.admin-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Trạng thái chưa đăng nhập */
.admin-btn.logged-out {
    background-color: #e74c3c;
    color: white;
}

/* Trạng thái đã đăng nhập */
.admin-btn.logged-in {
    background-color: #27ae60;
    color: white;
    animation: pulse 2s infinite;
}

.admin-btn:hover {
    transform: scale(1.1);
}

.admin-btn i {
    font-size: 20px;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(39, 174, 96, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

/* Tooltip cho nút admin */
.admin-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.admin-btn:hover::after {
    visibility: visible;
    opacity: 1;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    color: #8e44ad;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus {
    border-color: #8e44ad;
    outline: none;
    box-shadow: 0 0 0 2px rgba(142, 68, 173, 0.2);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.modal-actions .btn-primary {
    background-color: #8e44ad;
    color: white;
    border: none;
}

.modal-actions .btn-primary:hover {
    background-color: #9b59b6;
}

.modal-actions .btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.modal-actions .btn-secondary:hover {
    background-color: #e5e5e5;
}

/* Admin Control Panel Styles */
#admin-control-panel {
    max-width: 800px; /* Or your preferred width */
    margin: 30px auto; /* Center the panel and add top/bottom margin */
    background-color: var(--white-color);
    border-radius: var(--border-radius-large, 12px); /* Use a larger radius for a modern look */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    padding: 25px 30px; /* More padding inside */
    border: 1px solid var(--border-color-light, #e0e0e0);
    transition: all 0.3s ease-in-out;
}

#admin-control-panel.hidden {
    display: none; /* Ensure it's fully hidden */
}

#admin-control-panel.visible {
    display: block; /* Or flex/grid if needed internally */
    animation: fadeInFromTop 0.5s ease-out forwards;
}

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

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color-light, #eee);
}

.admin-panel-header h3 {
    margin: 0;
    font-size: 1.8rem; /* Larger title */
    color: var(--primary-dark);
    font-weight: 600;
}

.admin-panel-header h3 i {
    margin-right: 12px;
    color: var(--primary-color);
}

#admin-username-panel {
    font-size: 0.85rem;
    color: var(--text-muted-color, #757575);
    background-color: var(--background-muted-color, #f5f5f5);
    padding: 5px 10px;
    border-radius: var(--border-radius-small, 4px);
}

/* Styling for the "Create Notification" button and form inside the panel */
#panel-create-notification-btn {
    /* Adjust if needed, e.g., margin-bottom */
    margin-bottom: 20px; 
    display: inline-flex; /* For icon alignment */
    align-items: center;
    gap: 8px;
    padding: 10px 20px; /* Adjust padding */
    font-size: 1rem;
}

#inline-create-notification-form {
    background-color: var(--background-color-light, #f9f9f9); /* Slightly different background */
    padding: 20px;
    border-radius: var(--border-radius, 8px);
    border: 1px solid var(--border-color-light, #e0e0e0);
    margin-top: 0; /* Remove top margin if button is directly above */
}

#inline-create-notification-form.hidden {
    display: none;
}

#inline-create-notification-form h4 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 500;
}

#inline-create-notification-form .form-group {
    margin-bottom: 20px; /* More spacing */
}

#inline-create-notification-form label {
    display: block;
    margin-bottom: 8px; /* More space for label */
    font-weight: 500;
    color: var(--text-color-dark, #333);
}

#inline-create-notification-form input[type="text"],
#inline-create-notification-form textarea,
#inline-create-notification-form select {
    padding: 12px 15px; /* Larger padding */
    font-size: 1rem; /* Consistent font size */
}

#inline-create-notification-form .form-actions {
    margin-top: 25px; /* More space before action buttons */
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    gap: 10px;
}

/* Enhanced Notification Panel Item Styles */
.notifications-list .notification-item {
    display: flex;
    align-items: flex-start; /* Align items to the top for varying text lengths */
    padding: 15px;
    margin-bottom: 10px;
    background-color: var(--notification-background-color);
    border-radius: var(--border-radius, 8px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.07);
    transition: background-color 0.2s ease, transform 0.2s ease;
    border-left-width: 5px;
    border-left-style: solid;
    position: relative; /* For potential future absolute positioned elements */
}

.notifications-list .notification-item:last-child {
    margin-bottom: 0;
}

.notifications-list .notification-item:hover {
    background-color: var(--notification-item-hover-bg);
    transform: translateY(-2px);
}

.notifications-list .notification-item .notification-item-icon-area {
    margin-right: 15px;
    padding-top: 2px; /* Align icon slightly with the title */
}

.notifications-list .notification-item .notification-item-icon-area i {
    font-size: 1.4em; /* Larger icon */
    width: 24px; /* Ensure consistent width for icon container */
    text-align: center;
}

.notifications-list .notification-item .notification-item-content-area {
    flex-grow: 1;
}

.notifications-list .notification-item .notification-item-title {
    font-weight: 600;
    font-size: 0.95em;
    color: var(--notification-title-color);
    margin-bottom: 5px;
    line-height: 1.3;
}

.notifications-list .notification-item .notification-item-body {
    font-size: 0.85em;
    color: var(--notification-body-color);
    line-height: 1.5;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.notifications-list .notification-item .notification-item-timestamp {
    font-size: 0.75em;
    color: var(--notification-timestamp-color);
}

/* Type-specific colors */
.notifications-list .notification-item.notification-item-important {
    border-left-color: var(--notification-color-important);
}
.notifications-list .notification-item.notification-item-important .notification-item-icon-area i {
    color: var(--notification-color-important);
}

.notifications-list .notification-item.notification-item-event {
    border-left-color: var(--notification-color-event);
}
.notifications-list .notification-item.notification-item-event .notification-item-icon-area i {
    color: var(--notification-color-event);
}

.notifications-list .notification-item.notification-item-technical {
    border-left-color: var(--notification-color-technical);
}
.notifications-list .notification-item.notification-item-technical .notification-item-icon-area i {
    color: var(--notification-color-technical);
}

.notifications-list .notification-item.notification-item-regulation {
    border-left-color: var(--notification-color-regulation);
}
.notifications-list .notification-item.notification-item-regulation .notification-item-icon-area i {
    color: var(--notification-color-regulation);
}

.notifications-list .notification-item.notification-item-general {
    border-left-color: var(--notification-color-general);
}
.notifications-list .notification-item.notification-item-general .notification-item-icon-area i {
    color: var(--notification-color-general);
}

/* Empty/Error state in panel */
.notifications-list .notification-item-empty p,
.notifications-list .notification-item-error p {
    padding: 20px;
    text-align: center;
    color: #757575;
    font-style: italic;
}
.notifications-list .notification-item-error p {
    color: var(--danger-color, #d32f2f);
    font-style: normal;
}

/* Tăng kích thước khung trả lời lồng nhau */
.nested-reply-form, .reply-form {
    width: 100%;
    max-width: 600px;
    margin: 10px 0 10px 40px;
    padding: 16px 18px;
    background: #f8f8fc;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(142,68,173,0.07);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nested-reply-form textarea, .reply-form textarea {
    width: 100%;
    min-height: 60px;
    font-size: 1rem;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    resize: vertical;
}

.nested-reply-form input[type="file"], .reply-form input[type="file"] {
    margin-top: 6px;
}

.nested-reply-form .btn, .reply-form .btn {
    width: fit-content;
    min-width: 120px;
    font-size: 1rem;
    padding: 8px 18px;
    margin-top: 6px;
}

@media (max-width: 600px) {
  .nested-reply-form, .reply-form {
    max-width: 100%;
    margin-left: 0;
    padding: 12px 6px;
  }
  .nested-reply-form textarea, .reply-form textarea {
    font-size: 0.95rem;
    padding: 8px 8px;
  }
  .nested-reply-form .btn, .reply-form .btn {
    min-width: 90px;
    font-size: 0.95rem;
    padding: 7px 10px;
  }
}

/* Reply lồng ghép cấp 1 */
.reply-item.depth-1 {
    background: #faf6ff !important;
    border-radius: 14px !important;
    margin-bottom: 14px !important;
    padding: 16px 14px 12px 18px !important;
    box-shadow: 0 2px 8px rgba(142,68,173,0.07);
}

/* Reply lồng ghép cấp 2 */
.reply-item.depth-2 {
    background: #fff8f0 !important;
    border-radius: 12px !important;
    margin: 10px 0 10px 28px !important;
    padding: 14px 12px 10px 16px !important;
    box-shadow: 0 1px 4px rgba(255,152,0,0.07);
}

/* Reply lồng ghép cấp 3 */
.reply-item.depth-3 {
    background: #f0f7ff !important;
    border-radius: 10px !important;
    margin: 8px 0 8px 40px !important;
    padding: 10px 10px 8px 14px !important;
    box-shadow: 0 1px 3px rgba(52,152,219,0.07);
}

/* Đường viền reply con */
.reply-children {
    margin-left: 0;
    padding-left: 0;
}

/* Responsive cho mobile */
@media (max-width: 600px) {
    .reply-item.depth-2 { margin-left: 10px !important; }
    .reply-item.depth-3 { margin-left: 16px !important; }
    .reply-item.depth-1, .reply-item.depth-2, .reply-item.depth-3 {
        padding: 10px 6px 8px 10px !important;
        border-radius: 8px !important;
    }
}

/* Reply lồng ghép cấp 1 - Dapps */
.reply-item.depth-1[data-category="dapps"] {
    border-left: 4px solid var(--dapps-color);
}
/* Reply lồng ghép cấp 1 - Node */
.reply-item.depth-1[data-category="node"] {
    border-left: 4px solid var(--node-color);
}
/* Reply lồng ghép cấp 1 - Docker */
.reply-item.depth-1[data-category="docker"] {
    border-left: 4px solid var(--docker-color);
}
/* Reply lồng ghép cấp 1 - Mainnet */
.reply-item.depth-1[data-category="mainnet"] {
    border-left: 4px solid var(--mainnet-color);
}
/* Reply lồng ghép cấp 1 - General */
.reply-item.depth-1[data-category="general"] {
    border-left: 4px solid var(--general-color);
}
/* Reply lồng ghép cấp 1 - Trading */
.reply-item.depth-1[data-category="trading"] {
    border-left: 4px solid var(--trading-color);
}

/* Các cấp lồng sâu hơn có thể dùng màu nhạt hơn hoặc cùng màu nhưng giảm opacity */
.reply-item.depth-2[data-category] {
    border-left: 4px solid rgba(160,66,182,0.5); /* Mặc định tím nhạt, sẽ override bên dưới */
}
.reply-item.depth-2[data-category="dapps"] { border-left: 4px solid rgba(156,39,176,0.5); }
.reply-item.depth-2[data-category="node"] { border-left: 4px solid rgba(103,58,183,0.5); }
.reply-item.depth-2[data-category="docker"] { border-left: 4px solid rgba(3,169,244,0.5); }
.reply-item.depth-2[data-category="mainnet"] { border-left: 4px solid rgba(0,150,136,0.5); }
.reply-item.depth-2[data-category="general"] { border-left: 4px solid rgba(96,125,139,0.5); }
.reply-item.depth-2[data-category="trading"] { border-left: 4px solid rgba(255,152,0,0.5); }

.reply-item.depth-3[data-category] {
    border-left: 4px solid rgba(160,66,182,0.25); /* Mặc định tím nhạt hơn */
}
.reply-item.depth-3[data-category="dapps"] { border-left: 4px solid rgba(156,39,176,0.25); }
.reply-item.depth-3[data-category="node"] { border-left: 4px solid rgba(103,58,183,0.25); }
.reply-item.depth-3[data-category="docker"] { border-left: 4px solid rgba(3,169,244,0.25); }
.reply-item.depth-3[data-category="mainnet"] { border-left: 4px solid rgba(0,150,136,0.25); }
.reply-item.depth-3[data-category="general"] { border-left: 4px solid rgba(96,125,139,0.25); }
.reply-item.depth-3[data-category="trading"] { border-left: 4px solid rgba(255,152,0,0.25); }

@media (max-width: 600px) {
  #topic-detail .topic-detail-header .topic-title,
  #topic-detail .topic-title,
  #topic-detail h2.topic-title {
    font-size: 1.575rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.5rem !important;
  }
  #topic-detail .topic-detail-body {
    font-size: 1.38rem !important;
    line-height: 1.45 !important;
    padding: 8px 0 !important;
  }
  #topic-detail .topic-detail-content {
    padding: 10px !important;
  }
  .reply-item, .nested-reply-item {
    font-size: 0.92rem !important;
    padding: 8px 6px !important;
    margin-bottom: 10px !important;
  }
  .reply-header, .reply-footer {
    font-size: 0.9rem !important;
    padding: 2px 0 !important;
  }
  .reply-content {
    font-size: 0.95rem !important;
    padding: 2px 0 !important;
  }
  .reply-form textarea, .nested-reply-form textarea, .nested-reply-textarea {
    font-size: 0.95rem !important;
    min-height: 60px !important;
    padding: 6px !important;
  }
  .reply-image-container img,
  .attached-reply-image,
  .topic-image img.detail-image {
    max-width: 100%;
    max-height: 180px !important;
    border-radius: 6px;
  }
  .topic-image {
    margin: 10px 0 !important;
  }
  .reply-form, .nested-reply-form {
    padding: 6px 0 !important;
  }
  .reply-footer, .reply-actions {
    gap: 6px !important;
  }
  .reply-to-reply {
    font-size: 0.88rem !important;
    margin-bottom: 2px !important;
  }
  .reply-avatar {
    width: 28px !important;
    height: 28px !important;
    font-size: 1rem !important;
  }
  .reply-author-name {
    font-size: 0.98rem !important;
  }
  .reply-date {
    font-size: 0.85rem !important;
  }
  .topic-tags, .topic-detail-tags {
    gap: 6px !important;
    font-size: 0.9rem !important;
  }
  .topic-tag {
    padding: 2px 7px !important;
    font-size: 0.88rem !important;
    border-radius: 6px !important;
  }
  .new-reply.card, .reply-form, .nested-reply-form {
    margin-bottom: 10px !important;
    padding: 8px !important;
  }
  .form-group input, .form-group textarea {
    font-size: 0.95rem !important;
    padding: 7px 8px !important;
  }
  .form-actions button, .reply-form-actions button {
    font-size: 0.95rem !important;
    padding: 7px 12px !important;
  }
}

/* Giảm độ dày viền trái reply lồng ghép còn 1/3 (2px) */
.reply-item.depth-1,
.reply-item.depth-2,
.reply-item.depth-3 {
    border-left-width: 2px !important;
}

.reply-item.depth-1[data-category],
.reply-item.depth-2[data-category],
.reply-item.depth-3[data-category] {
    border-left-width: 2px !important;
}

/* Reply lồng ghép cấp 1 - màu viền theo category */
.reply-item.depth-1[data-category="dapps"]    { border-left: 2px solid var(--dapps-color) !important; }
.reply-item.depth-1[data-category="node"]     { border-left: 2px solid var(--node-color) !important; }
.reply-item.depth-1[data-category="docker"]   { border-left: 2px solid var(--docker-color) !important; }
.reply-item.depth-1[data-category="mainnet"]  { border-left: 2px solid var(--mainnet-color) !important; }
.reply-item.depth-1[data-category="general"]  { border-left: 2px solid var(--general-color) !important; }
.reply-item.depth-1[data-category="trading"]  { border-left: 2px solid var(--trading-color) !important; }

/* Reply lồng ghép cấp 2 - màu nhạt hơn */
.reply-item.depth-2[data-category="dapps"]    { border-left: 2px solid rgba(156,39,176,0.5) !important; }
.reply-item.depth-2[data-category="node"]     { border-left: 2px solid rgba(103,58,183,0.5) !important; }
.reply-item.depth-2[data-category="docker"]   { border-left: 2px solid rgba(3,169,244,0.5) !important; }
.reply-item.depth-2[data-category="mainnet"]  { border-left: 2px solid rgba(0,150,136,0.5) !important; }
.reply-item.depth-2[data-category="general"]  { border-left: 2px solid rgba(96,125,139,0.5) !important; }
.reply-item.depth-2[data-category="trading"]  { border-left: 2px solid rgba(255,152,0,0.5) !important; }

/* Reply lồng ghép cấp 3 - màu nhạt hơn nữa */
.reply-item.depth-3[data-category="dapps"]    { border-left: 2px solid rgba(156,39,176,0.25) !important; }
.reply-item.depth-3[data-category="node"]     { border-left: 2px solid rgba(103,58,183,0.25) !important; }
.reply-item.depth-3[data-category="docker"]   { border-left: 2px solid rgba(3,169,244,0.25) !important; }
.reply-item.depth-3[data-category="mainnet"]  { border-left: 2px solid rgba(0,150,136,0.25) !important; }
.reply-item.depth-3[data-category="general"]  { border-left: 2px solid rgba(96,125,139,0.25) !important; }
.reply-item.depth-3[data-category="trading"]  { border-left: 2px solid rgba(255,152,0,0.25) !important; }

/* ========================================= */
/* Styles for Notifications Panel            */
/* ========================================= */

#notifications-panel {
    position: fixed;
    top: 60px; /* Điều chỉnh tùy theo chiều cao header của bạn */
    right: 20px;
    width: 100%; /* Chiếm toàn bộ chiều rộng trên mobile */
    max-width: 360px; /* Giới hạn chiều rộng trên desktop */
    max-height: calc(100vh - 80px); /* Chiều cao tối đa, chừa khoảng cách với top/bottom */
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001; /* Đảm bảo nổi lên trên */
    display: flex; /* Sử dụng flex để dễ dàng quản lý header và list */
    flex-direction: column;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out; /* Animation khi ẩn/hiện */
}

#notifications-panel.hidden {
    transform: translateX(100%); /* Trượt ra khỏi màn hình khi ẩn */
    opacity: 0;
    pointer-events: none; /* Không cho tương tác khi ẩn */
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eeeeee;
    background-color: #f8f9fa; /* Màu nền nhẹ cho header panel */
    border-top-left-radius: 8px; /* Bo góc cho header */
    border-top-right-radius: 8px;
}

.notifications-header h3 {
    margin: 0;
    font-size: 1rem; /* 16px */
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notifications-header .btn-icon {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #777;
    cursor: pointer;
    padding: 5px;
}
.notifications-header .btn-icon:hover {
    color: #333;
}

.notifications-list {
    padding: 10px;
    overflow-y: auto; /* Cho phép cuộn nếu nhiều thông báo */
    flex-grow: 1; /* Để list chiếm phần không gian còn lại */
}

.notification-item {
    background-color: #fff;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    border-left-width: 5px; /* Độ rộng của viền trái màu */
    transition: box-shadow 0.2s ease;
}

.notification-item:last-child {
    margin-bottom: 0;
}

.notification-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.notification-item-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.notification-item-header i {
    margin-right: 8px;
    font-size: 1.1em; /* Kích thước icon */
    text-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Hiệu ứng 3D nhẹ */
}

.notification-item-header strong {
    font-size: 0.9em; /* Kích thước chữ loại thông báo */
    color: #555;
}

.notification-item p {
    font-size: 0.875rem; /* 14px */
    color: #333;
    line-height: 1.5;
    margin: 0 0 5px 0;
    word-wrap: break-word; /* Đảm bảo chữ dài xuống dòng */
}

.notification-item small {
    font-size: 0.75rem; /* 12px */
    color: #777;
}

/* --- Màu sắc viền trái và icon theo loại thông báo --- */

/* Important (Vàng) */
.notification-item.item-important {
    border-left-color: #ffc107; 
}
.notification-item.item-important .notification-item-header i {
    color: #ffc107;
}

/* Event (Xanh lá) */
.notification-item.item-event {
    border-left-color: #28a745;
}
.notification-item.item-event .notification-item-header i {
    color: #28a745;
}

/* Technical (Xanh dương) */
.notification-item.item-technical {
    border-left-color: #007bff;
}
.notification-item.item-technical .notification-item-header i {
    color: #007bff;
}

/* Regulation (Cam) */
.notification-item.item-regulation {
    border-left-color: #fd7e14;
}
.notification-item.item-regulation .notification-item-header i {
    color: #fd7e14;
}

/* General (Xám) - Hoặc màu bạn muốn cho loại 'general' */
.notification-item.item-general {
    border-left-color: #6c757d;
}
.notification-item.item-general .notification-item-header i {
    color: #6c757d;
}

/* Fallback nếu không có type hoặc type không khớp */
.notification-item:not([class*="item-"]) { /* Nếu không có class item-TYPE */
    border-left-color: #6c757d; /* Màu mặc định */
}
.notification-item:not([class*="item-"]) .notification-item-header i {
    color: #6c757d; /* Màu icon mặc định */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 767px) {
    #notifications-panel {
        top: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh; /* Chiếm toàn bộ chiều cao trên mobile */
        max-height: 100vh;
        border-radius: 0;
        border-left: none; /* Bỏ border trái/phải của panel trên mobile nếu nó chạm sát cạnh */
        border-right: none;
        box-shadow: none; /* Có thể bỏ shadow trên mobile nếu muốn */
    }

    #notifications-panel.hidden {
        transform: translateX(100%); /* Vẫn giữ hiệu ứng trượt */
    }
    
    .notifications-header {
        padding: 15px; /* Tăng padding header trên mobile */
        border-top-left-radius: 0; /* Bỏ bo góc trên mobile */
        border-top-right-radius: 0;
    }
}

.topic-item,
.topic-content,
.topic-title,
.topic-meta,
.topic-tags,
.tag,
#topics-list,
.topics-list {
    font-family: 'Inter', 'Be Vietnam Pro', Roboto, 'Noto Sans', Arial, sans-serif !important;
}
html, body, input, button, textarea, select,
.topic-item, .topic-content, .topic-title, .topic-meta, .topic-tags, .tag, #topics-list, .topics-list,
.topic-card, .topic-header .topic-title
{
    font-family: 'Inter', sans-serif !important;
}

.topic-title {
    font-size: 1.15rem !important;
}
.topic-content {
    font-size: 1rem !important;
}
.topic-meta, .topic-tags, .tag {
    font-size: 0.97rem !important;
}
.topic-detail-title {
    font-size: 2.025rem !important;
}
.topic-detail-body {
    font-size: 1.62rem !important;
}
.topic-detail-meta, .topic-detail-tags, .topic-tag {
    font-size: 0.99rem !important;
}

/* Ensure good Vietnamese font rendering for My Replies page */
.my-reply-item,
.my-reply-item .topic-title,
.my-reply-item .topic-meta span,
.my-reply-item .my-reply-content-preview,
.my-reply-item .my-reply-context a,
.my-reply-item .my-reply-context small {
    font-family: 'Inter', 'Be Vietnam Pro', Roboto, 'Noto Sans', Arial, sans-serif !important;
}