/* ============================================================
   TICKETS.CSS — Shared styles for Support & Track Ticket pages
   ============================================================ */

/* ----- Support Form ----- */
.ticket-form-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 120px;
}

/* Hero */
.form-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}
.form-hero-icon {
    width: 64px; height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary), #1565c0);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; color: #fff;
}
.form-hero h1 {
    font-size: 1.8rem; font-weight: 700; color: var(--text);
    margin: 0 0 0.4rem;
}
.form-hero p {
    color: var(--text-light); font-size: 0.95rem; margin: 0;
}

/* Form card */
.ticket-form {
    background: var(--darker);
    border-radius: 14px;
    padding: 2.25rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.25);
}

/* Row layout */
.form-row {
    display: flex;
    gap: 1rem;
}
.form-row .field { flex: 1; }

/* Fields */
.ticket-form .field {
    margin-bottom: 1.4rem;
}
.ticket-form .label {
    display: block;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}
.ticket-form .label.required::after {
    content: " *";
    color: #e74c3c;
}
.label-hint {
    font-weight: 400; color: var(--text-light); opacity: 0.6;
}

.ticket-form .input,
.ticket-form .select select,
.ticket-form .textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.ticket-form .input:focus,
.ticket-form .select select:focus,
.ticket-form .textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.12);
}
.ticket-form .textarea {
    min-height: 110px;
    resize: vertical;
}
.ticket-form .select { position: relative; }
.ticket-form .select select {
    appearance: none;
    cursor: pointer;
}

/* Conditional fields */
.ticket-form .conditional-field {
    display: none;
}
.ticket-form .conditional-field.visible {
    display: block;
}

/* Star rating */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 2px;
}
.star-rating input { display: none; }
.star-rating label {
    cursor: pointer;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.15);
    transition: color 0.15s;
}
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #f59e0b;
}

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, var(--primary), #1565c0);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    margin-top: 0.5rem;
}
.btn-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.form-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.78rem;
    color: var(--text-light);
}
.form-footer a {
    color: var(--primary);
    text-decoration: none;
}
.form-footer a:hover { text-decoration: underline; }

/* ----- Response cards ----- */
.form-response {
    margin-top: 2rem;
    border-radius: 14px;
    padding: 2rem;
    text-align: center;
    animation: fadeSlideIn 0.35s ease;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

.form-response.success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.form-response.error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.form-response .resp-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.form-response.success .resp-icon { color: #10b981; }
.form-response.error .resp-icon { color: #ef4444; }

.form-response .resp-title {
    font-size: 1.2rem; font-weight: 700; color: var(--text);
    margin-bottom: 0.4rem;
}
.form-response .resp-detail {
    font-size: 0.9rem; color: var(--text-light); line-height: 1.5;
}

/* Ticket copy row inside response */
.ticket-display {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(0,0,0,0.2); border-radius: 8px;
    padding: 0.5rem 0.7rem; margin: 0.75rem 0;
}
.ticket-display .ticket-code {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem; font-weight: 700;
    color: var(--primary); letter-spacing: 1px;
    user-select: all; cursor: pointer;
}
.ticket-display .btn-copy {
    padding: 0.3rem 0.8rem; border: none; border-radius: 6px;
    background: var(--primary); color: #fff;
    font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.ticket-display .btn-copy:hover { opacity: 0.85; }

.form-response .btn-retry {
    display: inline-block; margin-top: 1rem;
    padding: 0.55rem 1.5rem;
    border: 1px solid var(--primary); border-radius: 8px;
    background: transparent; color: var(--primary);
    font-weight: 600; cursor: pointer; font-size: 0.85rem;
}
.form-response .btn-retry:hover { background: var(--primary); color: #fff; }

.form-response .resp-link {
    display: inline-block; margin-top: 0.6rem;
    color: var(--primary); font-weight: 600; text-decoration: none;
}
.form-response .resp-link:hover { text-decoration: underline; }

/* ----- Responsive ----- */
@media (max-width: 600px) {
    .ticket-form-container { padding: 1rem; padding-top: 100px; }
    .ticket-form { padding: 1.25rem; }
    .form-row { flex-direction: column; gap: 0; }
    .form-hero h1 { font-size: 1.4rem; }
}


/* ----- Track Ticket Page ----- */
.track-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 120px;
    min-height: calc(100vh - 200px);
}

.track-hero {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, #1565c0 100%);
    border-radius: 14px;
    color: #fff;
}
.track-hero h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}
.track-hero p {
    opacity: 0.85;
    font-size: 1rem;
}

/* Search */
.track-search-card {
    background: var(--darker);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.track-search-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.track-search-row .input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 1rem;
    font-family: monospace;
    letter-spacing: 1px;
}
.track-search-row .input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}
.track-search-row .input::placeholder {
    font-family: inherit;
    letter-spacing: 0;
    color: var(--text-light);
}
.track-search-row .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}
.track-search-row .btn-primary {
    background: var(--primary);
    color: #fff;
}
.track-search-row .btn-primary:hover {
    background: var(--primary-dark, #1976d2);
}
.track-search-row .btn-ghost {
    background: transparent;
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.track-search-row .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Result card */
.ticket-result {
    background: var(--darker);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: none;
}
.ticket-result.visible {
    display: block;
}
.ticket-result h2 {
    margin-top: 0;
    margin-bottom: 1.2rem;
    color: var(--primary);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid rgba(33, 150, 243, 0.2);
    padding-bottom: 0.6rem;
}
.ticket-result .detail-row {
    display: flex;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
    line-height: 1.6;
}
.ticket-result .detail-label {
    color: var(--text-light);
    min-width: 130px;
    font-weight: 600;
}
.ticket-result .detail-value {
    color: var(--text);
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-badge.pending  { background: rgba(255,193,7,0.15);  color: #ffc107; }
.status-badge.open     { background: rgba(33,150,243,0.15); color: #2196f3; }
.status-badge.in_progress,
.status-badge.in-progress { background: rgba(156,39,176,0.15); color: #9c27b0; }
.status-badge.resolved { background: rgba(76,175,80,0.15);  color: #4caf50; }
.status-badge.closed   { background: rgba(158,158,158,0.15);color: #9e9e9e; }
.status-badge.on_hold,
.status-badge.on-hold  { background: rgba(255,152,0,0.15);  color: #ff9800; }

/* Audit trail */
.audit-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.audit-toggle {
    cursor: pointer;
    color: var(--text);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}
.audit-toggle:hover { color: var(--primary); }
.audit-toggle .arrow { transition: transform 0.3s; }
.audit-toggle.open .arrow { transform: rotate(180deg); }

.audit-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: none;
}
.audit-list.visible { display: block; }
.audit-list li {
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.4rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--primary);
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.audit-list li .audit-action {
    font-weight: 600;
    color: var(--text);
}

/* Not found state */
.ticket-not-found {
    background: rgba(244, 67, 54, 0.08);
    border: 1px solid rgba(244, 67, 54, 0.2);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    display: none;
}
.ticket-not-found.visible { display: block; }
.ticket-not-found h3 { color: #f44336; margin-top: 0; }

/* Loading / status message */
.track-status {
    text-align: center;
    padding: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}
.track-status.error { color: #f44336; }

/* ----- Responsive ----- */
@media (max-width: 600px) {
    .ticket-form-container,
    .track-container {
        padding: 1rem;
        padding-top: 100px;
    }
    .ticket-form { padding: 1.25rem; }
    .track-hero { padding: 1.5rem 1rem; }
    .track-hero h1 { font-size: 1.6rem; }
    .track-search-row { flex-direction: column; }
    .ticket-result .detail-row { flex-direction: column; }
    .ticket-result .detail-label { min-width: auto; }
}
