/* ============================
   Light Theme Styles
   ============================ */

/*
   Here we override the default dark colors set in dark-theme.css.
*/

body.light-theme {
    /* Backgrounds */
    --bg-body: #ffffff;       /* Pure white background */
    --bg-card: #f8f9fa;       /* Very light grey for cards */
    --bg-search: #ffffff;     /* White search bar */
    --bg-btn-hover: #e2e8f0;  /* Light hover */
    --bg-btn-active: #3f51b5; /* Primary accent blue */
    --bg-btn-transparent: rgba(0,0,0,0.05);
    
    /* Borders */
    --border-color: #e2e6ec;  /* Light grey border */
    --border-hover: #b0b7c3;
    
    /* Text Colors */
    --text-main: #121212;     /* Pure dark text */
    --text-muted: #4a5568;    /* Muted dark text */
    --text-search: #121212;
    --text-btn: #4a5568;
    --text-btn-hover: #121212; /* Text remains dark when hovering */
    --text-btn-active: #ffffff;
    
    /* Logo Colors */
    --logo-bg: #ffffff;       /* Light box for light theme */
    --logo-text: #121212;     /* Dark text inside light box */

    /* Scroll To Top Button */
    --scroll-bg: #e2e6ec;     /* Visibly grey so it pops off pure white body */

    /* Accents & Links */
    --link-color: #007bff;
    --link-hover: #0056b3;
    --link-active: #004494;
    
    /* Shadow */
    --card-shadow-hover: 0 12px 24px rgba(0,0,0,0.08);

    /* Alt Elements */
    --bg-alt: #f4f6f8;
    --border-alt: rgba(0,0,0,0.1);
    --bg-input: rgba(0,0,0,0.05);

    /* Footer */
    --bg-footer: var(--bg-card); /* Match navbar */
    --border-footer: rgba(0,0,0,0.1);

    /* Mobile Nav */
    --bg-nav-submenu: var(--bg-card); /* Match header background for seamless look */

    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Overriding global text components */
body.light-theme p,
body.light-theme h1, body.light-theme h2, body.light-theme h3,
body.light-theme h4, body.light-theme h5, body.light-theme h6,
body.light-theme strong, body.light-theme b,
body.light-theme input, body.light-theme select, body.light-theme textarea {
    color: #222222;
}

body.light-theme .timeline-title {
    color: #222222;
}

body.light-theme .timeline-org {
    color: #555555;
}

body.light-theme .timeline-desc {
    color: #444444;
}

/* Links */
body.light-theme a {
    color: #007bff;   /* Xanh dương nhạt nổi trên nền trắng */
    border-bottom-color: rgba(0, 123, 255, 0.3);
}

body.light-theme a:hover {
    color: #0056b3 !important;
}

body.light-theme a:active {
    color: #004494 !important;
}

/* Headers / Menus */
body.light-theme #header {
    background-color: var(--bg-card); /* Use the slightly darker grey/white */
    box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.1);
}

body.light-theme #header a.logo strong,
body.light-theme #header a.logo span {
    color: #333333;
}

body.light-theme #header .header-menu ul li a {
    color: #555555;
}

body.light-theme #header .header-menu ul li a:hover {
    color: #007bff;
}

body.light-theme #header .header-menu .nav-dropdown-menu {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

body.light-theme #header .header-options a.header-btn i,
body.light-theme #header .header-options a.header-btn {
    color: #555555;
}

body.light-theme #header .header-options a.header-btn:hover,
body.light-theme #header .header-options a.header-btn:hover i {
    color: #007bff;
}

body.light-theme #header .header-options .language-switcher .language-menu {
    background: #ffffff;
    border-color: rgba(17, 24, 39, 0.12);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

body.light-theme #header .header-options .language-switcher .language-item {
    color: #2f3b4a;
}

body.light-theme #header .header-options .language-switcher .language-item:hover {
    background: #f3f5f9;
    color: #17233a;
}

body.light-theme #header .header-options .language-switcher .language-item.active {
    background: #f6f8fc;
    color: #16326f;
}

/* Timeline components customization */
body.light-theme #main-about {
    background-color: #f4f6f8;
    color: #333333;
}

body.light-theme .timeline-year {
    background-color: #ffffff;
    color: #333333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 2px solid #007bff;
}

body.light-theme .timeline-container::before {
    background-color: #cccccc;
}

/* Form / Inputs light mode */
body.light-theme input[type="text"],
body.light-theme input[type="password"],
body.light-theme input[type="email"],
body.light-theme select,
body.light-theme textarea {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #333333;
}

body.light-theme input[type="text"]:focus,
body.light-theme input[type="password"]:focus,
body.light-theme input[type="email"]:focus,
body.light-theme select:focus,
body.light-theme textarea:focus {
    border-color: #007bff;
    background: rgba(0, 0, 0, 0.02);
}


body.light-theme .cv-modal-content {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Footer & Other modules */
/* No background override needed here as it's now in main.css using variables */

body.light-theme #footer .copyright li {
    color: #777777;
}

body.light-theme #footer .icons li a.icon.brands {
    color: #777777;
    border-color: rgba(0,0,0,0.1);
}

body.light-theme #footer .icons li a.icon.brands:hover {
    color: #007bff;
    border-color: #007bff;
}

/* Modal text light mode */
body.light-theme .cv-modal-title {
    color: #222222;
}

body.light-theme .cv-modal-subtitle {
    color: #555555;
}

/* Portfolio modal (About page) - light theme */
body.light-theme #portfolio-modal-overlay {
    background: rgba(15, 23, 42, 0.45);
}

body.light-theme .portfolio-modal-content {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.2);
}

body.light-theme .portfolio-modal-title {
    color: #1f2937;
}

body.light-theme .portfolio-modal-subtitle {
    color: #4b5563;
}

body.light-theme #portfolio-password {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #111827;
}

body.light-theme #portfolio-password::placeholder {
    color: #64748b;
}

body.light-theme #portfolio-password:focus {
    border-color: #3b82f6;
    background: #ffffff;
}

body.light-theme .portfolio-modal-actions .button {
    box-shadow: inset 0 0 0 2px #334155;
    color: #334155 !important;
    background-color: #ffffff;
}

body.light-theme .portfolio-modal-actions .button:hover {
    background-color: #e2e8f0;
    color: #0f172a !important;
}

/* Banner overlay opacity/color adjustments if needed */
body.light-theme #banner {
    color: #333333;
    background-color: #e2e8f0;
}

body.light-theme #banner p,
body.light-theme #banner h1 {
    color: #222222;
}

/* Sections and main layout overrides */
body.light-theme #main > section.inner,
body.light-theme #main > section,
body.light-theme #wrapper > header,
body.light-theme #wrapper > section {
    background-color: #f4f6f8;
}

body.light-theme .inner > header.major h2,
body.light-theme .inner > header.major h3 {
    color: #222222;
}

/* Tiles block */
body.light-theme .tiles article {
    background-color: #ffffff;
}
body.light-theme .tiles article > .image::before {
    background-color: rgba(255, 255, 255, 0.2); /* Sáng hoá overlay ảnh */
}

/* Background gradient overrides for Tiles */
body.light-theme .tiles article.style1::before { background-color: #64b5f6; }
body.light-theme .tiles article.style2::before { background-color: #81c784; }
body.light-theme .tiles article.style3::before { background-color: #4fc3f7; }
body.light-theme .tiles article.style4::before { background-color: #ffd54f; }
body.light-theme .tiles article.style5::before { background-color: #a1887f; }
body.light-theme .tiles article.style6::before { background-color: #f06292; }

body.light-theme .tiles article .content h3,
body.light-theme .tiles article .content p {
    color: #ffffff; /* Typically text on image tiles remains white because images are dark */
}

/* Contact section overrides */
body.light-theme #contact {
    background-color: #ffffff;
    border-top: 1px solid rgba(0,0,0,0.1);
}

body.light-theme #contact .contact-method h3 {
    color: #333333;
}

body.light-theme #contact .contact-method span,
body.light-theme #contact .contact-method a {
    color: #555555;
}

body.light-theme #contact .contact-method .icon {
    color: #007bff;
}

/* Form inputs explicitly inside light theme */
body.light-theme form label {
    color: #555555;
}

/* Ensure buttons are visible */
body.light-theme .button,
body.light-theme input[type="submit"],
body.light-theme input[type="reset"],
body.light-theme input[type="button"] {
    background-color: transparent;
    color: #333333 !important;
    border: 1px solid #c0c0c0;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.1);
}

body.light-theme .button:hover,
body.light-theme input[type="submit"]:hover,
body.light-theme input[type="reset"]:hover,
body.light-theme input[type="button"]:hover {
    background-color: rgba(0,0,0,0.05);
    color: #007bff !important;
    box-shadow: inset 0 0 0 2px #007bff;
}

/* ============================
   Custom Tooltip Styles
   ============================ */
.custom-tooltip-container {
    position: relative;
    display: flex;
    align-items: center;
    height: inherit;
}

/* Tooltip text */
.custom-tooltip-container .custom-tooltip {
    visibility: hidden;
    width: max-content; /* Lấy vừa đủ độ rộng chữ */
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    text-align: center;
    border-radius: 4px; /* Giảm bo góc cho gọn */
    padding: 6px 12px; /* Thu hẹp padding trên dưới để sát chữ hơn */
    font-size: 1rem; /* Chữ to lên rõ hơn (chuẩn 16px) */
    font-weight: 600; /* In đậm chút cho dễ đọc */
    letter-spacing: 0.5px;
    text-transform: none; /* Tránh bị hover làm in hoa toàn bộ (nếu có reset css) */
    white-space: nowrap; /* Bắt chữ nằm trên 1 dòng duy nhất, không rớt dòng */
    line-height: 1; /* Cắt bớt khoảng trống thừa phía trên/dưới chữ */
    
    /* Position the tooltip: Since header is at top: 0, we must put tooltip below or left.
       Let's put it below and shifted left to avoid screen edges. */
    position: absolute;
    z-index: 10000;
    top: 100%; /* Dưới icon */
    right: 50%; /* Dịch sang trái */
    margin-right: -25px; /* Điều chỉnh tâm mũi tên hợp lý với chữ */
    margin-top: 12px; /* Cách icon 1 chút xíu nữa */
    
    /* Fade in element */
    opacity: 0;
    transition: opacity 0.3s;
}

/* Tooltip arrow */
.custom-tooltip-container .custom-tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%; /* Nằm trên đáy tooltip */
    right: 25px; /* Mũi tên chĩa lên icon */
    margin-left: -5px;
    border-width: 6px; /* Làm mũi tên to ra xíu cho cân */
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.85) transparent;
}

/* Show the tooltip text when you mouse over the tooltip container */
.custom-tooltip-container:hover .custom-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Light theme tooltip adjustment if necessary */
body.light-theme .custom-tooltip-container .custom-tooltip {
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
body.light-theme .custom-tooltip-container .custom-tooltip::after {
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.95);
}
