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

:root {
    --main-color: #5cb85c;
    --main-color-hover: #4cae4c;
    --bg-color: #f8f9fa;
    --text-color: #333;
}

body {
    background-color: var(--bg-color);
    font-family: 'Be Vietnam Pro', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
}

/* =========================================
   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;
}

.brand-logo::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    animation: shine-logo 3.5s infinite;
    pointer-events: none;
}

@keyframes shine-logo {
    0% {
        left: -100%;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    40% {
        left: 200%;
        opacity: 0;
    }

    100% {
        left: 200%;
        opacity: 0;
    }
}

@media (max-width: 480px) {
    .brand-logo .main-text {
        font-size: 1.6rem;
    }

    .brand-logo .logo-icon {
        font-size: 2rem;
    }
}

.main-header p {
    color: #666;
    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 rgba(0, 0, 0, 0.05);
    background: #fff;
    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;
}

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

.form-label {
    font-weight: 600;
    font-size: 14px;
    color: #555;
}

.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 10px 15px;
    font-size: 15px;
}

.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: 700;
    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;
}

/* Loại bỏ icon cũ */
.btn-loading .fa-calculator {
    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. CHMOD Calculator STYLES (NEW)
   ========================================= */
.result-section {
    margin-top: 30px;
}

.chmod-table th {
    background-color: #f1fcf5;
    color: var(--main-color);
    font-weight: 700;
    text-align: center;
    padding: 10px;
}

.chmod-table td {
    padding: 10px;
    vertical-align: middle;
}

.chmod-table tbody td:nth-child(1) {
    font-weight: 600;
    color: #444;
}

.chmod-table tbody td:nth-child(2),
.chmod-table tbody td:nth-child(3),
.chmod-table tbody td:nth-child(4) {
    text-align: center;
}

.permission-checkbox {
    transform: scale(1.2);
}

/* Kiểu cho kết quả */
.chmod-result-box {
    margin-top: 20px;
    padding: 15px;
    background: #e6ffec; /* Nền xanh lá nhạt */
    border: 1px solid var(--main-color);
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.chmod-octal {
    color: #d9534f; /* Màu đỏ nổi bật cho số */
    font-size: 1.5em;
    font-family: monospace;
}

.chmod-symbolic {
    color: #007bff; /* Màu xanh dương */
    font-size: 1.5em;
    font-family: monospace;
}

/* Style cho input chuyển đổi */
.input-converter {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    color: #4cae4c; /* Màu xanh lá cây đậm */
}

/* Style cho các giá trị ** trong gợi ý */
.alert-info strong {
    font-weight: 800; /* In đậm hơn */
    color: #2a6496; /* Tạo sự khác biệt */
}


/* =========================================
   5. SHARE BOX
   ========================================= */
/* Giữ nguyên */

/* =========================================
   6. FOOTER
   ========================================= */
.site-footer {
    margin-top: auto;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

.footer-stats {
    display: inline-flex;
    gap: 20px;
    margin-bottom: 10px;
    background: #f9f9f9;
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid #eee;
}

.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;
}

/* =========================================
   7. CUSTOM BANNER & COMMUNITY (FIXED)
   ========================================= */
/* Giữ nguyên các styles này */
.wpvirus-banner-pro {
    font-family: 'Be Vietnam Pro', sans-serif;
    width: 100%;
    max-width: 100%;
    background: linear-gradient(135deg, #0a0a20 0%, #13133a 100%);
    border-radius: 14px;
    padding: 15px 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    margin: 20px auto;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 136, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 10% 20%, rgba(0, 255, 136, 0.05) 0%, transparent 20%), radial-gradient(circle at 90% 80%, rgba(24, 119, 242, 0.05) 0%, transparent 20%);
    z-index: 1;
}

.banner-content-left {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 2;
    flex: 1;
}

.icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shield-icon {
    font-size: 40px;
    background: linear-gradient(180deg, #00ff88 0%, #00b8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.4));
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 136, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0);
    }
}

/* Các styles khác của banner (omitted for brevity) */

.join-community-card {
    font-family: 'Be Vietnam Pro', sans-serif;
    width: 100%;
    max-width: 100%;
    margin: 30px auto;
    background: #ffffff;
    border-radius: 16px;
    position: relative;
    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;
}

.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);
    }
}

.join-community-card h4 {
    font-size: 20px;
    margin: 0;
    color: #1e293b;
    font-weight: 800;
}

.card-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin: 0 auto 20px;
    max-width: 95%;
}

.community-buttons {
    /* FIX: Dùng block và căn giữa để tránh lỗi Flexbox/wrapping */
    display: block;
    text-align: center;
    gap: 10px;
    margin-top: 15px;
}

.comm-btn {
    /* Loại bỏ flex: 1 và dùng inline-flex */
    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;
    /* Thêm margin cho khoảng cách giữa các nút */
}

.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;
    /* Đảm bảo mũi tên có khoảng cách */
}

.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;
    }
}


/* =========================================
   8. FEEDBACK SECTION STYLES (TINY TEXT LINE)
   ========================================= */
.feedback-line {
    margin: 10px auto 10px;
    padding: 0 15px;
    text-align: center;
    font-size: 12px;
    color: #555;
    line-height: 1.8;
}

.feedback-text-inline {
    display: inline;
    font-weight: 500;
    color: #555;
    margin: 0 10px 0 0;
}

.feedback-text-inline i {
    color: var(--main-color);
    font-size: 1em;
}

.feedback-link {
    display: inline-flex;
    align-items: center;
    padding: 0 5px;
    margin: 0 5px;
    color: #444;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s;
}

.feedback-link:hover {
    color: var(--main-color);
}

.feedback-link i {
    margin-right: 3px;
    font-size: 0.85em;
}

/* =========================================
   9. FIX MOBILE TABLE OVERFLOW (Giữ nguyên cho tương lai)
   ========================================= */
@media (max-width: 767px) {

    /* Cho phép nội dung cột Domain xuống dòng trên mobile */
    .domain-cell {
        white-space: normal;
        /* Cho phép xuống dòng */
        max-width: 100% !important;
        /* Loại bỏ giới hạn cứng của desktop */
        display: block;
        /* Dùng block để nội dung chiếm hết chiều ngang có thể */
        word-break: break-word;
        /* Đảm bảo từ dài bị ngắt nếu cần */
    }

    /* Đảm bảo cột Answer cũng có thể xuống dòng khi cần */
    .table-custom tbody td.text-break {
        word-break: break-word;
    }
}