/*
 * Ticket Page V3
 */

.page-content:has(.ticket-page-v3) nav[aria-label="breadcrumb"],
.page-content:has(.ticket-page-v3) .page-header {
    display: none;
}

.ticket-page-v3 {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.tk-header {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    border-radius: 18px;
    padding: 26px 30px;
    position: relative;
    overflow: hidden;
}

.tk-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.tk-header-content { position: relative; z-index: 1; }

.tk-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tk-title i { font-size: 20px; opacity: 0.9; }

.tk-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    margin: 0;
}

/* Grid */
.tk-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 18px;
    align-items: start;
}

/* Cards */
.tk-form-card, .tk-info-card, .tk-list-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

.tk-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.tk-card-header i { color: #f59e0b; font-size: 14px; }

.tk-card-body { padding: 20px; }

/* Form */
.tk-form-group { margin-bottom: 14px; }

.tk-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.tk-required { color: #ef4444; }

.tk-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    background: #fff;
    transition: all 0.2s ease;
    outline: none;
}

.tk-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.tk-input::placeholder { color: #9ca3af; }

.tk-textarea { resize: vertical; min-height: 100px; }

.tk-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

.tk-btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tk-btn-reset:hover { background: #f9fafb; }

.tk-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    background: #f59e0b;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.tk-btn-submit:hover {
    background: #d97706;
    transform: translateY(-1px);
}

/* Info */
.tk-info-section {
    margin-bottom: 14px;
}

.tk-info-section:last-child { margin-bottom: 0; }

.tk-info-section strong {
    font-size: 13px;
    color: #1f2937;
    display: block;
    margin-bottom: 6px;
}

.tk-info-section ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.8;
}

/* Ticket List */
.tk-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 10px;
}

.tk-list-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.tk-list-title i { color: #f59e0b; font-size: 14px; }

.tk-list-count {
    font-size: 11px;
    font-weight: 700;
    background: #fef3c7;
    color: #d97706;
    padding: 2px 8px;
    border-radius: 99px;
}

.tk-list-filter { display: flex; gap: 8px; }

.tk-filter-select {
    padding: 7px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: #fff;
    cursor: pointer;
    outline: none;
    appearance: auto;
}

/* Ticket Items */
.tk-list-body { padding: 0; }

.tk-ticket-list { display: flex; flex-direction: column; }

.tk-ticket-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f8fafc;
    text-decoration: none;
    transition: background 0.15s ease;
    gap: 12px;
}

.tk-ticket-item:last-child { border-bottom: none; }
.tk-ticket-item:hover { background: #fffbeb; }
.tk-ticket-item.tk-unread { background: #fffef5; }

.tk-ticket-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.tk-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.tk-ticket-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.tk-ticket-subject {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tk-ticket-meta {
    font-size: 12px;
    color: #9ca3af;
}

.tk-ticket-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.tk-ticket-arrow { color: #d1d5db; font-size: 12px; }

/* Status Badges */
.tk-status-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.tk-status-waiting { background: #fef3c7; color: #d97706; }
.tk-status-user-reply { background: #dbeafe; color: #2563eb; }
.tk-status-responded { background: #dcfce7; color: #16a34a; }
.tk-status-closed { background: #f3f4f6; color: #6b7280; }

/* Empty */
.tk-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 20px;
    gap: 10px;
}

.tk-empty i { font-size: 36px; color: #d1d5db; }
.tk-empty p { font-size: 14px; color: #9ca3af; margin: 0; }

/* Footer */
.tk-list-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #f3f4f6;
    background: #fafbfc;
    flex-wrap: wrap;
    gap: 10px;
}

.tk-result-info { font-size: 13px; color: #6b7280; }
.tk-result-info strong { color: #f59e0b; }

.tk-pagination .pagination {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tk-pagination .pagination li a,
.tk-pagination .pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.tk-pagination .pagination li a:hover {
    background: #fffbeb;
    border-color: #fde68a;
    color: #d97706;
}

.tk-pagination .pagination li.active span {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

/* Dark Theme */
.dark-theme .tk-form-card, .dark-theme .tk-info-card, .dark-theme .tk-list-card { background: #1e293b; border-color: #334155; }
.dark-theme .tk-card-header { border-color: #334155; color: #f1f5f9; }
.dark-theme .tk-label { color: #e2e8f0; }
.dark-theme .tk-input { background: #0f172a; border-color: #334155; color: #f1f5f9; }
.dark-theme .tk-input:focus { border-color: #f59e0b; }
.dark-theme .tk-info-section strong { color: #f1f5f9; }
.dark-theme .tk-info-section ul { color: #94a3b8; }
.dark-theme .tk-list-header { border-color: #334155; }
.dark-theme .tk-list-title { color: #f1f5f9; }
.dark-theme .tk-ticket-item { border-color: #334155; }
.dark-theme .tk-ticket-item:hover { background: #334155; }
.dark-theme .tk-ticket-subject { color: #f1f5f9; }
.dark-theme .tk-list-footer { background: #0f172a; border-color: #334155; }
.dark-theme .tk-header { background: linear-gradient(135deg, #d97706 0%, #ea580c 100%); }
.dark-theme .tk-btn-reset { background: #334155; border-color: #475569; color: #e2e8f0; }

/* Responsive */
@media (max-width: 1024px) {
    .tk-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .tk-header { padding: 22px 20px; border-radius: 14px; }
    .tk-title { font-size: 20px; }
    .tk-form-actions { flex-direction: column; }
    .tk-btn-submit, .tk-btn-reset { width: 100%; justify-content: center; }
    .tk-ticket-item { padding: 14px 16px; }
    .tk-list-header { flex-direction: column; align-items: flex-start; }
}
