/* =====================================================
   CSGT Phạt Nguội Plugin – style.css v4.1
   ===================================================== */

:root {
    --csgt-primary      : #ba0c2f;
    --csgt-primary-dark : #8b0a24;
    --csgt-success      : #198754;
    --csgt-danger       : #dc3545;
    --csgt-warning      : #ffc107;
    --csgt-gray-100     : #f8f9fa;
    --csgt-gray-200     : #e9ecef;
    --csgt-gray-500     : #adb5bd;
    --csgt-gray-600     : #6c757d;
    --csgt-radius       : 12px;
    --csgt-shadow       : 0 4px 24px rgba(0,0,0,0.10);
    --csgt-transition   : all 0.2s ease;
}

/* ========== WRAPPER ========== */
.csgt-pn-wrapper {
    max-width: 600px;
    margin: 0 auto;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
}

/* ========== CARD ========== */
.csgt-pn-card {
    background: #fff;
    border-radius: var(--csgt-radius);
    box-shadow: var(--csgt-shadow);
    overflow: hidden;
    border: 1px solid var(--csgt-gray-200);
}

/* ========== HEADER ========== */
.csgt-pn-header {
    background: linear-gradient(135deg, var(--csgt-primary) 0%, var(--csgt-primary-dark) 100%);
    padding: 28px 28px 24px;
    text-align: center;
    color: #fff;
}
.csgt-pn-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    margin-bottom: 12px;
}
.csgt-pn-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: #fff;
    letter-spacing: 0.01em;
}
.csgt-pn-subtitle {
    font-size: 0.85rem;
    opacity: 0.85;
    margin: 0;
}

/* ========== BODY ========== */
.csgt-pn-body {
    padding: 24px 28px 20px;
}

/* ========== FIELD GROUP ========== */
.csgt-pn-field-group {
    margin-bottom: 18px;
}
.csgt-pn-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 7px;
}

/* ========== SELECT ========== */
.csgt-pn-select-wrapper {
    position: relative;
}
.csgt-pn-select {
    width: 100%;
    padding: 11px 36px 11px 14px;
    font-size: 0.95rem;
    color: #212529;
    background: #fff;
    border: 1.5px solid #ced4da;
    border-radius: 8px;
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: var(--csgt-transition);
    box-sizing: border-box;
}
.csgt-pn-select:focus { border-color: var(--csgt-primary); box-shadow: 0 0 0 3px rgba(186,12,47,0.1); }
.csgt-pn-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: var(--csgt-gray-600);
    pointer-events: none;
}

/* ========== INPUT ========== */
.csgt-pn-input-wrapper { position: relative; }
.csgt-pn-input {
    width: 100%;
    padding: 11px 38px 11px 14px;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    background: #fff;
    border: 1.5px solid #ced4da;
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
    letter-spacing: 0.04em;
    transition: var(--csgt-transition);
}
.csgt-pn-input:focus { border-color: var(--csgt-primary); box-shadow: 0 0 0 3px rgba(186,12,47,0.1); }
.csgt-pn-input.is-invalid { border-color: var(--csgt-danger); }
.csgt-pn-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--csgt-gray-500);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 2px 5px;
    line-height: 1;
    border-radius: 50%;
    transition: var(--csgt-transition);
}
.csgt-pn-clear-btn:hover { background: var(--csgt-gray-200); color: #333; }

.csgt-pn-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--csgt-gray-600);
    margin-top: 5px;
}
.csgt-pn-error {
    display: block;
    font-size: 0.8rem;
    color: var(--csgt-danger);
    margin-top: 4px;
    min-height: 1rem;
}

/* ========== SUBMIT BUTTON ========== */
.csgt-pn-submit-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--csgt-primary) 0%, var(--csgt-primary-dark) 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--csgt-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}
.csgt-pn-submit-btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(186,12,47,0.3); }
.csgt-pn-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.csgt-pn-btn-text, .csgt-pn-btn-loading { display: flex; align-items: center; gap: 8px; }

/* Spinner inside button */
.csgt-pn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: csgt-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes csgt-spin { to { transform: rotate(360deg); } }

/* ========== NOTE ========== */
.csgt-pn-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--csgt-gray-600);
    background: var(--csgt-gray-100);
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 14px;
    border-left: 3px solid var(--csgt-primary);
}
.csgt-pn-note strong { color: #495057; }

/* ========== HOTLINE ========== */
.csgt-pn-hotline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--csgt-gray-600);
    margin-top: 14px;
    text-align: center;
}
.csgt-pn-hotline strong { color: #333; }

/* =====================================================
   RESULT BOX
   ===================================================== */
.csgt-pn-result {
    margin-top: 16px;
}

/* ---- Loading ---- */
.csgt-pn-loading-card {
    background: #fff;
    border-radius: var(--csgt-radius);
    box-shadow: var(--csgt-shadow);
    border: 1px solid var(--csgt-gray-200);
    padding: 36px 24px;
    text-align: center;
    color: #495057;
}
.csgt-pn-loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--csgt-gray-200);
    border-top-color: var(--csgt-primary);
    border-radius: 50%;
    animation: csgt-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

/* ---- Result card ---- */
.csgt-pn-result-card {
    background: #fff;
    border-radius: var(--csgt-radius);
    box-shadow: var(--csgt-shadow);
    border: 1px solid var(--csgt-gray-200);
    overflow: hidden;
}

/* ---- Summary header ---- */
.csgt-pn-summary {
    padding: 16px 20px;
    border-bottom: 1px solid var(--csgt-gray-200);
    background: var(--csgt-gray-100);
    text-align: center;
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.6;
}
.csgt-pn-summary p { margin: 4px 0; }
.csgt-pn-summary strong { color: #212529; }
.csgt-pn-total-count { color: var(--csgt-danger) !important; font-size: 1.05em; }

.csgt-pn-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0 6px;
    flex-wrap: wrap;
}
.csgt-pn-badge {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 0.83rem;
    font-weight: 700;
    color: #fff;
}
.csgt-pn-badge-pending { background: var(--csgt-danger); }
.csgt-pn-badge-done    { background: var(--csgt-success); }

.csgt-pn-update-time {
    font-size: 0.78rem !important;
    color: var(--csgt-gray-600) !important;
    margin-top: 6px !important;
}
.csgt-pn-update-time strong { color: #333 !important; }

/* ---- Violation table ---- */
.csgt-pn-vi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.csgt-pn-vi-table + .csgt-pn-vi-table {
    border-top: 3px solid var(--csgt-primary);
}
.csgt-pn-vi-table tr { border-bottom: 1px solid var(--csgt-gray-200); }
.csgt-pn-vi-table tr:last-child { border-bottom: none; }
.csgt-pn-vi-table tr:hover td { background: #fdf5f6; }
.csgt-pn-vi-table td {
    padding: 10px 16px;
    vertical-align: top;
    line-height: 1.55;
}
.csgt-pn-vi-label {
    width: 36%;
    color: var(--csgt-gray-600);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
}
.csgt-pn-vi-val {
    color: #212529;
    font-weight: 500;
}

/* ---- Status badge ---- */
.csgt-pn-status {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}
.csgt-pn-status-pending { background: var(--csgt-danger); }
.csgt-pn-status-done    { background: var(--csgt-success); }

/* ---- No violation ---- */
.csgt-pn-no-violation {
    padding: 36px 24px;
    text-align: center;
    color: #495057;
}
.csgt-pn-no-violation .csgt-pn-result-icon { font-size: 52px; margin-bottom: 12px; }
.csgt-pn-no-violation h3 { color: var(--csgt-success); font-size: 1.15rem; margin: 0 0 8px; }
.csgt-pn-no-violation p  { margin: 4px 0; font-size: 0.9rem; }

/* ---- Error card ---- */
.csgt-pn-error-card {
    padding: 28px 24px;
    text-align: center;
    border-left: 4px solid var(--csgt-danger);
}
.csgt-pn-error-card .csgt-pn-result-icon { font-size: 44px; margin-bottom: 10px; }
.csgt-pn-error-card h3 { color: var(--csgt-danger); margin: 0 0 8px; }
.csgt-pn-error-card p  { color: #495057; font-size: 0.9rem; }

.csgt-pn-note-small {
    font-size: 0.76rem !important;
    color: var(--csgt-gray-500) !important;
    margin-top: 10px !important;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .csgt-pn-body { padding: 18px 16px 16px; }
    .csgt-pn-header { padding: 22px 16px 18px; }
    .csgt-pn-vi-label { width: 42%; font-size: 0.79rem; white-space: normal; }
    .csgt-pn-vi-table td { padding: 9px 12px; }
}
