/**
 * TFT Recruitment Plugin Styles
 * Dynamic form rendering with availability grid, conditional fields, and mobile responsive
 */

/* ========================================
   GENERAL / UTILITY
   ======================================== */

.tft-required {
    color: #dc2626;
    font-weight: 600;
}

.tft-help-text {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.4;
}

.tft-recruitment-error,
.tft-recruitment-empty {
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    margin: 20px 0;
}

.tft-recruitment-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.tft-recruitment-empty {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    font-size: 1.125rem;
}

/* ========================================
   JOB LISTINGS - Full Width Panels
   ======================================== */

.tft-job-listings {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.tft-job-panel {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.2s, transform 0.2s;
}

.tft-job-panel:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.tft-panel-left {
    flex: 1;
    padding: 28px 30px;
    border-left: 5px solid #1e3c72;
}

.tft-panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3c72;
    margin: 0 0 14px 0;
    line-height: 1.3;
}

.tft-panel-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tft-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.tft-badge-category {
    background: #1e3c72;
    color: #ffffff;
}

.tft-badge-type {
    background: #e0e7ff;
    color: #3730a3;
}

.tft-badge-location {
    background: #f0fdf4;
    color: #166534;
}

.tft-badge-hours {
    background: #fef3c7;
    color: #92400e;
}

.tft-badge-salary {
    background: #d1fae5;
    color: #065f46;
}

.tft-panel-desc {
    color: #4b5563;
    line-height: 1.65;
    margin: 0;
    font-size: 0.9375rem;
}

.tft-panel-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 28px 24px;
    background: #f9fafb;
    border-left: 1px solid #e5e7eb;
    min-width: 170px;
}

.tft-job-panel .tft-panel-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.9375rem !important;
    text-decoration: none !important;
    text-align: center !important;
    transition: all 0.2s !important;
    white-space: nowrap !important;
}

.tft-job-panel .tft-panel-btn-apply {
    border: none !important;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(30, 60, 114, 0.25) !important;
}

.tft-job-panel .tft-panel-btn-apply:hover {
    background: linear-gradient(135deg, #162d5a 0%, #1e3c72 100%) !important;
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.35) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
}

.tft-job-panel .tft-panel-btn-details {
    background: #ffffff !important;
    color: #1e3c72 !important;
    border: 2px solid #1e3c72 !important;
}

.tft-job-panel .tft-panel-btn-details:hover {
    background: #1e3c72 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Mobile: stack vertically */
@media (max-width: 640px) {
    .tft-job-panel {
        flex-direction: column;
    }

    .tft-panel-right {
        flex-direction: row;
        border-left: none;
        border-top: 1px solid #e5e7eb;
        min-width: auto;
        padding: 16px 24px;
    }

    .tft-job-panel .tft-panel-btn {
        flex: 1 !important;
    }
}

/* ========================================
   JOB SINGLE VIEW
   ======================================== */

.tft-job-single {
    max-width: 900px;
    margin: 30px auto;
}

.tft-job-single-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    padding: 40px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.tft-job-single-header .tft-job-title {
    font-size: 2rem;
    margin: 0 0 12px 0;
}

.tft-job-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 1rem;
}

.tft-job-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tft-job-detail-item {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #1e3c72;
}

.tft-job-detail-item strong {
    display: block;
    color: #1e3c72;
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.tft-job-section {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tft-job-section h2 {
    color: #1e3c72;
    font-size: 1.5rem;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.tft-job-content {
    color: #374151;
    line-height: 1.7;
}

.tft-job-apply-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
}

.tft-job-apply-section p {
    margin: 0 0 20px 0;
    font-size: 1.125rem;
}

.tft-apply-button {
    display: inline-block;
    background: #ffffff;
    color: #1e3c72;
    padding: 16px 40px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.125rem;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tft-apply-button:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    color: #1e3c72;
}

.tft-apply-note {
    margin-top: 12px;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ========================================
   APPLICATION FORM
   ======================================== */

.tft-application-wrapper {
    max-width: 900px;
    margin: 30px auto;
}

.tft-application-wrapper .tft-job-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    padding: 40px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.tft-application-wrapper .tft-job-header h2 {
    margin: 0 0 12px 0;
    font-size: 2rem;
    color: #ffffff;
}

#tft-form-messages {
    margin-bottom: 20px;
}

.tft-message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
}

.tft-message-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.tft-message-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.tft-form-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tft-section-header {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #1e3c72;
    color: #1e3c72;
}
/* Section help text */
.tft-section-help {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: -8px 0 16px 0;
    padding: 0;
}



.tft-form-group {
    margin-bottom: 16px;
}

.tft-form-group label {
    display: block;
    margin-bottom: 4px;
    color: #1f2937;
    font-weight: 600;
    font-size: 0.9375rem;
}

.tft-input,
.tft-textarea,
.tft-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #ffffff;
    color: #1f2937;
    min-height: 42px;
}

.tft-input:focus,
.tft-textarea:focus,
.tft-select:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.tft-textarea {
    min-height: 100px;
    resize: vertical;
}

.tft-file-input {
    padding: 10px 0;
    cursor: pointer;
}

.tft-file-selected {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #374151;
}

/* Radio and Checkbox Groups */
.tft-radio-group,
.tft-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.tft-radio-label,
.tft-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.tft-radio-label:hover,
.tft-checkbox-label:hover {
    background-color: #f3f4f6;
}

.tft-radio-label input[type="radio"],
.tft-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0 4px 0 0;
}

.tft-radio-label span,
.tft-checkbox-label span {
    flex: 1;
    font-weight: normal;
    line-height: 1.5;
}

/* ========================================
   AVAILABILITY GRID
   ======================================== */

.tft-availability-grid {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tft-availability-grid table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    background: #ffffff;
}

.tft-availability-grid thead {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
}

.tft-availability-grid th {
    padding: 12px 16px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tft-availability-grid tbody tr:nth-child(even) {
    background: #f9fafb;
}

.tft-availability-grid td {
    padding: 12px 16px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.tft-availability-grid td.tft-grid-row-header {
    text-align: left;
    font-weight: 600;
    color: #1e3c72;
    white-space: nowrap;
    background: #f3f4f6;
}

.tft-availability-grid td label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    min-height: 44px;
}

.tft-availability-grid input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
}

/* Mobile: abbreviate column headers */


/* ========================================
   REFERENCE CARDS
   ======================================== */

.tft-references-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tft-reference-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.tft-reference-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
}

.tft-reference-card-number {
    font-weight: 600;
    font-size: 0.9rem;
}

.tft-reference-remove {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.tft-reference-remove:hover {
    background: rgba(255,255,255,0.35);
}

.tft-reference-card-body {
    padding: 16px;
}

.tft-reference-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tft-reference-grid .tft-form-group {
    margin-bottom: 0;
}

.tft-reference-grid .tft-form-group:last-child {
    grid-column: 1 / -1;
}

.tft-reference-grid label {
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.tft-reference-add {
    background: #fff;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 14px;
    color: #1e3c72;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.tft-reference-add:hover {
    border-color: #1e3c72;
    background: #f0f4ff;
}

@media (max-width: 600px) {
    .tft-reference-grid {
        grid-template-columns: 1fr;
    }
}

/* Force radio/checkbox spacing - override theme */
.tft-recruitment-form .tft-radio-label,
.tft-recruitment-form .tft-checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
}

.tft-recruitment-form .tft-radio-label input[type="radio"],
.tft-recruitment-form .tft-checkbox-label input[type="checkbox"] {
    margin-right: 10px !important;
    margin-left: 0 !important;
    flex-shrink: 0 !important;
}

/* Desktop: show full labels, hide short */
.tft-label-short { display: none; }
.tft-label-full { display: inline; }

/* Mobile: responsive availability grid */
@media (max-width: 600px) {
    .tft-label-full { display: none; }
    .tft-label-short { display: inline; }

    .tft-availability-grid { overflow-x: visible; }
    .tft-availability-grid table { table-layout: fixed; width: 100%; }
    .tft-availability-grid th {
        font-size: 0.8rem;
        padding: 8px 4px;
        line-height: 1.2;
    }
    .tft-availability-grid td { padding: 6px 4px; }
    .tft-availability-grid td.tft-grid-row-header {
        font-size: 0.85rem;
        padding: 6px 8px;
        width: 25%;
        white-space: nowrap;
    }
    .tft-availability-grid input[type="checkbox"] { width: 20px; height: 20px; }
    .tft-availability-grid td label { min-height: 36px; }
}
   CONDITIONAL FIELDS
   ======================================== */

.tft-conditional-field {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
}

.tft-conditional-field[style*="display: none"] {
    opacity: 0;
    max-height: 0;
}

/* ========================================
   FORM ACTIONS & SUBMISSION
   ======================================== */

.tft-form-actions {
    margin-top: 32px;
    text-align: center;
}

.tft-submit-btn {
    background: linear-gradient(to right, #1e3c72, #2a5298);
    color: #ffffff;
    border: none;
    padding: 16px 48px;
    border-radius: 8px;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
    min-height: 44px;
}

.tft-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 60, 114, 0.4);
}

.tft-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success Card */
#tft-form-success {
    margin-top: 30px;
}

.tft-success-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 48px 32px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid #10b981;
}

.tft-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.tft-success-card h3 {
    color: #065f46;
    font-size: 1.75rem;
    margin: 0 0 16px 0;
}

.tft-success-card p {
    color: #374151;
    font-size: 1rem;
    margin: 12px 0;
}

.tft-ref-number {
    background: #f3f4f6;
    padding: 16px 24px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 1.25rem;
    color: #1e3c72;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .tft-job-listings {
        grid-template-columns: 1fr;
    }

    .tft-job-single-header {
        padding: 30px 20px;
    }

    .tft-job-single-header .tft-job-title {
        font-size: 1.5rem;
    }

    .tft-job-section {
        padding: 24px 20px;
    }

    .tft-application-wrapper .tft-job-header {
        padding: 30px 20px;
    }

    .tft-application-wrapper .tft-job-header h2 {
        font-size: 1.5rem;
    }

    .tft-form-section {
        padding: 24px 20px;
    }

    .tft-job-actions {
        flex-direction: column;
    }

    .tft-submit-btn {
        width: 100%;
        padding: 14px 32px;
    }

    .tft-success-card {
        padding: 32px 20px;
    }
}

@media (max-width: 480px) {
    .tft-job-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .tft-section-header {
        font-size: 1.125rem;
    }

    .tft-form-group {
        margin-bottom: 20px;
    }
}

/* ========================================
   BUTTON OVERRIDES - Force TFT style over theme
   ======================================== */

.tft-recruitment-form .tft-submit-btn,
.tft-application-wrapper .tft-submit-btn,
button.tft-submit-btn {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 14px 48px !important;
    border-radius: 8px !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.tft-recruitment-form .tft-submit-btn:hover,
.tft-application-wrapper .tft-submit-btn:hover,
button.tft-submit-btn:hover {
    background: linear-gradient(135deg, #162d5a 0%, #1e3c72 100%) !important;
    box-shadow: 0 6px 16px rgba(30, 60, 114, 0.4) !important;
    transform: translateY(-1px) !important;
    color: #ffffff !important;
}

.tft-references-container .tft-reference-add,
button.tft-reference-add {
    background: #ffffff !important;
    border: 2px dashed #1e3c72 !important;
    border-radius: 10px !important;
    padding: 14px !important;
    color: #1e3c72 !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    text-align: center !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-shadow: none !important;
}

.tft-references-container .tft-reference-add:hover,
button.tft-reference-add:hover {
    border-color: #2a5298 !important;
    background: #f0f4ff !important;
    color: #1e3c72 !important;
    box-shadow: none !important;
}

