/* NoPass Ticket System - Frontend Styles */

/* 表单容器 */
.nts-ticket-form-wrapper,
.nts-ticket-status-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nts-ticket-form-wrapper h3,
.nts-ticket-status-wrapper h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
}

/* 表单样式 */
.nts-form-group {
    margin-bottom: 20px;
}

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

.nts-form-group .required {
    color: #e74c3c;
}

.nts-form-group .optional {
    color: #999;
    font-weight: normal;
}

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

input[type="text"]#nts-order-id {
    min-width: 300px;
}

input[type="text"]#nts-order-id::-webkit-calendar-picker-indicator {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

input[type="text"]#nts-order-id::-webkit-list-button {
    display: none !important;
    opacity: 0 !important;
}

input[type="text"]#nts-order-id::-moz-list-button {
    display: none !important;
}

input[type="text"]#nts-order-id::-ms-clear {
    display: none !important;
}

#order-list {
    min-width: 400px;
}

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

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

/* 文件上传 */
.nts-form-group input[type="file"] {
    display: none;
}

.nts-file-upload-label {
    display: inline-block;
    padding: 10px 20px;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.nts-file-upload-label:hover {
    background: #e8e8e8;
    border-color: #375542;
    color: #375542;
}

.nts-file-upload-label::before {
    content: "� ";
    margin-right: 5px;
}

/* 附件列表 */
.nts-attachment-list {
    margin-top: 10px;
}

.nts-attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 8px;
}

.nts-attachment-item span {
    flex: 1;
    font-size: 14px;
}

.nts-attachment-item button {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.nts-attachment-item button:hover {
    background: #c0392b;
}

/* 提交按钮 */
.nts-submit-btn {
    background: #375542;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.nts-submit-btn:hover {
    background: #2a3f32;
}

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

/* 消息提示 */
.nts-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.nts-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    display: block;
}

.nts-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    display: block;
}

/* 工单详情 */
.nts-ticket-details {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.nts-ticket-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ddd;
}

.nts-ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    align-items: center;
}

.nts-ticket-meta span {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 状态徽章 */
.nts-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.nts-status-badge.status-in_progress {
    background: #cce5ff;
    color: #004085;
}

.nts-status-badge.status-completed {
    background: #d4edda;
    color: #155724;
}

/* 回复列表 */
.nts-replies {
    margin-top: 20px;
}

.nts-reply {
    margin-bottom: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 4px;
    border-left: 4px solid #ddd;
}

.nts-reply.admin-reply {
    border-left-color: #0073aa;
    background: #f0f8ff;
}

.nts-reply.user-reply {
    border-left-color: #28a745;
    background: #f0fff4;
}

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

.reply-author {
    font-weight: 600;
    color: #333;
}

.reply-date {
    color: #999;
}

.reply-content {
    line-height: 1.6;
    color: #333;
}

/* 附件链接 */
.nts-attachments {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.nts-attachment-link {
    display: inline-block;
    margin-right: 15px;
    margin-top: 5px;
    padding: 5px 10px;
    background: #f5f5f5;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    transition: background 0.3s;
}

.nts-attachment-link:hover {
    background: #e0e0e0;
}

/* WooCommerce My Account 集成 */
.nts-my-account-tickets {
    padding: 20px 0;
}

.nts-ticket-detail {
    max-width: 900px;
}

.nts-ticket-body {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.nts-ticket-main-message {
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.nts-ticket-main-message h3 {
    margin-top: 0;
    color: #333;
}

.message-content {
    line-height: 1.6;
    color: #555;
}

/* 回复表单 */
.nts-reply-form {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.nts-reply-form h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

.nts-reply-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
}

.nts-reply-form button {
    margin-top: 10px;
}

.nts-back-link {
    margin-top: 20px;
}

.nts-back-link a {
    color: #0073aa;
    text-decoration: none;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .nts-ticket-form-wrapper,
    .nts-ticket-status-wrapper {
        padding: 20px;
    }
    
    .nts-ticket-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .reply-header {
        flex-direction: column;
        gap: 5px;
    }
}

/* 加载动画 */
.nts-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 115, 170, 0.3);
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 图片灯箱 */
.nts-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nts-lightbox.active {
    background: rgba(0, 0, 0, 0.9);
    opacity: 1;
}

.nts-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    cursor: default;
}

.nts-lightbox.active img {
    transform: scale(1);
}

.nts-lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 50px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s;
}

.nts-lightbox-close:hover {
    opacity: 0.7;
}
