/* ==========================================
   GLOBAL THEME VARIABLES (Dùng chung cho các trang)
   ========================================== */
:root {
    --bg: #f7f7f7;
    --text-color: #222222;
    --card-bg: #eaeef4;
    --header-bg: #e0e0e0;
    --panel-bg: #d1d5db;
    --panel-btn-text: #374151;
    --panel-btn-hover: rgba(0, 0, 0, 0.08);
    --panel-btn-active: #ffffff;
    --panel-btn-active-text: #000000;
    --panel-divider: #9ca3af;
    --card-border: #e2e2e2;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.08);
    --input-bg: #daeeff;

}

body.dark-mode {
    /* 1. Nền trang: Xanh đen Slate dịu mắt, không quá chói */
    --bg: #0f172a;

    /* 2. Màu chữ: Trắng ngà nhẹ (dễ đọc, giảm mỏi mắt) */
    --text-color: #f8fafc;
    --text-sub: #94a3b8;

    /* 3. Nền các thẻ Card (Reading cards, Header...): Tông xanh xám đăm hơn */
     --card-bg: #1e293b;
      --header-bg: #1e293b;

    /* 4. Floating Panel Background: Nền thanh cài đặt nổi bật nhẹ hơn nền trang */
    --panel-bg: #1e293b;

    /* 5. Nút bấm trong Panel */
    --panel-btn-text: #94a3b8;
    --panel-btn-hover: rgba(255, 255, 255, 0.08);
    --panel-btn-active: #38bdf8; /* Màu xanh Cyan nhẹ làm điểm nhấn khi active */
    --panel-btn-active-text: #0f172a;
    --panel-divider: #334155;
    --input-bg: #17486f;
    /* 6. Viền & Bóng đổ */
    --card-border: #334155;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 8px 24px rgba(56, 189, 248, 0.15); /* Bóng hắt xanh nhẹ */
}

/* ==========================================
   FLOATING SETTINGS PANEL STYLES
   ========================================== */
.floating-panel {
    position: fixed;
    top: 50%; /* Position top edge at the middle of the screen */
    transform: translateY(-50%); /* Shift up by half its own height */
    right: 30px;
    z-index: 9999;

    height: max-content;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;

    background-color: var(--panel-bg);
    padding: 10px 6px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: background-color 0.3s ease;
}

.panel-btn {
    background: transparent;
    border: none;
    color: var(--panel-btn-text);
    font-size: 20px;
    font-weight: 600;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.panel-btn:hover {
    background-color: var(--panel-btn-hover);
    color: var(--text-color);
}

.panel-btn.active {
    background-color: var(--panel-btn-active);
    color: var(--panel-btn-active-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.panel-divider {
    width: 70%;
    height: 1px;
    background-color: var(--panel-divider);
    margin: 2px 0;
}

/* --- TABS SYSTEM --- */
header {
    width: 100%;
    max-width: 2000px;
    background-color: var(--header-bg);
    border-radius: 12px;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.brand .logo-text {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-color);
    line-height: 1;
    text-decoration: none;
}

.htit {
    color: var(--text-color);
    font-size: 30px
}

.brand .logo-text:hover {
    color: #007bff; /* Thay bằng màu xanh link bạn muốn */
    text-decoration: underline;
}

.brand .tagline {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 400;
    margin-top: 4px;
}


h3 .custom-link {
    color: inherit;            /* Inherit the text color from the h3 parent */
    text-decoration: none;     /* Remove the default underline */
    display: inline-block;     /* Allows for proper padding and click area mapping */
}
h3 .custom-link:hover {
    text-decoration: underline; /* Bring back the underline on hover */
    color: #007bff;            /* Change color on hover if desired */
}

.tabs {
    display: flex;
    gap: 12px;
}

.tab-btn {
    background-color: #6495ed;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    color: #222;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover, .tab-btn.active {
    background-color: #ff7b47;
    color: #fff;
    transform: translateY(-2px);
}

.tabs-content {
    width: 100%;
    max-width: 1100px;
    display: flex;
    justify-content: center;
}

@media (max-width: 600px) {

    .floating-panel {
        position: fixed !important;

        right: 16px !important;
        bottom: 76px !important;

        top: auto !important;
        left: auto !important;

        z-index: 9997 !important;

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transform: translateY(10px);

        transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
    }

    .floating-panel.mobile-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform: translateY(0);
    }
}
