/*
 * New Age Helpers Trust
 *
 * NAHT Field Worker System
 * Main Stylesheet
 */


/* --------------------------------------------------
   GENERAL FIELD WORKER AREA
-------------------------------------------------- */

.naht-fw-wrapper,
.naht-fw-card-wrapper,
.naht-fw-verification {
    box-sizing: border-box;
}

.naht-fw-wrapper *,
.naht-fw-card-wrapper *,
.naht-fw-verification * {
    box-sizing: border-box;
}


/* --------------------------------------------------
   PUBLIC VERIFICATION PAGE
-------------------------------------------------- */

.naht-fw-verification {
    width: 100%;
    max-width: 700px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
}


/* --------------------------------------------------
   VERIFICATION HEADER
-------------------------------------------------- */

.naht-fw-verification-header {
    margin-bottom: 25px;
}

.naht-fw-verification-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.3;
    font-weight: 700;
}

.naht-fw-verification-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.3;
    font-weight: 700;
}

.naht-fw-verification-header h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 600;
}


/* --------------------------------------------------
   VERIFICATION SEARCH AREA
-------------------------------------------------- */

.naht-fw-verification-search {
    width: 100%;
    margin: 0 auto 25px;
    padding: 20px;
    background: #f7f7f7;
    border: 1px solid #dddddd;
    border-radius: 8px;
    text-align: left;
}

.naht-fw-verification-search form {
    width: 100%;
    margin: 0;
}

.naht-fw-verification-search label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.naht-fw-verification-search input[type="text"] {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 44px;
    margin: 0 0 10px;
    padding: 8px 12px;
    border: 1px solid #cccccc;
    border-radius: 5px;
    background: #ffffff;
    color: #333333;
    font-size: 15px;
    line-height: 1.4;
    box-sizing: border-box;
}

.naht-fw-verification-search button {
    display: inline-block;
    min-height: 44px;
    padding: 8px 18px;
    border: 0;
    border-radius: 5px;
    background: #333333;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
}

.naht-fw-verification-search button:hover {
    opacity: 0.9;
}


/* --------------------------------------------------
   VERIFICATION RESULT
-------------------------------------------------- */

.naht-fw-verification-result {
    width: 100%;
    margin: 25px auto 0;
}


/* --------------------------------------------------
   VERIFICATION PHOTOGRAPH
-------------------------------------------------- */

/*
 * Important:
 * The public verification photograph is deliberately
 * restricted to a small fixed portrait size so that
 * the website theme cannot stretch it to full screen.
 */

.naht-fw-verification-photo {
    display: block !important;
    width: 150px !important;
    height: 180px !important;
    max-width: 150px !important;
    max-height: 180px !important;
    min-width: 150px !important;
    min-height: 180px !important;
    margin: 20px auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 3px solid #dddddd;
    border-radius: 8px;
    background: #f5f5f5;
    box-sizing: border-box !important;
}

.naht-fw-verification-photo img {
    display: block !important;
    width: 150px !important;
    height: 180px !important;
    max-width: 150px !important;
    max-height: 180px !important;
    min-width: 150px !important;
    min-height: 180px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 5px;
    object-fit: cover !important;
    object-position: center center;
    box-sizing: border-box !important;
}


/* --------------------------------------------------
   VERIFICATION DETAILS
-------------------------------------------------- */

.naht-fw-verification-details {
    width: 100%;
    margin: 25px auto;
    text-align: left;
}

.naht-fw-verification-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 12px 5px;
    border-bottom: 1px solid #eeeeee;
}

.naht-fw-verification-row strong {
    flex: 0 0 180px;
    font-weight: 700;
}

.naht-fw-verification-row span {
    flex: 1;
    text-align: right;
    word-break: break-word;
}

.naht-fw-verification-label {
    font-weight: 700;
}

.naht-fw-verification-value {
    text-align: right;
}


/* --------------------------------------------------
   VERIFICATION STATUS
-------------------------------------------------- */

.naht-fw-verification-status {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.naht-fw-verification-status.active {
    background: #e8f7e8;
    color: #267326;
}

.naht-fw-verification-status.inactive {
    background: #f8e8e8;
    color: #9b2525;
}


/* --------------------------------------------------
   VERIFICATION MESSAGE
-------------------------------------------------- */

.naht-fw-verification-message {
    margin-top: 25px;
    padding: 18px;
    background: #f7f7f7;
    border-left: 4px solid #333333;
    text-align: left;
    line-height: 1.7;
}

.naht-fw-verification-message p {
    margin: 8px 0 0;
}


/* --------------------------------------------------
   VERIFICATION FOOTER
-------------------------------------------------- */

.naht-fw-verification-footer {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #dddddd;
    font-size: 14px;
    line-height: 1.6;
}


/* --------------------------------------------------
   FIELD WORKER NOT FOUND
-------------------------------------------------- */

.naht-fw-verification-not-found {
    margin-top: 25px;
    padding: 20px;
    background: #f8f8f8;
    border: 1px solid #dddddd;
    border-radius: 8px;
    text-align: center;
}

.naht-fw-verification-not-found h3 {
    margin: 0 0 10px;
    font-size: 20px;
}

.naht-fw-verification-not-found p {
    margin: 0 0 8px;
    line-height: 1.6;
}


/* --------------------------------------------------
   FIELD WORKER ID CARD WRAPPER
-------------------------------------------------- */

.naht-fw-card-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 30px auto;
    font-family: Arial, Helvetica, sans-serif;
}


/* --------------------------------------------------
   ID CARD
-------------------------------------------------- */

.naht-fw-card {
    position: relative;
    width: 86mm;
    min-height: 54mm;
    margin: 25px auto;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 8px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.12);
}


/* --------------------------------------------------
   CARD FRONT
-------------------------------------------------- */

.naht-fw-card-front {
    padding: 12px;
}

.naht-fw-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dddddd;
}

.naht-fw-card-logo {
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.naht-fw-card-logo img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.naht-fw-card-title {
    flex: 1;
}

.naht-fw-card-title h2 {
    margin: 0;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 700;
}

.naht-fw-card-title p {
    margin: 4px 0 0;
    font-size: 8px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.7px;
}


/* --------------------------------------------------
   CARD FRONT BODY
-------------------------------------------------- */

.naht-fw-card-body {
    display: flex;
    gap: 12px;
    padding: 12px 0;
}

.naht-fw-photo {
    width: 28mm;
    height: 34mm;
    flex: 0 0 28mm;
    overflow: hidden;
    border: 2px solid #cccccc;
    border-radius: 5px;
    background: #f5f5f5;
}

.naht-fw-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.naht-fw-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 9px;
    font-weight: 700;
    color: #777777;
}

.naht-fw-worker-details {
    flex: 1;
    min-width: 0;
}

.naht-fw-detail-row {
    margin-bottom: 7px;
}

.naht-fw-label {
    display: block;
    margin-bottom: 2px;
    font-size: 7px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.naht-fw-value {
    display: block;
    font-size: 9px;
    line-height: 1.3;
    font-weight: 600;
    word-break: break-word;
}

.naht-fw-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 7px;
    line-height: 1;
    font-weight: 700;
    text-transform: uppercase;
}

.naht-fw-status.active {
    background: #e8f7e8;
    color: #267326;
}

.naht-fw-status.inactive {
    background: #f8e8e8;
    color: #9b2525;
}


/* --------------------------------------------------
   CARD FOOTER
-------------------------------------------------- */

.naht-fw-card-footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 7px;
    border-top: 1px solid #dddddd;
    text-align: center;
}

.naht-fw-card-footer strong {
    font-size: 8px;
}

.naht-fw-card-footer span {
    font-size: 6.5px;
}


/* --------------------------------------------------
   CARD BACK
-------------------------------------------------- */

.naht-fw-card-back {
    display: flex;
    flex-direction: column;
    min-height: 54mm;
    padding: 12px;
    text-align: center;
}

.naht-fw-card-back-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid #dddddd;
}

.naht-fw-card-back-header .naht-fw-card-logo {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
}

.naht-fw-card-back-header h2 {
    margin: 0;
    font-size: 13px;
    line-height: 1.3;
}


/* --------------------------------------------------
   QR CODE
-------------------------------------------------- */

.naht-fw-card-back-content {
    flex: 1;
    padding: 8px 0;
}

.naht-fw-card-back-content h3 {
    margin: 0 0 3px;
    font-size: 9px;
    line-height: 1.3;
    font-weight: 700;
}

.naht-fw-scan-text {
    margin: 0 0 6px;
    font-size: 7px;
}

.naht-fw-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px auto;
}

.naht-fw-qr img {
    display: block;
    width: 28mm;
    height: 28mm;
    max-width: 28mm;
    max-height: 28mm;
}

.naht-fw-worker-id {
    margin: 5px 0;
    font-size: 7px;
}

.naht-fw-worker-id strong {
    font-size: 8px;
}

.naht-fw-verification-note {
    max-width: 65mm;
    margin: 4px auto 0;
    font-size: 6.5px;
    line-height: 1.4;
}


/* --------------------------------------------------
   CARD BACK FOOTER
-------------------------------------------------- */

.naht-fw-card-back-footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 6px;
    border-top: 1px solid #dddddd;
}

.naht-fw-card-back-footer strong {
    font-size: 7px;
}

.naht-fw-card-back-footer span {
    font-size: 6px;
    line-height: 1.3;
}


/* --------------------------------------------------
   MOBILE RESPONSIVE
-------------------------------------------------- */

@media screen and (max-width: 600px) {

    .naht-fw-verification {
        width: calc(100% - 20px);
        margin: 20px auto;
        padding: 20px;
        border-radius: 8px;
    }

    .naht-fw-verification-header h1 {
        font-size: 23px;
    }

    .naht-fw-verification-header h2 {
        font-size: 21px;
    }

    .naht-fw-verification-header h3 {
        font-size: 18px;
    }

    .naht-fw-verification-search {
        padding: 15px;
    }

    .naht-fw-verification-search input[type="text"] {
        width: 100%;
        max-width: 100%;
    }

    .naht-fw-verification-search button {
        width: auto;
    }

    .naht-fw-verification-photo {
        width: 150px !important;
        height: 180px !important;
        max-width: 150px !important;
        max-height: 180px !important;
        min-width: 150px !important;
        min-height: 180px !important;
    }

    .naht-fw-verification-photo img {
        width: 150px !important;
        height: 180px !important;
        max-width: 150px !important;
        max-height: 180px !important;
        min-width: 150px !important;
        min-height: 180px !important;
    }

    .naht-fw-verification-row {
        flex-direction: column;
        gap: 5px;
    }

    .naht-fw-verification-row strong {
        flex: none;
    }

    .naht-fw-verification-row span {
        flex: none;
        text-align: left;
    }

    .naht-fw-verification-value {
        text-align: left;
    }

    .naht-fw-card {
        transform-origin: top center;
    }
}


/* --------------------------------------------------
   PRINTING
-------------------------------------------------- */

@media print {

    body {
        margin: 0;
        padding: 0;
        background: #ffffff;
    }

    .naht-fw-card-wrapper {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .naht-fw-card {
        margin: 0 auto 10mm;
        box-shadow: none;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .naht-fw-card-front,
    .naht-fw-card-back {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .naht-fw-verification {
        margin: 0 auto;
        box-shadow: none;
    }
}