/**
 * Contact page — tracnghiem theme
 */

/* Floating contact widget (module default) */
#contactButton {
    position: fixed;
    bottom: 0;
    right: 15px;
    max-height: 100%;
    width: 350px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
}

#contactButton .panel {
    margin-bottom: 0;
    width: 100%;
    color: #333;
    display: none;
}

#contactButton .ctb {
    position: fixed;
    bottom: 0;
    right: 15px;
    z-index: 1000;
    text-align: center;
}

#contactButton .ctb,
#contactButton .panel {
    border-radius: 5px 5px 0 0;
}

#contactButton .ctb em {
    margin-right: 3px;
    font-size: 1.6em;
    vertical-align: middle;
}

@media (max-width: 1199px) {
    #contactButton .ctb {
        right: 70px;
    }
}

@media (max-width: 499px) {
    #contactButton {
        right: auto;
        left: 0;
        width: 90%;
    }
}

/* ===== Contact page ===== */
.contact-page {
    --ct-blue: #024799;
    --ct-blue-soft: #e8f1fb;
    --ct-text: #2e4a5c;
    --ct-muted: #6d8599;
    --ct-line: #d0dae6;
    --ct-bg: #f4f7fa;
    --ct-card: #ffffff;
    margin-bottom: 24px;
}

.contact-intro {
    background:
        linear-gradient(135deg, rgba(2, 71, 153, 0.08) 0%, rgba(244, 247, 250, 0.95) 55%),
        var(--ct-bg);
    border: 1px solid var(--ct-line);
    border-radius: 10px;
    padding: 22px 24px;
    margin-bottom: 22px;
}

.contact-intro-inner {
    color: var(--ct-text);
    font-size: 14px;
    line-height: 1.7;
    max-width: 760px;
}

.contact-intro-inner p {
    margin: 0 0 8px;
}

.contact-intro-inner p:last-child {
    margin-bottom: 0;
}

.contact-layout {
    margin-left: -10px;
    margin-right: -10px;
}

.contact-layout > [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
}

.contact-info-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-card,
.contact-form-card {
    background: var(--ct-card);
    border: 1px solid var(--ct-line);
    border-radius: 10px;
    overflow: hidden;
}

.contact-card-head,
.contact-form-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ct-line);
    background: linear-gradient(180deg, #fafcfe 0%, #f0f5fa 100%);
}

.contact-card-title,
.contact-form-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f1e2d;
    line-height: 1.35;
}

.contact-card-body,
.contact-form-body {
    padding: 18px 20px 20px;
}

.contact-card-image {
    margin-bottom: 14px;
}

.contact-card-image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.contact-card-note {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--ct-blue-soft);
    border-radius: 8px;
    color: var(--ct-text);
    font-size: 13px;
    line-height: 1.55;
}

.contact-meta {
    list-style: none;
    margin: 0;
    padding: 0;
}

.contact-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e8eef4;
}

.contact-meta-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.contact-meta-item:first-child {
    padding-top: 0;
}

.contact-meta-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ct-blue-soft);
    color: var(--ct-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    margin-top: 2px;
}

.contact-meta-content {
    flex: 1;
    min-width: 0;
}

.contact-meta-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--ct-muted);
    margin-bottom: 2px;
}

.contact-meta-value {
    display: block;
    font-size: 14px;
    color: var(--ct-text);
    line-height: 1.5;
    word-break: break-word;
}

.contact-meta-value a {
    color: var(--ct-blue);
    text-decoration: none;
}

.contact-meta-value a:hover {
    text-decoration: underline;
}

/* Form */
.contact-form-wrap .form-group {
    margin-bottom: 14px;
}

.contact-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ct-text);
}

.contact-form-wrap .input-group-addon {
    background: #f4f7fa;
    border-color: var(--ct-line);
    color: var(--ct-muted);
    min-width: 40px;
}

.contact-form-wrap .form-control {
    border-color: var(--ct-line);
    box-shadow: none;
    height: 40px;
    color: var(--ct-text);
}

.contact-form-wrap textarea.form-control {
    height: auto;
    min-height: 120px;
    padding-top: 10px;
    resize: vertical;
}

.contact-form-wrap .form-control:focus {
    border-color: #7aa6d4;
    box-shadow: 0 0 0 3px rgba(2, 71, 153, 0.12);
}

.contact-form-wrap .has-error .form-control,
.contact-form-wrap .has-error .input-group-addon {
    border-color: #d9534f;
}

.contact-sendcopy label {
    font-weight: normal;
    color: var(--ct-muted);
    font-size: 13px;
    cursor: pointer;
}

.contact-sendcopy input {
    margin-right: 6px;
    vertical-align: -1px;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 6px;
    margin-bottom: 0 !important;
}

.btn-contact-reset,
.btn-contact-send {
    min-width: 110px;
    height: 40px;
    border-radius: 6px;
    font-weight: 600;
}

.btn-contact-send {
    background: var(--ct-blue);
    border-color: var(--ct-blue);
}

.btn-contact-send:hover,
.btn-contact-send:focus {
    background: #013a7a;
    border-color: #013a7a;
}

.contact-form-wrap .contact-result {
    margin-top: 12px;
    margin-bottom: 0;
    display: none;
}

.contact-captcha .captchaImg {
    border-radius: 4px;
    vertical-align: middle;
}

@media (max-width: 767px) {
    .contact-intro {
        padding: 16px;
    }

    .contact-card-head,
    .contact-form-head,
    .contact-card-body,
    .contact-form-body {
        padding-left: 14px;
        padding-right: 14px;
    }

    .contact-actions {
        flex-direction: column-reverse;
    }

    .btn-contact-reset,
    .btn-contact-send {
        width: 100%;
    }
}

/* ===== Ticket ===== */
.ticket-nav {
    display: flex;
    gap: 22px;
    border-bottom: 1px solid var(--ct-line);
    margin-bottom: 22px;
}

.ticket-nav-item {
    position: relative;
    display: inline-block;
    padding: 8px 2px 12px;
    color: var(--ct-muted);
    font-weight: 600;
    text-decoration: none;
}

.ticket-nav-item:hover,
.ticket-nav-item.active {
    color: var(--ct-blue);
    text-decoration: none;
}

.ticket-nav-item.active:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--ct-blue);
}

.ticket-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.ticket-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #0f1e2d;
}

.ticket-count {
    color: var(--ct-muted);
    font-weight: 500;
    font-size: 18px;
}

.ticket-desc {
    margin: 0;
    color: var(--ct-muted);
    font-size: 13px;
}

.ticket-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ticket-btn-create {
    background: var(--ct-blue);
    border-color: var(--ct-blue);
    font-weight: 600;
    height: 38px;
    border-radius: 6px;
}

.ticket-search {
    position: relative;
}

.ticket-search em {
    position: absolute;
    left: 10px;
    top: 11px;
    color: #9aa8b5;
}

.ticket-search input {
    height: 38px;
    border: 1px solid var(--ct-line);
    border-radius: 6px;
    padding: 0 12px 0 30px;
    min-width: 200px;
    color: var(--ct-text);
}

.ticket-table-wrap {
    background: #fff;
    border: 1px solid var(--ct-line);
    border-radius: 10px;
    overflow: hidden;
}

.ticket-table {
    width: 100%;
    margin: 0;
}

.ticket-table th {
    background: #f6f9fc;
    color: var(--ct-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ct-line);
}

.ticket-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #eef3f8;
    vertical-align: middle;
}

.ticket-table tbody tr {
    cursor: pointer;
}

.ticket-table tbody tr:hover {
    background: #f8fbfe;
}

.ticket-row-title {
    font-weight: 700;
    color: #1a2b3c;
    text-decoration: none;
}

.ticket-row-code {
    color: #8a9bab;
    font-size: 12px;
    margin-top: 3px;
}

.ticket-row-time {
    color: var(--ct-muted);
    white-space: nowrap;
}

.ticket-empty {
    text-align: center;
    color: var(--ct-muted);
    padding: 28px 16px !important;
    cursor: default;
}

.ticket-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.ticket-badge.open {
    background: #fff4e5;
    color: #c47b16;
}

.ticket-badge.closed {
    background: #eef1f4;
    color: #6b7785;
}

.ticket-badge.replied,
.ticket-badge.done {
    background: #e5f7ee;
    color: #1d8a4d;
}

.ticket-badge.waiting,
.ticket-badge.new {
    background: #e8f1fb;
    color: var(--ct-blue);
}

.ticket-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--ct-blue);
    font-weight: 600;
    text-decoration: none;
}

.ticket-thread-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--ct-muted);
    font-size: 13px;
}

.ticket-head-badges {
    display: flex;
    gap: 8px;
}

.ticket-thread {
    background: #fff;
    border: 1px solid var(--ct-line);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 16px;
}

.ticket-msg-origin {
    line-height: 1.7;
    color: var(--ct-text);
}

.ticket-replies-bar {
    margin: 18px -20px;
    padding: 8px 20px;
    background: #f4f7fa;
    color: var(--ct-muted);
    font-weight: 600;
    font-size: 13px;
}

.ticket-msg {
    margin-bottom: 16px;
}

.ticket-msg.admin {
    background: #f7fbff;
    border: 1px solid #e3eef8;
    border-radius: 8px;
    padding: 12px 14px;
}

.ticket-msg-head {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.ticket-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e34d4d;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.ticket-msg.user .ticket-avatar {
    background: var(--ct-blue);
}

.ticket-role {
    color: var(--ct-muted);
    font-size: 12px;
    margin-left: 6px;
}

.ticket-msg-ago,
.ticket-msg-time {
    color: #8a9bab;
    font-size: 12px;
}

.ticket-msg-time {
    text-align: right;
    margin-top: 8px;
}

.ticket-msg-body {
    line-height: 1.7;
    color: var(--ct-text);
}

.ticket-reply-box,
.ticket-modal-dialog {
    background: #fff;
    border: 1px solid var(--ct-line);
    border-radius: 10px;
}

.ticket-reply-box {
    padding: 12px;
}

.ticket-autoclose-note {
    margin: 0 0 16px;
}

.ticket-editor-bar {
    display: flex;
    gap: 4px;
    border: 1px solid var(--ct-line);
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
    padding: 6px 8px;
    background: #f7fafc;
}

.ticket-editor-bar button {
    border: 0;
    background: transparent;
    width: 28px;
    height: 28px;
    color: #4d6273;
}

.ticket-textarea {
    border-radius: 0 0 6px 6px !important;
    min-height: 140px;
    height: auto !important;
}

.ticket-reply-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.ticket-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15, 30, 45, 0.45);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
}

.ticket-modal.is-open {
    display: flex;
}

.ticket-modal-dialog {
    width: 100%;
    max-width: 920px;
    padding: 22px 24px 16px;
    margin-bottom: 40px;
}

.ticket-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ticket-modal-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.ticket-modal-x {
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #7a8b99;
}

.ticket-step-label {
    margin: 12px 0 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ct-muted);
}

.ticket-cat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ticket-cat-item .ticket-cat-card {
    width: 100%;
    height: 100%;
}

.ticket-cat-payload {
    display: none !important;
}

.ticket-cat-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 6px;
    border: 1px solid var(--ct-line);
    border-radius: 10px;
    background: #fff;
    padding: 14px;
    min-height: 118px;
}

.ticket-cat-card:hover {
    border-color: #8fb4de;
    box-shadow: 0 4px 12px rgba(2, 71, 153, 0.08);
}

.ticket-cat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--ct-blue-soft);
    color: var(--ct-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ticket-cat-title {
    font-weight: 700;
    color: #17324a;
}

.ticket-cat-desc {
    font-size: 12px;
    color: var(--ct-muted);
    line-height: 1.45;
}

.ticket-cat-current {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef5fc;
    color: var(--ct-blue);
    border-radius: 999px;
    padding: 6px 12px;
    margin: 8px 0 16px;
    font-weight: 600;
}

.ticket-help-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.ticket-help-card {
    display: block;
    border: 1px solid var(--ct-line);
    border-radius: 10px;
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
}

.ticket-help-card:hover {
    border-color: #8fb4de;
    text-decoration: none;
}

.ticket-help-card strong {
    display: block;
    margin-bottom: 4px;
    color: #17324a;
}

.ticket-help-card span {
    color: var(--ct-muted);
    font-size: 13px;
}

.ticket-prepare {
    margin: 0 0 16px;
    padding-left: 18px;
    color: var(--ct-text);
}

.ticket-modal-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #eef3f8;
}

.ticket-modal-foot-3 {
    flex-wrap: wrap;
}

.ticket-still {
    color: var(--ct-muted);
    font-size: 13px;
}

.ticket-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--ct-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.ticket-form-error {
    color: #c0392b;
    margin-bottom: 10px;
}

@media (max-width: 991px) {
    .ticket-cat-grid,
    .ticket-help-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .ticket-head,
    .ticket-thread-head,
    .ticket-head-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ticket-search input,
    .ticket-btn-create {
        width: 100%;
    }

    .ticket-cat-grid,
    .ticket-help-cards {
        grid-template-columns: 1fr;
    }

    .ticket-table-wrap {
        overflow-x: auto;
    }

    .ticket-modal {
        padding: 12px;
    }
}
