/**
 * ============================================================
 * File Name       : QA_Form_Style.css
 * Module          : QA Forms UI (Email / Social / Calls)
 * Description     : Styling for QA evaluation modals, grid layout,
 *                  scoring section, and responsive UI for all devices.
 *
 * Developer       : Farhan Akhtar
 * Last Modified   : 13-01-2026
 *
 * Notes:
 *  - Uses CSS variables for theme consistency
 *  - Grid layout adapts from desktop to mobile
 *  - Fixes global <h6> override issues using scoped class
 * ============================================================
 */

/* ============================================================
   Theme Variables
============================================================ */
:root {
    --color-primary: #1F7437;
    --color-text: #134252;
    --color-border: #d4d4d4;
    --color-light-bg: #f9f9f9;
}

/* Prevent layout width overflow bugs */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ============================================================
   Base Containers
============================================================ */
.page-container {
    min-height: 100vh;
    padding: 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 30px;
}

.page-header h1 {
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 28px;
}

.page-header p {
    color: var(--color-text);
    font-size: 14px;
    margin: 0;
}

.tabs-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================================
   Modal Buttons UI
============================================================ */
.modal-buttons-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1000px;
    margin: 0 auto;
}

.modal-open-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 40px 20px;
    background: #fff;
    border: 2px solid var(--color-primary);
    border-radius: 8px;

    cursor: pointer;
    transition: all 0.3s ease;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
}

.modal-open-btn:hover {
    background-color: var(--color-primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Accessibility: focus visible */
.modal-open-btn:focus-visible {
    outline: 3px solid rgba(31, 116, 55, 0.35);
    outline-offset: 3px;
}

.modal-btn-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.modal-btn-text {
    display: block;
    text-align: center;
}

/* ============================================================
   Modal Header
============================================================ */
.modal-header {
    background-color: var(--color-primary);
    color: #fff;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* ============================================================
   QA Form Section Styling
============================================================ */
.evaluation-section {
    background-color: #fff;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.section-header {
    background-color: var(--color-light-bg);
    padding: 15px 20px;
    border-left: 4px solid var(--color-primary);
    font-weight: 600;
    font-size: 14px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-weight {
    background-color: var(--color-primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Desktop grid row */
.criterion-row {
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border);

    display: grid;
    grid-template-columns: 50px 200px 1fr 80px 80px 80px 100px;
    gap: 15px;
    align-items: start;
}

.criterion-row:last-child {
    border-bottom: none;
}

.criterion-number {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 14px;
}

.criterion-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text);
}

.criterion-description {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.checkbox-cell {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.checkbox-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.weight-cell {
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-primary);
}

/* ============================================================
   Total Row
============================================================ */
.total-row {
    background-color: var(--color-light-bg);
    padding: 15px 20px;

    display: grid;
    grid-template-columns: 50px 200px 1fr 80px 80px 80px 100px;
    gap: 15px;
    align-items: center;

    font-weight: 600;
    border-top: 2px solid var(--color-primary);
}

.total-label {
    grid-column: 1 / 4;
    font-size: 14px;
}

/* ============================================================
   Form Container
============================================================ */
.form-container {
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
}

/* ============================================================
   Submit Button
============================================================ */
.btn-submit {
    background-color: var(--color-primary);
    color: #fff;
    border: none;

    padding: 10px 30px;
    font-weight: 600;
    margin-top: 20px;
    width: 100%;
}

.btn-submit:hover {
    background-color: #0c441c;
    color: #fff;
}

/* ============================================================
   Score Summary
============================================================ */
.score-summary {
    margin-top: 20px;
    padding: 15px;
    background-color: #e8f4f5;
    border-radius: 4px;
    border-left: 4px solid var(--color-primary);
}

.score-summary h6 {
    color: var(--color-primary);
    margin-bottom: 10px;
}

.score-item {
    font-size: 13px;
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
}

/* ============================================================
   ✅ Fix Global H6 Override Issue
   Apply this class to headings that must NOT inherit global h6 styles.
============================================================ */
h6.no-global-h6 {
    background: none !important;
    padding: 0 !important;
    margin: 0 0 10px 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--color-primary) !important;
}

/* ============================================================
   Responsive Rules
============================================================ */
@media (max-width: 1400px) {
    .criterion-row,
    .total-row {
        grid-template-columns: 40px 150px 1fr 70px 70px 70px 80px;
        font-size: 12px;
    }
}

@media (max-width: 1200px) {
    .criterion-row,
    .total-row {
        grid-template-columns: 35px 130px 1fr 60px 60px 60px 70px;
        font-size: 11px;
        gap: 10px;
    }

    .criterion-title { font-size: 12px; }
    .criterion-description { font-size: 11px; }
    .weight-cell { font-size: 12px; }
}

@media (max-width: 992px) {
    .criterion-row,
    .total-row {
        grid-template-columns: 30px 110px 1fr 50px 50px 50px 60px;
        font-size: 10px;
        gap: 8px;
        padding: 12px 15px;
    }

    .criterion-number { font-size: 12px; }
    .criterion-title { font-size: 11px; }
    .criterion-description { font-size: 10px; line-height: 1.3; }

    .checkbox-cell input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

    .weight-cell { font-size: 11px; }

    .section-header {
        padding: 12px 15px;
        font-size: 13px;
    }

    .section-weight {
        padding: 3px 10px;
        font-size: 11px;
    }

    .form-container {
        padding: 15px;
        max-height: 70vh;
    }
}

/* Mobile: stack everything */
@media (max-width: 768px) {
    .page-header h1 { font-size: 20px; }

    .modal-buttons-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .modal-open-btn {
        padding: 30px 15px;
        font-size: 14px;
    }

    .modal-btn-icon {
        font-size: 36px;
        margin-bottom: 10px;
    }

    .criterion-row,
    .total-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }

    .criterion-number {
        font-size: 13px;
        margin-bottom: 5px;
        display: inline-block;
    }

    .criterion-title {
        font-size: 12px;
        margin-bottom: 5px;
        display: block;
    }

    .criterion-description {
        font-size: 11px;
        margin-bottom: 10px;
        display: block;
    }

    .checkbox-cell {
        justify-content: flex-start;
        display: flex;
        margin-bottom: 5px;
    }

    .checkbox-cell input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-right: 15px;
    }

    .weight-cell {
        text-align: left;
        font-size: 12px;
        margin-top: 8px;
        padding: 8px;
        background-color: var(--color-light-bg);
        border-radius: 4px;
    }

    .section-header {
        padding: 12px;
        font-size: 13px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .section-weight {
        padding: 4px 10px;
        font-size: 11px;
    }

    .form-container { padding: 15px; }

    .btn-submit {
        padding: 10px 16px;
        font-size: 12px;
    }

    .total-label {
        grid-column: auto;
        margin-bottom: 10px;
    }

    .score-summary {
        margin-top: 15px;
        padding: 12px;
    }

    .score-summary h6 { font-size: 12px; }

    .score-item {
        font-size: 11px;
        flex-direction: column;
        gap: 5px;
    }

    .evaluation-section { margin-bottom: 15px; }
}

@media (max-width: 576px) {
    body { font-size: 12px; }

    .page-container { padding: 15px 10px; }
    .page-header h1 { font-size: 18px; }

    .modal-buttons-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .modal-open-btn {
        padding: 25px 12px;
        font-size: 12px;
        border-radius: 6px;
    }

    .modal-btn-icon {
        font-size: 32px;
        margin-bottom: 8px;
    }

    .criterion-row,
    .total-row {
        padding: 10px;
        gap: 6px;
    }

    .criterion-number { font-size: 12px; }
    .criterion-title { font-size: 11px; font-weight: 600; }
    .criterion-description { font-size: 10px; line-height: 1.3; }

    .checkbox-cell { margin: 8px 0; }
    .checkbox-cell input[type="checkbox"] { width: 18px; height: 18px; }

    .weight-cell {
        font-size: 11px;
        padding: 6px;
        margin-top: 5px;
    }

    .section-header {
        padding: 10px;
        font-size: 12px;
        gap: 6px;
    }

    .section-weight {
        font-size: 10px;
        padding: 3px 8px;
    }

    .form-container { padding: 12px; }

    .btn-submit {
        padding: 10px;
        font-size: 11px;
    }

    .total-label {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .score-summary {
        margin-top: 12px;
        padding: 10px;
    }

    .score-summary h6 {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .score-item {
        font-size: 10px;
        padding: 3px 0;
        gap: 3px;
    }

    .evaluation-section { margin-bottom: 12px; }
}

@media (max-width: 360px) {
    .page-container { padding: 10px 8px; }
    .page-header h1 { font-size: 16px; }

    .criterion-row { padding: 8px; }
    .criterion-number { font-size: 11px; }
    .criterion-title { font-size: 10px; }
    .criterion-description { font-size: 9px; }
    .weight-cell { font-size: 10px; }

    .form-container { padding: 10px; }

    .section-header {
        padding: 8px;
        font-size: 11px;
    }
}


/* ============================================================
   Accordion Header UI Fix (Match Section Header Theme)
   Developer     : Farhan Akhtar
   Last Modified : 13-01-2026
============================================================ */

/* Remove Bootstrap default blue background */
.accordion-button {
    background: var(--color-light-bg) !important;
    color: var(--color-text) !important;
    font-weight: 600;
    font-size: 14px;
    border-left: 4px solid var(--color-primary) !important;
    box-shadow: none !important;
}

/* Active (expanded) state should remain same theme (NOT blue) */
.accordion-button:not(.collapsed) {
    background: var(--color-light-bg) !important;
    color: var(--color-text) !important;
    box-shadow: none !important;
}

/* Border line around accordion item */
.accordion-item {
    border: 1px solid var(--color-border) !important;
    border-radius: 6px;
    overflow: hidden;
}

/* Body background clean */
.accordion-body {
    background: #fff;
}

/* Remove default focus glow */
.accordion-button:focus {
    box-shadow: none !important;
    border-color: var(--color-border) !important;
}

/* Change arrow icon color */
.accordion-button::after {
    filter: brightness(0) saturate(100%) invert(20%) sepia(22%) saturate(600%) hue-rotate(140deg);
}

/* ============================================================
   Call Recording Player UI (Calls Modal)
   Developer     : Farhan Akhtar
   Last Modified : 13-01-2026
============================================================ */

.call-audio-card{
    background: #fff;
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.call-audio-title{
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

.call-audio-player{
    width: 100%;
    height: 42px;
    border-radius: 8px;
}

/* ============================================================
   QA YES / NO Column Headings
   Developer     : Farhan Akhtar
   Last Modified : 13-01-2026
============================================================ */

/* Heading row for checkbox columns */
.qa-heading-row{
    background: #f9f9f9;
    padding: 10px 20px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 700;
}

/* Smaller text styling */
.qa-heading-row .criterion-number,
.qa-heading-row .criterion-title,
.qa-heading-row .criterion-description,
.qa-heading-row .weight-cell{
    color: var(--color-text);
    font-size: 12px;
}

/* YES / NO label styling */
.qa-head-cell{
    font-size: 12px;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
}

/* Assessor Notes Focus Border Green */
textarea.form-control:focus {
    border-color: #28a745 !important; /* green */
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25) !important; /* green glow */
    outline: none !important;
}

/* Scorecard ID top bar */
.qa-scorecard-box{
    background: #e9f7ef;
    border: 1px solid #b7e4c7;
    border-left: 5px solid #198754;
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.qa-scorecard-label{
    font-weight: 600;
    color: #198754;
    white-space: nowrap;
}

.qa-scorecard-id{
    font-weight: 600;
    color: #0f5132;
    background: #d1e7dd;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
}

.qa-modal .modal-header {
    padding: 10px 16px !important;
    min-height: 45px !important;
}

.qa-modal .modal-title {
    font-size: 16px !important;
    font-weight: 600 !important;
}

.qa-modal .btn-close {
    transform: scale(0.85);
}

/*  Clean missing highlight (left red bar only) */
.criterion-row.qa-missing {
    background: #fff7f7;
    position: relative;
    border-radius: 6px;
}

/* Red bar on left */
.criterion-row.qa-missing::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #dc3545;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

/* Optional: slight glow */
.criterion-row.qa-missing {
    box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.25);
}

