/* =========================================
   1. CORE STYLES & FONTS
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --main-color: #5cb85c;
    --main-color-hover: #4cae4c;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --input-bg: #ffffff;
    --table-header-text: #ffffff;
    --table-row-hover: #f7fff7;
    --table-border-bottom: #f0f0f0;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --badge-text-dark: #212529;
    --share-box-bg: #f1fcf5;
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; }
input, button, select, textarea { font-family: 'Inter', sans-serif; }

/* =========================================
   2. HEADER & LOGO
   ========================================= */
.main-header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 40px;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    position: relative;
    padding: 10px 20px;
    margin-bottom: 15px;
    overflow: hidden;
}

.brand-logo .logo-icon {
    font-size: 2.5rem;
    color: var(--main-color);
    text-shadow: 0 4px 10px rgba(92, 184, 92, 0.3);
    display: flex;
    align-items: center;
}

.brand-logo .logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}

.brand-logo .main-text {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #2c3e50 30%, #5cb85c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.brand-logo .sub-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 3px;
    margin-left: 2px;
}

.main-header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    font-size: 15px;
}

/* =========================================
   3. TOOL CARD & FORM
   ========================================= */
.tool-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-color);
    background: var(--card-bg);
    overflow: hidden;
    margin-bottom: 30px;
}

.tool-card-header {
    background-color: var(--main-color);
    color: white;
    padding: 15px;
    font-weight: 700;
    text-align: center;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-card-body { padding: 30px; }

.form-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-color);
    padding: 10px 15px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 0.2rem rgba(92, 184, 92, 0.25);
}

.btn-resolve {
    background-color: var(--main-color);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 10px;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-resolve:hover {
    background-color: var(--main-color-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(92, 184, 92, 0.3);
}

.btn-loading { pointer-events: none; opacity: 0.8; }
.btn-loading .fa-search { display: none; }
.btn-loading::after {
    content: ""; display: inline-block; width: 1rem; height: 1rem;
    vertical-align: text-bottom; border: .15em solid currentColor;
    border-right-color: transparent; border-radius: 50%;
    animation: spinner-border .75s linear infinite; margin-left: 5px;
}
@keyframes spinner-border { to { transform: rotate(360deg); } }

/* =========================================
   4. SMART TABLE STYLES & SCROLLBAR
   ========================================= */
.result-section { margin-top: 30px; }

.dns-table-wrapper {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px var(--shadow-color);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

/* SCROLLBAR & STICKY HEADER CHO BLACKLIST */
.table-scroll-container {
    max-height: 500px; /* Chiều cao tối đa */
    overflow-y: auto;  /* Thanh cuộn dọc */
    scrollbar-width: thin;
    scrollbar-color: var(--main-color) #f1f1f1;
}
.table-scroll-container::-webkit-scrollbar { width: 6px; }
.table-scroll-container::-webkit-scrollbar-track { background: #f1f1f1; }
.table-scroll-container::-webkit-scrollbar-thumb { background: var(--main-color); border-radius: 10px; }

.table-scroll-container thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.table-new-style {
    margin-bottom: 0;
    border-collapse: collapse;
    width: 100%;
    table-layout: auto;
    color: var(--text-color);
}

.table-new-style thead th {
    background-color: var(--main-color);
    color: var(--table-header-text);
    font-weight: 600;
    padding: 12px 15px;
    border: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}

.table-new-style tbody tr {
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--table-border-bottom);
}
.table-new-style tbody tr:last-child { border-bottom: none; }
.table-new-style tbody tr:hover {
    background-color: var(--table-row-hover);
    position: relative; z-index: 2;
}

/* Hiệu ứng khi nhảy lên đầu */
.row-highlight {
    animation: flash-red 1.5s ease-in-out;
    background-color: #fff5f5;
}
@keyframes flash-red {
    0% { background-color: rgba(220, 53, 69, 0.3); }
    100% { background-color: #fff5f5; }
}

.table-new-style tbody td {
    vertical-align: middle;
    padding: 10px 15px;
    font-size: 0.95rem;
    border: none;
    color: var(--text-color);
}

.col-fit { width: 1%; white-space: nowrap; }

.domain-cell-new {
    font-weight: 500; color: var(--text-color);
    white-space: nowrap; max-width: 200px;
    overflow: hidden; text-overflow: ellipsis;
}

.answer-cell-new {
    white-space: normal; word-break: break-all;
    min-width: 200px; font-size: 0.95rem;
    color: var(--badge-text-dark);
}

.isp-cell-new { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.badge-isp {
    background: rgba(92, 184, 92, 0.1); color: var(--main-color);
    padding: 4px 8px; border-radius: 4px; display: inline-block;
    white-space: nowrap; text-decoration: none; transition: all 0.2s ease;
}
a.badge-isp:hover {
    background-color: var(--main-color); color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(92, 184, 92, 0.3);
}

.badge-type-new {
    font-size: 0.75em; padding: 5px 8px; border-radius: 6px;
    background-color: #007bff !important; color: white;
    font-weight: 600; display: inline-block;
}
.ttl-cell-new { font-weight: 400; color: var(--text-muted); }
.answer-data-text { font-weight: 400; color: var(--text-color) !important; }
.answer-cell-new .flag-icon { width: 24px; margin-right: 8px; vertical-align: middle; position: relative; top: -1px; }

.badge-status-sm {
    font-size: 10px !important; padding: 2px 6px !important;
    font-weight: 700 !important; border-radius: 3px !important;
    line-height: 1.2 !important; text-transform: uppercase;
    display: inline-block; vertical-align: middle; letter-spacing: 0.3px;
}

/* BADGE MỨC ĐỘ (HIGH/MEDIUM/LOW) */
.badge-lvl-high { background-color: #dc3545; color: white; font-size: 11px; padding: 4px 8px; border-radius: 4px; font-weight: 700; }
.badge-lvl-medium { background-color: #fd7e14; color: white; font-size: 11px; padding: 4px 8px; border-radius: 4px; font-weight: 700; }
.badge-lvl-low { background-color: #6c757d; color: white; font-size: 11px; padding: 4px 8px; border-radius: 4px; font-weight: 700; }

/* LOADING SPINNER */
.rbl-loading {
    display: inline-block; width: 12px; height: 12px;
    border: 2px solid rgba(0,0,0,0.2); border-radius: 50%;
    border-top-color: var(--main-color);
    animation: rbl-spin 1s ease-in-out infinite; margin-right: 5px; vertical-align: middle;
}
@keyframes rbl-spin { to { transform: rotate(360deg); } }

/* =========================================
   5. FOOTER & COMMUNITY
   ========================================= */
.share-box-container {
    margin-top: 25px; background: var(--share-box-bg);
    border: 1px dashed var(--main-color); border-radius: 8px; padding: 15px;
}
.input-group-share .form-control { border-color: var(--main-color); color: var(--main-color); font-weight: 500; }
.btn-copy { background-color: var(--main-color); color: white; border: 1px solid var(--main-color); font-weight: 600; transition: all 0.3s; }
.btn-copy:hover { background-color: var(--main-color-hover); color: white; }

.site-footer {
    margin-top: auto; background: var(--card-bg);
    border-top: 1px solid var(--border-color); padding: 20px 0; text-align: center;
    font-size: 0.9em; color: var(--text-muted);
}
.footer-stats {
    display: inline-flex; gap: 20px; margin-bottom: 10px;
    background: var(--bg-color); padding: 8px 20px;
    border-radius: 50px; border: 1px solid var(--border-color);
}
.stat-item i { color: var(--main-color); margin-right: 5px; }
.footer-link { color: var(--main-color); font-weight: 600; text-decoration: none; }
.footer-link:hover { text-decoration: underline; }
.footer-desc {
    font-size: 11px; color: var(--text-muted); max-width: 800px;
    margin: 15px auto; line-height: 1.6; opacity: 0.8;
}
.copyright-text { font-size: 12px; font-weight: 500; }

.join-community-card {
    width: 100%; max-width: 100%; margin: 30px auto;
    background: var(--card-bg); border-radius: 16px;
    border: 2px solid #5cb85c; box-shadow: 0 8px 30px -10px rgba(92, 184, 92, 0.15);
    overflow: hidden; transition: transform 0.3s ease;
}
.join-community-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px -10px rgba(92, 184, 92, 0.25); }
.card-content { padding: 20px; position: relative; z-index: 2; text-align: center; }
.card-header-community { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }
.join-community-card h4 { font-size: 20px; margin: 0; color: #333; font-weight: 800; }
.card-desc { font-size: 14px; color: var(--text-muted); line-height: 1.5; margin: 0 auto 20px; max-width: 95%; }
.icon-pulse {
    width: 36px; height: 36px; background: #e0f2fe; color: #0284c7;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 16px; animation: pulse-blue 2s infinite;
}
@keyframes pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(2, 132, 199, 0); }
    100% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); }
}
.community-buttons { display: block; text-align: center; gap: 10px; margin-top: 15px; }
.comm-btn {
    min-width: 160px; display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 15px; border-radius: 10px; text-decoration: none; color: white;
    font-weight: 600; font-size: 13px; transition: all 0.3s; position: relative;
    overflow: hidden; box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.1); margin: 5px;
}
.comm-btn .btn-icon {
    background: white; width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; padding: 2px;
}
.comm-btn .btn-icon img { width: 100%; height: 100%; object-fit: contain; }
.comm-btn span { flex: 1; text-align: center; padding: 0 4px; }
.arrow-action { font-size: 11px; opacity: 0.6; transition: transform 0.3s; margin-left: 8px; }
.comm-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 12px -3px rgba(0, 0, 0, 0.15); }
.comm-btn:hover .arrow-action { transform: translateX(3px); opacity: 1; }
.comm-btn.fb { background: linear-gradient(135deg, #1877f2, #3b82f6); }
.comm-btn.zalo { background: linear-gradient(135deg, #0068ff, #009efd); }
.comm-btn.telegram { background: linear-gradient(135deg, #2aabee, #229ed9); }

@media (max-width: 600px) {
    .community-buttons { display: block; padding: 0 10px; }
    .comm-btn { width: 100%; box-sizing: border-box; justify-content: flex-start; margin-bottom: 10px; margin-left: 0; margin-right: 0; }
    .comm-btn span { text-align: left; padding-left: 10px; }
}

@media (max-width: 767px) {
    .dns-table-wrapper { overflow-x: auto; }
    .table-new-style { min-width: 800px; table-layout: auto; }
}
