/* Jalpi Support Tickets - Frontend Styles */

.jalpi-hd-form-wrap,
.jalpi-hd-track-wrap {
    max-width: 580px;
    margin: 0 auto;
    font-family: inherit;
}

/* Card wrapper around the form */
.jalpi-hd-form-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    padding: 24px 28px;
}

/* Two-column row (Name + Email, Dept + Priority) */
.jalpi-hd-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

@media (max-width: 540px) {
    .jalpi-hd-row-2 {
        grid-template-columns: 1fr;
    }
    .jalpi-hd-form-card {
        padding: 18px 16px;
    }
}

/* Form Groups */
.jalpi-hd-form-group {
    margin-bottom: 16px;
}

.jalpi-hd-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

.jalpi-hd-form-group label .required {
    color: #c00;
    margin-left: 3px;
}

.jalpi-hd-form-group input[type="text"],
.jalpi-hd-form-group input[type="email"],
.jalpi-hd-form-group select,
.jalpi-hd-form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c3c4c7;
    background: #fff;
    font-size: 14px;
    color: #333;
    box-sizing: border-box;
    border-radius: 0;
    font-family: inherit;
}

.jalpi-hd-form-group input[type="text"]:focus,
.jalpi-hd-form-group input[type="email"]:focus,
.jalpi-hd-form-group select:focus,
.jalpi-hd-form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
}

.jalpi-hd-form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.jalpi-hd-field-note {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.jalpi-hd-field-error {
    font-size: 12px;
    color: #c00;
    margin-top: 4px;
    display: none;
}

.jalpi-hd-field-error.visible {
    display: block;
}

/* Submit row alignment */
.jalpi-hd-form-submit-row {
    margin-bottom: 0;
}

/* Submit Button */
.jalpi-hd-submit-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 9px 20px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

.jalpi-hd-submit-btn:hover {
    background: #005177;
}

.jalpi-hd-submit-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

/* Notices */
.jalpi-hd-notice {
    padding: 10px 14px;
    border-left: 4px solid;
    margin-bottom: 15px;
    font-size: 14px;
}

.jalpi-hd-notice-success {
    background: #f0f9f0;
    border-color: #4caf50;
    color: #1a5c1a;
}

.jalpi-hd-notice-success .jalpi-hd-ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
    margin: 8px 0 4px;
    font-size: 14px;
}

.jalpi-hd-notice-success small {
    font-size: 12px;
    opacity: 0.75;
}

.jalpi-hd-notice-error {
    background: #fdf2f2;
    border-color: #c00;
    color: #7a0000;
}

/* Status Badges */
.jalpi-hd-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.jalpi-hd-badge-open    { background: #d1e7dd; color: #0a3622; border: 1px solid #a3cfbb; }
.jalpi-hd-badge-pending { background: #fff3cd; color: #664d03; border: 1px solid #ffda6a; }
.jalpi-hd-badge-closed  { background: #f8d7da; color: #58151c; border: 1px solid #f1aeb5; }

/* ---- Ticket Result Card ---- */
.jalpi-hd-result-card {
    border: 1px solid #c3c4c7;
    background: #fff;
    margin-top: 20px;
}

.jalpi-hd-result-header {
    background: #f6f7f7;
    border-bottom: 1px solid #c3c4c7;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.jalpi-hd-result-header-id {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.jalpi-hd-result-id-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #646970;
    font-weight: 400;
}

.jalpi-hd-result-header-id strong {
    font-size: 15px;
    color: #1d2327;
}

/* Meta rows (Status / Subject / Priority / etc.) */
.jalpi-hd-result-meta {
    border-bottom: 1px solid #e8e8e8;
}

.jalpi-hd-result-meta-row {
    display: flex;
    align-items: center;
    padding: 8px 18px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    gap: 12px;
}

.jalpi-hd-result-meta-row:last-child {
    border-bottom: none;
}

.jalpi-hd-meta-key {
    width: 110px;
    flex-shrink: 0;
    color: #646970;
    font-size: 13px;
}

/* Sections (Initial Problem / Conversation) */
.jalpi-hd-result-section {
    padding: 14px 18px;
    border-top: 1px solid #e8e8e8;
}

.jalpi-hd-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #646970;
    margin-bottom: 10px;
}

.jalpi-hd-conv-message {
    border: 1px solid #ddd;
    margin-bottom: 10px;
    font-size: 13px;
}

.jalpi-hd-conv-message.jalpi-hd-admin-msg {
    border-color: #b4d4ed;
}

.jalpi-hd-conv-header {
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    padding: 7px 12px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}

.jalpi-hd-admin-msg .jalpi-hd-conv-header {
    background: #e7f3fb;
    border-bottom-color: #d0e9f7;
}

.jalpi-hd-conv-body {
    padding: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.jalpi-hd-conv-attachments {
    padding: 6px 12px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
}

/* Loading */
.jalpi-hd-loading {
    color: #0073aa;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
    .jalpi-hd-result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .jalpi-hd-result-meta-row {
        flex-wrap: wrap;
    }
    .jalpi-hd-meta-key {
        width: 90px;
    }
}
