/**
 * Tradlos Helpdesk Public Styles
 */

/* Form container */
.helpdesk-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.helpdesk-form-container h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2271b1;
}

/* Form rows */
.helpdesk-form-row {
    margin-bottom: 20px;
}

.helpdesk-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.helpdesk-form-row .required {
    color: #d63638;
}

.helpdesk-form-row input[type="text"],
.helpdesk-form-row input[type="email"],
.helpdesk-form-row select,
.helpdesk-form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
}

.helpdesk-form-row input:focus,
.helpdesk-form-row select:focus,
.helpdesk-form-row textarea:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

/* Submit button */
.helpdesk-submit-btn,
.helpdesk-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.helpdesk-submit-btn:hover,
.helpdesk-btn:hover {
    background: #135e96;
    color: #fff;
}

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

/* Messages */
.helpdesk-error {
    padding: 12px 15px;
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    margin-bottom: 20px;
    color: #d63638;
}

.helpdesk-success-message {
    padding: 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    text-align: center;
}

.helpdesk-success-message h4 {
    margin: 0 0 10px 0;
    color: #155724;
}

/* Portal styles */
.helpdesk-portal {
    max-width: 900px;
    margin: 0 auto;
}

.helpdesk-portal h3 {
    margin-bottom: 20px;
}

.helpdesk-portal-login {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Tickets table */
.helpdesk-tickets-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #ddd;
}

.helpdesk-tickets-table th,
.helpdesk-tickets-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.helpdesk-tickets-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.helpdesk-tickets-table tr:hover {
    background: #f9f9f9;
}

.helpdesk-tickets-table a {
    color: #2271b1;
    text-decoration: none;
}

.helpdesk-tickets-table a:hover {
    text-decoration: underline;
}

/* Status badge */
.helpdesk-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
}

/* Ticket detail */
.helpdesk-ticket-detail .helpdesk-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.helpdesk-ticket-detail .helpdesk-ticket-header h3 {
    margin: 0;
}

.helpdesk-ticket-meta {
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 14px;
}

.helpdesk-ticket-meta span {
    margin-right: 20px;
}

/* Messages */
.helpdesk-messages {
    margin-bottom: 30px;
}

.helpdesk-message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 4px;
}

.helpdesk-message.staff {
    background: #e8f4ff;
    border-left: 4px solid #2271b1;
}

.helpdesk-message.customer {
    background: #f9f9f9;
    border-left: 4px solid #ddd;
}

.helpdesk-message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.helpdesk-message-time {
    color: #666;
}

.helpdesk-message-body {
    line-height: 1.6;
}

/* Reply form */
.helpdesk-reply-form {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.helpdesk-reply-form h4 {
    margin: 0 0 15px 0;
}

.helpdesk-reply-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 15px;
}

/* Ticket closed notice */
.helpdesk-ticket-closed {
    padding: 15px 20px;
    background: #f0f0f1;
    border-radius: 4px;
    text-align: center;
}

/* No tickets message */
.helpdesk-no-tickets {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Portal header */
.helpdesk-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
    gap: 10px;
}

.helpdesk-portal-user {
    font-size: 14px;
    color: #666;
}

.helpdesk-portal-user strong {
    color: #333;
}

.helpdesk-logout-link {
    margin-left: 15px;
    color: #d63638;
    text-decoration: none;
}

.helpdesk-logout-link:hover {
    text-decoration: underline;
}

/* Portal login form */
.helpdesk-portal-login {
    max-width: 400px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.helpdesk-portal-login h3 {
    margin: 0 0 10px 0;
    text-align: center;
}

.helpdesk-portal-login > p {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
}

.helpdesk-portal-login .helpdesk-form-row {
    margin-bottom: 20px;
}

.helpdesk-portal-login .helpdesk-form-row:last-child {
    margin-bottom: 0;
    text-align: center;
}

.helpdesk-portal-login input[type="email"],
.helpdesk-portal-login input[type="text"] {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.helpdesk-portal-login input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.helpdesk-portal-login .helpdesk-btn {
    width: 100%;
    padding: 14px 24px;
}

#helpdesk-back-to-email {
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media screen and (max-width: 600px) {
    .helpdesk-form-container {
        padding: 15px;
    }

    .helpdesk-tickets-table th,
    .helpdesk-tickets-table td {
        padding: 10px;
        font-size: 14px;
    }

    .helpdesk-ticket-detail .helpdesk-ticket-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
