/**
 * Frontend Styles for Ticket Customer Plugin
 */

/* Ticket List */
.tc-tickets-list {
    margin: 20px 0;
}

.tc-ticket-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: box-shadow 0.3s ease;
}

.tc-ticket-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tc-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.tc-ticket-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
}

.tc-ticket-title a {
    color: #0073aa;
    text-decoration: none;
}

.tc-ticket-title a:hover {
    text-decoration: underline;
}

.tc-ticket-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.tc-ticket-meta span {
    display: inline-flex;
    align-items: center;
}

.tc-ticket-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Status Badges */
.tc-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.tc-status-badge.tc-status-open {
    background: #e3f2fd;
    color: #1976d2;
}

.tc-status-badge.tc-status-answered {
    background: #e8f5e9;
    color: #388e3c;
}

.tc-status-badge.tc-status-pending {
    background: #fff8e1;
    color: #f57c00;
}

.tc-status-badge.tc-status-closed {
    background: #f5f5f5;
    color: #616161;
}

/* Priority Badges */
.tc-priority-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.tc-priority-badge.tc-priority-low {
    background: #e8f5e9;
    color: #388e3c;
}

.tc-priority-badge.tc-priority-normal {
    background: #e3f2fd;
    color: #1976d2;
}

.tc-priority-badge.tc-priority-high {
    background: #fff8e1;
    color: #f57c00;
}

.tc-priority-badge.tc-priority-urgent {
    background: #ffebee;
    color: #d32f2f;
}

/* New Ticket Form */
.tc-new-ticket-form {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.tc-new-ticket-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.tc-form-field {
    margin-bottom: 20px;
}

.tc-form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.tc-form-field input[type="text"],
.tc-form-field textarea,
.tc-form-field select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

.tc-form-field textarea {
    min-height: 150px;
    resize: vertical;
}

.tc-form-field input[type="file"] {
    padding: 8px 0;
}

.tc-form-field small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

.tc-form-actions {
    margin-top: 20px;
}

.tc-submit-btn {
    background: #0073aa;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.tc-submit-btn:hover {
    background: #005a87;
}

.tc-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Ticket Detail View */
.tc-ticket-detail {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.tc-ticket-detail h2 {
    margin-top: 0;
    color: #333;
}

.tc-ticket-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.tc-info-item {
    flex: 1;
    min-width: 150px;
}

.tc-info-item strong {
    display: block;
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
}

.tc-info-item span {
    font-size: 15px;
    color: #333;
}

.tc-ticket-content {
    padding: 20px 0;
    line-height: 1.8;
    color: #333;
}

/* Responses */
.tc-responses-section {
    margin-top: 30px;
}

.tc-responses-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.tc-response-item {
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.tc-response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tc-response-author {
    font-weight: 600;
    color: #0073aa;
}

.tc-response-author.tc-admin {
    color: #d32f2f;
}

.tc-response-date {
    color: #666;
    font-size: 14px;
}

.tc-response-content {
    line-height: 1.8;
    color: #333;
}

/* Attachments */
.tc-attachments {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.tc-attachments strong {
    display: block;
    margin-bottom: 10px;
    color: #333;
}

.tc-attachments ul {
    margin: 0;
    padding-left: 20px;
}

.tc-attachments li {
    margin-bottom: 8px;
}

.tc-attachments a {
    color: #0073aa;
    text-decoration: none;
}

.tc-attachments a:hover {
    text-decoration: underline;
}

/* New Response Form */
.tc-new-response-section {
    margin-top: 30px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
}

.tc-new-response-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

/* Empty State */
.tc-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.tc-empty-state p {
    font-size: 16px;
    color: #666;
    margin: 0 0 20px 0;
}

.tc-toggle-form-btn {
    background: #0073aa;
    color: #fff;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.tc-toggle-form-btn:hover {
    background: #005a87;
}

/* Loading State */
.tc-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Messages */
.tc-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.tc-message.tc-success {
    background: #e8f5e9;
    color: #388e3c;
    border: 1px solid #c8e6c9;
}

.tc-message.tc-error {
    background: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

/* Back Link */
.tc-back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #0073aa;
    text-decoration: none;
}

.tc-back-link:hover {
    text-decoration: underline;
}

/* New Ticket Button */
.tc-new-ticket-btn-wrapper {
    text-align: center;
    margin-top: 30px;
}

.tc-toggle-form-btn {
    background: #0073aa;
    color: #fff;
    padding: 14px 32px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.tc-toggle-form-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
}

/* Wizard Container */
.tc-new-ticket-wizard {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 0;
    margin-top: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tc-wizard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
}

.tc-wizard-header h3 {
    margin: 0;
    color: #333;
}

.tc-wizard-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease, color 0.3s ease;
}

.tc-wizard-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Progress Bar */
.tc-wizard-progress {
    padding: 30px;
    background: #fafafa;
}

.tc-progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.tc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #005a87);
    width: 33.33%;
    transition: width 0.4s ease;
    border-radius: 10px;
}

.tc-progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.tc-progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.tc-progress-step.active,
.tc-progress-step.completed {
    opacity: 1;
}

.tc-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.tc-progress-step.active .tc-step-number {
    background: #0073aa;
    color: #fff;
    transform: scale(1.1);
}

.tc-progress-step.completed .tc-step-number {
    background: #00a32a;
    color: #fff;
}

.tc-step-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.tc-progress-step.active .tc-step-label {
    color: #0073aa;
    font-weight: 600;
}

/* Wizard Steps */
.tc-wizard-step {
    display: none;
    padding: 30px;
    min-height: 300px;
}

.tc-wizard-step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tc-wizard-step h4 {
    font-size: 20px;
    margin: 0 0 25px 0;
    color: #333;
    text-align: center;
}

/* Choice Buttons */
.tc-choice-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.tc-choice-btn {
    background: #fff;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    font-size: 16px;
}

.tc-choice-btn:hover {
    border-color: #0073aa;
    background: #f8fcff;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,115,170,0.2);
}

.tc-choice-btn.selected {
    border-color: #0073aa;
    background: #e3f2fd;
    box-shadow: 0 4px 12px rgba(0,115,170,0.3);
}

.tc-choice-icon {
    font-size: 32px;
    color: #0073aa;
}

.tc-choice-text {
    font-weight: 600;
    color: #333;
}

/* Orders List */
.tc-orders-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
}

.tc-loading-orders {
    text-align: center;
    padding: 40px;
    color: #666;
}

.tc-order-item {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tc-order-item:hover {
    border-color: #0073aa;
    background: #f8fcff;
}

.tc-order-item.selected {
    border-color: #0073aa;
    background: #e3f2fd;
}

.tc-order-item input[type="radio"] {
    margin-right: 12px;
}

.tc-order-details {
    flex: 1;
}

.tc-order-number {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.tc-order-date {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.tc-order-total {
    font-weight: 600;
    color: #0073aa;
    font-size: 16px;
}

.tc-order-other {
    background: #fff8e1;
    border-color: #f57c00;
}

.tc-order-other:hover {
    background: #fff3cd;
}

/* Order Actions (Load More & Other) */
.tc-order-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.tc-load-more-btn,
.tc-other-order-btn {
    padding: 10px 24px;
    border: 2px solid #0073aa;
    border-radius: 6px;
    background: #fff;
    color: #0073aa;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tc-load-more-btn:hover,
.tc-other-order-btn:hover {
    background: #0073aa;
    color: #fff;
    transform: translateY(-2px);
}

.tc-other-order-btn {
    border-color: #f57c00;
    color: #f57c00;
}

.tc-other-order-btn:hover {
    background: #f57c00;
    color: #fff;
}

.tc-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Category Grid */
.tc-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.tc-category-box {
    background: #fff;
    border: 3px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tc-category-box:hover {
    border-color: #0073aa;
    background: #f8fcff;
    transform: translateY(-2px);
}

.tc-category-box input[type="radio"] {
    display: none;
}

.tc-category-box input[type="radio"]:checked + .tc-category-name {
    color: #0073aa;
}

.tc-category-box:has(input[type="radio"]:checked) {
    border-color: #0073aa;
    background: #e3f2fd;
}

.tc-category-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.tc-category-desc {
    font-size: 13px;
    color: #666;
}

/* Wizard Actions */
.tc-wizard-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.tc-wizard-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tc-prev-btn {
    background: #f5f5f5;
    color: #333;
}

.tc-prev-btn:hover {
    background: #e0e0e0;
}

.tc-next-btn {
    background: #0073aa;
    color: #fff;
    margin-left: auto;
}

.tc-next-btn:hover {
    background: #005a87;
}

.tc-submit-btn {
    background: #00a32a;
    color: #fff;
    margin-left: auto;
}

.tc-submit-btn:hover {
    background: #008a20;
}

.tc-wizard-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Order Badge in Ticket List */
.tc-order-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-right: 8px;
}

/* Response Status in Ticket List */
.tc-has-response,
.tc-no-response {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.tc-has-response {
    background: #e8f5e9;
    color: #388e3c;
}

.tc-no-response {
    background: #f5f5f5;
    color: #666;
}

/* Order Info in Ticket Detail */
.tc-ticket-order-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #e3f2fd;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #1976d2;
}

.tc-order-icon {
    font-size: 24px;
}

.tc-ticket-order-info span {
    color: #1976d2;
    font-size: 15px;
}

.tc-ticket-order-info strong {
    color: #0d47a1;
    font-weight: 700;
}

.tc-ticket-order-info strong a {
    color: #0d47a1;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.tc-ticket-order-info strong a:hover {
    border-bottom-color: #0d47a1;
}

/* Response Status Alert in Ticket Detail */
.tc-response-status {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 500;
    border-left: 4px solid;
}

.tc-response-status.tc-has-responses {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #43a047;
}

.tc-response-status.tc-no-responses {
    background: #fff8e1;
    color: #f57c00;
    border-color: #ffa726;
}

/* Admin Order Badge */
.tc-admin-order-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .tc-ticket-header {
        flex-direction: column;
    }

    .tc-ticket-meta {
        flex-direction: column;
        gap: 8px;
    }

    .tc-ticket-info {
        flex-direction: column;
    }

    .tc-response-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .tc-choice-buttons {
        grid-template-columns: 1fr;
    }

    .tc-category-grid {
        grid-template-columns: 1fr;
    }

    .tc-wizard-progress {
        padding: 20px 15px;
    }

    .tc-wizard-step {
        padding: 20px 15px;
    }

    .tc-wizard-header {
        padding: 20px 15px;
    }

    .tc-step-label {
        font-size: 11px;
    }

    .tc-wizard-actions {
        flex-direction: column;
    }

    .tc-next-btn,
    .tc-submit-btn {
        margin-left: 0;
    }
}
