/**
 * WC Helpdesk Frontend Styles
 * Using Inter font and custom brand colors
 */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
    --wc-hd-blue: #5e72e4;
    --wc-hd-indigo: #5603ad;
    --wc-hd-purple: #8965e0;
    --wc-hd-pink: #f3a4b5;
    --wc-hd-red: #f5365c;
    --wc-hd-orange: #ff6900;
    --wc-hd-yellow: #ffd600;
    --wc-hd-green: #2dce89;
    --wc-hd-teal: #11cdef;
    --wc-hd-cyan: #2bffc6;
    --wc-hd-gray: #6c757d;
    --wc-hd-gray-dark: #32325d;
    --wc-hd-light: #ced4da;
    --wc-hd-lighter: #e9ecef;
    --wc-hd-primary: #ad71e0;
    --wc-hd-secondary: #f4f5f7;
    --wc-hd-success: #00f2c3;
    --wc-hd-info: #1d8cf8;
    --wc-hd-warning: #ff8d72;
    --wc-hd-danger: #fd5d93;
    --wc-hd-dark: #212529;
    --wc-hd-default: #344675;
    --wc-hd-white: #fff;
}

/* Base Styles */
.wc-helpdesk-tickets,
.wc-helpdesk-ticket-view,
.wc-helpdesk-new-ticket,
.wc-helpdesk-no-purchases {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Buttons */
.wc-helpdesk-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
}

.wc-helpdesk-btn-primary {
    background: var(--wc-hd-primary);
    color: var(--wc-hd-white) !important;
}

.wc-helpdesk-btn-primary:hover {
    background: var(--wc-hd-purple);
    color: var(--wc-hd-white) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(173, 113, 224, 0.35);
}

.wc-helpdesk-btn-secondary {
    background: var(--wc-hd-secondary);
    color: var(--wc-hd-gray-dark) !important;
    border: 1px solid var(--wc-hd-light);
}

.wc-helpdesk-btn-secondary:hover {
    background: var(--wc-hd-lighter);
    color: var(--wc-hd-gray-dark) !important;
}

/* Header */
.wc-helpdesk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--wc-hd-lighter);
}

.wc-helpdesk-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--wc-hd-gray-dark);
}

/* Breadcrumb */
.wc-helpdesk-breadcrumb {
    margin-bottom: 20px;
}

.wc-helpdesk-breadcrumb a {
    color: var(--wc-hd-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.wc-helpdesk-breadcrumb a:hover {
    color: var(--wc-hd-purple);
}

/* Filters */
.wc-helpdesk-filters {
    margin-bottom: 20px;
}

.wc-helpdesk-filters select {
    padding: 10px 16px;
    border: 1px solid var(--wc-hd-light);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background: var(--wc-hd-white);
    cursor: pointer;
}

.wc-helpdesk-filters select:focus {
    outline: none;
    border-color: var(--wc-hd-primary);
    box-shadow: 0 0 0 3px rgba(173, 113, 224, 0.15);
}

/* Status Badges */
.wc-helpdesk-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.wc-helpdesk-status-open {
    background: rgba(94, 114, 228, 0.15);
    color: var(--wc-hd-blue);
}

.wc-helpdesk-status-in_progress {
    background: rgba(255, 141, 114, 0.15);
    color: var(--wc-hd-orange);
}

.wc-helpdesk-status-awaiting_customer {
    background: rgba(253, 93, 147, 0.15);
    color: var(--wc-hd-danger);
}

.wc-helpdesk-status-resolved {
    background: rgba(0, 242, 195, 0.15);
    color: #00a67d;
}

.wc-helpdesk-status-closed {
    background: rgba(108, 117, 125, 0.15);
    color: var(--wc-hd-gray);
}

/* Ticket List */
.wc-helpdesk-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wc-helpdesk-ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--wc-hd-white);
    border: 1px solid var(--wc-hd-lighter);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.wc-helpdesk-ticket-item:hover {
    border-color: var(--wc-hd-primary);
    box-shadow: 0 4px 12px rgba(50, 50, 93, 0.1);
}

.wc-helpdesk-ticket-item .ticket-main {
    flex: 1;
    min-width: 0;
}

.wc-helpdesk-ticket-item .ticket-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.wc-helpdesk-ticket-item .ticket-number {
    font-weight: 600;
    color: var(--wc-hd-primary);
    text-decoration: none;
}

.wc-helpdesk-ticket-item .ticket-number:hover {
    color: var(--wc-hd-purple);
}

.wc-helpdesk-ticket-item .ticket-subject {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 500;
}

.wc-helpdesk-ticket-item .ticket-subject a {
    color: var(--wc-hd-gray-dark);
    text-decoration: none;
}

.wc-helpdesk-ticket-item .ticket-subject a:hover {
    color: var(--wc-hd-primary);
}

.wc-helpdesk-ticket-item .ticket-meta {
    font-size: 13px;
    color: var(--wc-hd-gray);
}

.wc-helpdesk-ticket-item .meta-separator {
    margin: 0 8px;
}

.wc-helpdesk-ticket-item .ticket-action {
    margin-left: 20px;
}

/* No Tickets */
.wc-helpdesk-no-tickets {
    text-align: center;
    padding: 60px 20px;
    background: var(--wc-hd-secondary);
    border-radius: 12px;
}

.wc-helpdesk-no-tickets p {
    color: var(--wc-hd-gray);
    margin-bottom: 20px;
    font-size: 16px;
}

/* Pagination */
.wc-helpdesk-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--wc-hd-lighter);
}

.wc-helpdesk-pagination .pagination-info {
    color: var(--wc-hd-gray);
    font-size: 14px;
}

/* Ticket View */
.wc-helpdesk-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--wc-hd-lighter);
}

.wc-helpdesk-ticket-header .ticket-title {
    flex: 1;
}

.wc-helpdesk-ticket-header .ticket-number {
    font-size: 14px;
    color: var(--wc-hd-gray);
    font-weight: 500;
}

.wc-helpdesk-ticket-header h2 {
    margin: 4px 0 0 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--wc-hd-gray-dark);
}

.wc-helpdesk-ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--wc-hd-secondary);
    border-radius: 8px;
}

.wc-helpdesk-ticket-meta .meta-item {
    font-size: 14px;
}

.wc-helpdesk-ticket-meta .meta-label {
    color: var(--wc-hd-gray);
    margin-right: 4px;
}

.wc-helpdesk-ticket-meta .meta-value {
    color: var(--wc-hd-gray-dark);
    font-weight: 500;
}

/* Conversation */
.wc-helpdesk-conversation {
    margin-bottom: 24px;
}

.wc-helpdesk-message {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.wc-helpdesk-message-customer {
    background: var(--wc-hd-secondary);
    border: 1px solid var(--wc-hd-lighter);
}

.wc-helpdesk-message-agent {
    background: linear-gradient(135deg, rgba(173, 113, 224, 0.08), rgba(137, 101, 224, 0.08));
    border: 1px solid rgba(173, 113, 224, 0.2);
}

.wc-helpdesk-message .message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.wc-helpdesk-message .message-author {
    font-weight: 600;
    color: var(--wc-hd-gray-dark);
}

.wc-helpdesk-message .author-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: var(--wc-hd-primary);
    color: var(--wc-hd-white);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.wc-helpdesk-message .message-date {
    font-size: 13px;
    color: var(--wc-hd-gray);
}

.wc-helpdesk-message .message-content {
    color: var(--wc-hd-dark);
    line-height: 1.7;
}

.wc-helpdesk-message .message-content p {
    margin: 0 0 12px 0;
}

.wc-helpdesk-message .message-content p:last-child {
    margin-bottom: 0;
}

/* Message Attachments */
.wc-helpdesk-message .message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.wc-helpdesk-message .attachment-thumb {
    display: block;
}

.wc-helpdesk-message .attachment-thumb img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
    border: 1px solid var(--wc-hd-lighter);
    object-fit: cover;
    transition: transform 0.2s;
}

.wc-helpdesk-message .attachment-thumb:hover img {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(50, 50, 93, 0.15);
}

/* Reply Form */
.wc-helpdesk-reply-form {
    background: var(--wc-hd-white);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--wc-hd-lighter);
}

.wc-helpdesk-reply-form h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--wc-hd-gray-dark);
}

.wc-helpdesk-reply-form .form-field {
    margin-bottom: 20px;
}

.wc-helpdesk-reply-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--wc-hd-gray-dark);
}

.wc-helpdesk-reply-form textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--wc-hd-light);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wc-helpdesk-reply-form textarea:focus {
    outline: none;
    border-color: var(--wc-hd-primary);
    box-shadow: 0 0 0 3px rgba(173, 113, 224, 0.15);
}

.wc-helpdesk-reply-form input[type="file"] {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.wc-helpdesk-reply-form .form-actions {
    display: flex;
    gap: 12px;
}

/* Ticket Closed Notice */
.wc-helpdesk-ticket-closed {
    text-align: center;
    padding: 24px;
    background: var(--wc-hd-secondary);
    border-radius: 12px;
}

.wc-helpdesk-ticket-closed p {
    margin: 0 0 16px 0;
    color: var(--wc-hd-gray);
}

/* New Ticket Form */
.wc-helpdesk-new-ticket h2 {
    margin: 0 0 24px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--wc-hd-gray-dark);
}

.wc-helpdesk-new-ticket .form-field {
    margin-bottom: 24px;
}

.wc-helpdesk-new-ticket label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--wc-hd-gray-dark);
}

.wc-helpdesk-new-ticket label .required {
    color: var(--wc-hd-red);
}

.wc-helpdesk-new-ticket select,
.wc-helpdesk-new-ticket input[type="text"],
.wc-helpdesk-new-ticket textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--wc-hd-light);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wc-helpdesk-new-ticket select:focus,
.wc-helpdesk-new-ticket input[type="text"]:focus,
.wc-helpdesk-new-ticket textarea:focus {
    outline: none;
    border-color: var(--wc-hd-primary);
    box-shadow: 0 0 0 3px rgba(173, 113, 224, 0.15);
}

.wc-helpdesk-new-ticket textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.6;
}

.wc-helpdesk-new-ticket .form-description {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: var(--wc-hd-gray);
}

.wc-helpdesk-new-ticket .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* Notices */
.wc-helpdesk-notices {
    margin-bottom: 20px;
}

.wc-helpdesk-notices .notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.wc-helpdesk-notices .notice-success {
    background: rgba(0, 242, 195, 0.15);
    color: #00a67d;
    border: 1px solid rgba(0, 242, 195, 0.3);
}

.wc-helpdesk-notices .notice-error {
    background: rgba(245, 54, 92, 0.15);
    color: var(--wc-hd-red);
    border: 1px solid rgba(245, 54, 92, 0.3);
}

/* No Purchases */
.wc-helpdesk-no-purchases {
    text-align: center;
    padding: 60px 20px;
}

.wc-helpdesk-no-purchases .notice-icon {
    color: var(--wc-hd-gray);
    margin-bottom: 20px;
}

.wc-helpdesk-no-purchases h2 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--wc-hd-gray-dark);
}

.wc-helpdesk-no-purchases p {
    color: var(--wc-hd-gray);
    margin-bottom: 24px;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-helpdesk-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .wc-helpdesk-ticket-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .wc-helpdesk-ticket-item .ticket-action {
        margin-left: 0;
        width: 100%;
    }

    .wc-helpdesk-ticket-item .ticket-action .wc-helpdesk-btn {
        width: 100%;
    }

    .wc-helpdesk-ticket-meta {
        flex-direction: column;
        gap: 12px;
    }

    .wc-helpdesk-new-ticket .form-actions {
        flex-direction: column;
    }

    .wc-helpdesk-new-ticket .form-actions .wc-helpdesk-btn {
        width: 100%;
    }
}
