﻿/* =============================================
   HĐDT Expert v45 - Main Stylesheet
   =============================================
   1.  Reset & Base
   2.  Page Shell
   3.  Contact Floating Bar
   4.  Ad Slots (IAB Standard)
   5.  Sidebar Ads
   6.  Landing Layout
   7.  Intro Box
   8.  Form Elements
   9.  Main Form / Container
   10. Tabs
   11. Fieldset
   12. Buttons
   13. Status & Log
   14. Demo Banner
   15. Version Panel
   16. Turnstile
   17. Footer
   18. Utilities
   19. Responsive Tablet (641-1024px)
   20. Responsive Mobile (<=640px)
   21. Responsive Small Mobile (<=400px)
   ============================================= */

/* 1. RESET & BASE */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
    font-family: Tahoma, Arial, sans-serif;
    background-color: #f4f6f8;
    margin: 0; padding: 0;
    font-size: 13px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #333;
}

/* 2. PAGE SHELL */
.page-shell {
    flex: 1;
    max-width: 980px;
    width: 100%;
    margin: 0 auto;
    padding: 8px 10px 0;
}

/* 3. CONTACT FLOATING BAR
   FIX: label uses max-width transition (not opacity-only)
   opacity:0 still occupies layout space -> icon shifts left */
.contact-bar {
    position: fixed;
    left: 0; top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 9990;
}
.contact-bar a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 12px;
    width: 46px; height: 46px;
    border-radius: 0 24px 24px 0;
    text-decoration: none;
    color: #fff;
    box-shadow: 2px 3px 8px rgba(0,0,0,.28);
    transition: width .25s cubic-bezier(.4,0,.2,1), border-radius .25s, box-shadow .2s;
    overflow: hidden;
    white-space: nowrap;
}
.contact-bar a:hover {
    width: 160px;
    border-radius: 0 26px 26px 0;
    box-shadow: 3px 4px 14px rgba(0,0,0,.35);
}
.contact-bar a > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    font-size: 19px;
    line-height: 1;
    color: #fff;
}
.contact-bar a .label {
    font-size: 11.5px;
    font-family: Tahoma, Arial, sans-serif;
    font-weight: bold;
    letter-spacing: .3px;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    margin-left: 0;
    transition: max-width .25s cubic-bezier(.4,0,.2,1), margin-left .2s, opacity .18s;
}
.contact-bar a:hover .label { max-width: 110px; margin-left: 8px; opacity: 1; }
.cb-phone    { background: linear-gradient(135deg, #c62828, #8b0000); }
.cb-zalo     { background: linear-gradient(135deg, #1976d2, #0d47a1); }
.cb-viber    { background: linear-gradient(135deg, #8e63e8, #5c35c4); }
.cb-whatsapp { background: linear-gradient(135deg, #43a047, #1b5e20); }
.cb-email    { background: linear-gradient(135deg, #e53935, #b71c1c); }

/* 4. AD SLOTS (IAB Standard sizes) */
.ad-slot {
    background: #f9faff;
    border: 1.5px dashed #d0d7f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 11px;
    overflow: hidden;
    position: relative;
}
.ad-slot.billboard  { width:100%; min-height:120px; max-height:260px; }
.ad-slot.leaderboard { width:100%; min-height:72px; max-height:100px; }
.ad-slot.half-page  { width:300px; min-height:600px; }
.ad-slot.skyscraper { width:160px; min-height:420px; }
.ad-slot.medium-rect { width:100%; min-height:120px; }
.ad-slot.banner     { width:100%; min-height:56px; max-height:70px; }
.ad-slot.mobile-banner { width:100%; min-height:50px; display:none; }
.ad-slot.mt8  { margin-top:8px; }
.ad-slot.mb8  { margin-bottom:8px; }
.ad-slot.my10 { margin-top:10px; margin-bottom:10px; }

/* 5. SIDEBAR ADS */
.ad-sidebar {
    position: fixed;
    top: 50%; transform: translateY(-50%);
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
}
.ad-sidebar.ad-left  { left: 4px; }
.ad-sidebar.ad-right { right: 4px; }
@media (min-width:1440px) {
    .ad-sidebar { width:310px; }
    .ad-sidebar .ad-slot.skyscraper { display:none; }
    .ad-sidebar .ad-slot.half-page  { display:flex; }
}
@media (max-width:1440px) and (min-width:1200px) {
    .ad-sidebar { width:170px; }
    .ad-sidebar .ad-slot.half-page   { display:none; }
    .ad-sidebar .ad-slot.skyscraper  { display:flex; }
}
@media (max-width:1200px) { .ad-sidebar { display:none !important; } }

/* 6. LANDING LAYOUT */
.landing-wrapper {
    width: 100%;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.intro-box, .login-box {
    flex: 1; min-width: 300px;
    background: #fff;
    padding: 22px 20px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.login-box { display:flex; flex-direction:column; }

/* 7. INTRO BOX */
.intro-title {
    font-size: 17px; color: #1e1e1e; font-weight: bold;
    margin: 0 0 14px; text-transform: uppercase; line-height: 1.4;
}
.intro-list { list-style:none; padding:0; margin:0; }
.intro-list li { margin-bottom:10px; line-height:1.55; color:#444; }
.intro-list li strong { color:#b30000; }
.intro-icon { display:inline-block; width:22px; text-align:center; margin-right:4px; }

.trust-block {
    margin-top: 14px;
    padding: 12px;
    border-radius: 8px;
    background: #fff8f8;
    border: 1px solid #f0c2c2;
}
.trust-title {
    font-size: 13px;
    font-weight: 700;
    color: #8a0000;
    margin-bottom: 8px;
}
.trust-block ul {
    margin: 0;
    padding-left: 18px;
}
.trust-block li {
    margin-bottom: 5px;
    color: #4a4a4a;
    font-size: 12.5px;
}

/* 8. FORM ELEMENTS */
.form-group {
    display: flex; align-items: center;
    gap: 10px; flex: 1; margin-bottom: 11px;
}
.form-group label {
    width: 88px; text-align: right;
    color: #444; font-weight: bold; font-size: 12px; flex-shrink: 0;
}
input, select {
    flex: 1; padding: 7px 9px;
    border: 1px solid #ccc; border-radius: 4px;
    font-family: Tahoma, Arial, sans-serif; font-size: 13px;
    width: 100%; min-width: 0;
}
input:focus, select:focus {
    outline: none; border-color: #b30000;
    box-shadow: 0 0 0 2px rgba(179,0,0,.1);
}

/* 9. MAIN FORM / CONTAINER */
.container {
    max-width: 660px; margin: 0 auto;
    background: #fff; padding: 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.header {
    color: #b30000; font-size: 15px; font-weight: bold;
    padding-bottom: 10px; border-bottom: 2px solid #b30000;
    margin-bottom: 14px;
    display: flex; justify-content: space-between; align-items: center;
    text-transform: uppercase; text-align: center;
}

/* 10. TABS */
.tabs {
    display: flex; border-bottom: 2px solid #b30000;
    margin-bottom: 14px; gap: 2px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab-btn {
    flex: 1; min-width: 80px; padding: 9px 6px;
    cursor: pointer; background: #e9ecef;
    border: 1px solid #ccc; border-bottom: none;
    border-radius: 5px 5px 0 0;
    font-weight: bold; color: #555;
    font-family: Tahoma, Arial, sans-serif; font-size: 12px;
    text-align: center; transition: background .15s; white-space: nowrap;
}
.tab-btn:hover { background:#d9dde1; }
.tab-btn.active { background:#b30000; color:#fff; border-color:#b30000; }

/* 11. FIELDSET */
.fieldset {
    border: 1px solid #d1d5db; padding: 14px 10px 10px;
    position: relative; background: #fafafa;
    border-radius: 6px; margin-bottom: 14px;
}
.fieldset-legend {
    position: absolute; top: -9px; left: 10px;
    background: #fafafa; padding: 0 5px;
    color: #333; font-weight: bold; font-size: 12px;
}
.date-group {
    display: flex; gap: 12px; align-items: center;
    justify-content: space-between; flex-wrap: wrap;
}

/* 12. BUTTONS */
button.btn-primary {
    padding: 10px 14px; background: #b30000;
    border: none; border-radius: 4px;
    cursor: pointer; color: #fff;
    font-family: Tahoma, Arial, sans-serif; font-weight: bold; font-size: 13px;
    width: 100%; transition: background .2s, transform .1s;
    touch-action: manipulation;
}
button.btn-primary:hover  { background: #8a0000; }
button.btn-primary:active { transform: scale(.98); }
button.btn-demo { background:#28a745; margin-top:10px; border:1px solid #1e7e34; }
button.btn-demo:hover { background:#218838; }
button:disabled { background:#ccc !important; cursor:not-allowed; color:#666 !important; border-color:#ccc !important; }

.btn-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    display: inline-block;
    vertical-align: -2px;
    margin-right: 8px;
    animation: spin .9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 13. STATUS & LOG */
.status-bar {
    background: #d4edda; text-align: center; padding: 10px;
    font-weight: bold; color: #155724; margin-bottom: 10px;
    border: 1px solid #c3e6cb; border-radius: 4px;
    line-height: 1.5; word-break: break-word;
}
.log-box {
    width: 100%; height: 320px;
    background: #1e1e1e; color: #0f0;
    border: 1px solid #000; margin-top: 10px;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    font-family: Consolas, 'Courier New', monospace;
    padding: 10px; font-size: 12px; border-radius: 4px; word-break: break-all;
}
.log-error { color:#ff4c4c; font-weight:bold; }
.download-link {
    color: #b30000; font-weight: 800; text-decoration: underline;
    cursor: pointer; margin-top: 5px; display: inline-block;
    font-size: 13px; background: #fff; padding: 4px 10px;
    border-radius: 4px; border: 1px dashed #b30000;
}
.download-link:hover { background:#b30000; color:#fff; }

/* 14. DEMO BANNER */
.demo-banner {
    background:#fff3cd; color:#856404; padding:9px;
    text-align:center; font-weight:bold; margin-bottom:14px;
    border:1px solid #ffeeba; border-radius:4px;
}

/* 15. VERSION PANEL */
.version-panel {
    position: fixed; bottom:10px; right:10px;
    background: rgba(0,0,0,.72); color:#fff;
    padding: 5px 9px; border-radius:4px;
    font-size:10px; pointer-events:none; z-index:9999;
}

/* 16. TURNSTILE */
.turnstile-wrap {
    display: flex; justify-content: center;
    margin: 10px 0; min-height: 65px;
}

.blog-entry-cta {
    width: 100%;
    padding: 10px;
}

.blog-entry-cta-inner {
    max-width: 980px;
    margin: 0 auto;
    background: linear-gradient(135deg, #fff3f3, #ffe0e0);
    border: 1px solid #f0b9b9;
    border-radius: 10px;
    padding: 18px 16px;
    text-align: center;
}

.blog-entry-cta-inner h3 {
    margin: 0 0 6px;
    color: #7a0000;
    font-size: 18px;
}

.blog-entry-cta-inner p {
    margin: 0 0 14px;
    color: #5a5a5a;
    font-size: 13px;
}

.btn-blog-entry {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 8px;
    background: #b30000;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid #8f0000;
}

.btn-blog-entry:hover {
    background: #8f0000;
}

/* 17. FOOTER */
.site-footer {
    text-align: center; padding: 8px 12px;
    font-size: 12px; color: #888;
    margin-top: auto; border-top: 1px solid #dde1e7;
    flex-shrink: 0; line-height: 1.8;
}
.site-footer a { color:#b30000; text-decoration:none; }
.site-footer a:hover { text-decoration:underline; }

.toast-host {
    position: fixed;
    top: 14px;
    right: 14px;
    max-width: 360px;
    z-index: 9999;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
    font-size: 13px;
    line-height: 1.45;
    animation: toastIn .18s ease-out;
}

.toast-info { background:#e8f4fd; color:#094067; border-color:#b9def5; }
.toast-success { background:#e6f8ea; color:#155724; border-color:#c6e9d0; }
.toast-warn { background:#fff7e6; color:#7a4d00; border-color:#f2dfb2; }
.toast-error { background:#fdecec; color:#7f1d1d; border-color:#f5c2c7; }

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

/* 18. UTILITIES */
.hidden { display:none !important; }

/* 19. RESPONSIVE: TABLET (641-1024px) */
@media (max-width:1024px) {
    .contact-bar a { width:42px; height:42px; padding-left:10px; }
    .contact-bar a > i { font-size:17px; }
    .ad-slot.billboard { min-height:90px; max-height:110px; }
}

/* 20. RESPONSIVE: MOBILE (<=640px)
   Contact bar moves to fixed bottom horizontal nav */
@media (max-width:640px) {
    .page-shell { padding:6px 8px 0; }

    /* Stack layout */
    .landing-wrapper { flex-direction:column; gap:10px; }
    .intro-box, .login-box { min-width:unset; padding:20px 16px; }
    .intro-list { display:none; }
    .intro-title { font-size:17px; margin-bottom:10px; }

    .blog-entry-cta {
        padding: 8px;
    }

    .blog-entry-cta-inner {
        padding: 14px 12px;
    }

    .blog-entry-cta-inner h3 {
        font-size: 16px;
    }

    .btn-blog-entry {
        width: 100%;
        text-align: center;
    }

    .trust-block {
        margin-top: 10px;
        padding: 10px;
    }
    .trust-title { font-size: 13px; }
    .trust-block li { font-size: 12px; }

    /* Contact bar: bottom fixed horizontal nav */
    .contact-bar {
        top:unset; bottom:0; left:0; right:0; transform:none;
        flex-direction:row; justify-content:center; gap:0;
        background:rgba(25,25,35,.97);
        padding:6px 0 env(safe-area-inset-bottom,6px);
        box-shadow:0 -2px 10px rgba(0,0,0,.35);
        border-top:1px solid rgba(255,255,255,.08);
    }
    .contact-bar a {
        flex-direction:column; justify-content:center; align-items:center;
        width:20%; height:54px; border-radius:0;
        box-shadow:none; padding-left:0; overflow:visible; gap:2px;
    }
    .contact-bar a:hover { width:20%; border-radius:0; box-shadow:none; }
    .contact-bar a > i { font-size:20px; width:auto; height:auto; }
    .contact-bar a .label {
        max-width:100%; opacity:1; margin-left:0;
        font-size:9px; font-weight:normal; letter-spacing:0; display:block;
    }
    .cb-phone, .cb-zalo, .cb-viber, .cb-whatsapp, .cb-email { background:transparent; }

    body { padding-bottom:66px; }

    /* Ads */
    .ad-slot.billboard, .ad-slot.leaderboard { min-height:60px; max-height:110px; }
    .ad-slot.medium-rect { min-height:80px; }
    .ad-slot.mobile-banner { display:flex; }

    /* Form */
    .container { max-width:100%; }
    .form-group { margin-bottom: 13px; }
    .form-group label { width:88px; font-size:13px; }
    input, select {
        font-size: 15px;
        padding: 10px 11px;
    }
    button.btn-primary {
        font-size: 14px;
        padding: 12px 12px;
    }
    .date-group { flex-direction:column; align-items:stretch; }
    .date-group .form-group { flex:unset; }

    /* Tabs */
    .tabs { flex-wrap:nowrap; }
    .tab-btn { font-size:11px; padding:8px 4px; min-width:70px; }

    /* Log */
    .log-box { height:220px; font-size:11px; }

    /* Version badge */
    .version-panel { bottom:70px; right:6px; font-size:9px; }

    .toast-host {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: none;
        font-size: 13px;
    }
}

/* 21. RESPONSIVE: SMALL MOBILE (<=400px) */
@media (max-width:400px) {
    .intro-box, .login-box { padding:14px 12px; }
    .form-group label { width:76px; font-size:12px; }
    input, select { font-size:14px; padding:9px 10px; }
    button.btn-primary { font-size:13px; padding:11px 10px; }
    .contact-bar a { height:50px; }
    .contact-bar a > i { font-size:18px; width:auto; height:auto; }
    .contact-bar a .label { font-size:8px; }
}