/* ============================================
   SUPPORT STYLES (Date: 2025-11-10)
   ============================================

   Scope: Support tickets page, ticket system, ticket forms
   Related JS: supportSystem.js, supportTickets.js, renderSystem.js
   Related Pages: Support page

   BEFORE EDITING:
   - ALL support styles belong HERE (merged from supportTickets.css)
   - Shared components belong in components/
   - Theme colors belong in themes/
   - Check CLAUDE.md Section 2d for architecture

   NOTE: This file consolidates all support functionality
   - Ticket rendering (from supportTickets.css)
   - Support page layout (from styles.css)
   - Ticket forms and actions
   - Staff/internal note styling

   ============================================ */

/* ========== SUPPORT CONTAINER AND LAYOUT ========== */

/* Add padding to support tickets container to prevent cutoff */
#support-tickets-list {
    padding-top: 8px;
}

.admin-support-section {
    padding: 20px;
    background: var(--theme-text-primary);
}

.support-tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--theme-border-light);
}

.support-tickets-header h2 {
    margin: 0;
    color: var(--theme-text-primary);
}

.support-tickets-container {
    max-height: none;
    /* padding removed - inherits from .content-section */
}

.no-tickets {
    text-align: center;
    padding: 40px;
    color: var(--theme-border-light);
    font-size: 16px;
}

/* ========== TICKET RENDERING AND DISPLAY ========== */

/* Ticket background colors - using unified transparent styling */
.forum-post[data-post-id^="ticket_"] .forum-post-content {
    transition: background-color 0.3s ease;
}

/* Ticket-specific badges and styling */
.ticket-post {
    border-left: 4px solid var(--theme-btn-primary-bg);
}

.ticket-post.status-new {
    border-left-color: var(--theme-btn-success-bg);
}

.ticket-post.status-claimed {
    border-left-color: var(--theme-btn-warning-bg);
}

.ticket-post.status-responded {
    border-left-color: var(--theme-btn-primary-bg);
}

.ticket-post.status-resolved {
    border-left-color: var(--theme-text-secondary);
    opacity: 0.9;
}

.ticket-post.unread {
    background: var(--theme-text-primary) !important;
}

/* Support ticket content styling */
.support-ticket-content {
    padding: 15px;
    background: var(--theme-text-primary);
    border-radius: 8px;
    margin: 10px 0;
}

.support-ticket-content h3 {
    margin: 0 0 10px 0;
    color: var(--theme-text-primary);
    font-size: 18px;
}

.ticket-header-info {
    margin-bottom: 15px;
}

.ticket-meta-info {
    display: flex;
    gap: 20px;
    color: var(--theme-text-secondary);
    font-size: 14px;
}

.ticket-meta-info span {
    display: block;
}

.ticket-message-body {
    color: var(--theme-text-primary);
    line-height: 1.6;
}

.ticket-content {
    padding: 10px;
    background: var(--theme-text-primary);
    border-radius: 5px;
    margin-top: 10px;
}

.ticket-subject-line {
    margin-bottom: 8px;
    color: var(--theme-text-primary);
}

.ticket-phone {
    margin-bottom: 8px;
    color: var(--theme-text-secondary);
}

.ticket-message {
    color: var(--theme-text-primary);
    line-height: 1.5;
}

.ticket-email {
    color: var(--theme-text-secondary);
    font-size: 13px;
    margin-left: 5px;
}

/* Ticket icon at top of header */
.ticket-icon-top {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--theme-btn-primary-bg);
    color: var(--theme-text-on-primary);
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    z-index: 1;
}

/* Unread ticket/post/message indicator - inner red border */
.ticket-icon-top.unread {
    box-shadow: inset 0 0 0 2px var(--color-red-600);
}

/* Ensure header has relative positioning for ticket icon */
.forum-post-header {
    position: relative;
}

/* Ticket info lines styling */
.ticket-info-lines {
    padding: 0;
    line-height: 1.5;
    font-size: 14px;
}

.ticket-info-lines > div {
    margin: 0;
    color: var(--theme-text-primary);
}

.ticket-info-lines strong {
    color: var(--theme-text-primary);
    margin-right: 5px;
    font-size: 14px;
}

.ticket-message-content {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    line-height: 1.5;
    font-size: 14px;
    color: var(--theme-post-text);
}

/* ========== TICKET STATUS AND BADGES ========== */

.ticket-filters select {
    padding: 8px 12px;
    border: 1px solid var(--theme-border-light);
    border-radius: 5px;
    background: var(--theme-bg-primary);
    cursor: pointer;
}

.ticket-badge-new {
    background: var(--theme-btn-success-bg);
    color: var(--theme-text-on-primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
}

.ticket-badge-claimed {
    background: var(--theme-btn-warning-bg);
    color: var(--theme-text-primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
}

.ticket-badge-responded {
    background: var(--theme-btn-primary-bg);
    color: var(--theme-text-on-primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
}

.ticket-badge-resolved {
    background: var(--theme-text-secondary);
    color: var(--theme-text-on-primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
}

.unread-badge {
    background: var(--theme-btn-danger-bg);
    color: var(--theme-text-on-primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 8px;
}

.claimed-badge {
    background: var(--theme-btn-primary-bg);
    color: var(--theme-text-on-primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
}

/* Ticket badge on admin tab */
.ticket-badge {
    background: var(--theme-btn-danger-bg);
    color: var(--theme-text-on-primary);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 5px;
    font-weight: bold;
}

/* Priority colors */
.ticket-priority-low {
    color: var(--theme-btn-success-bg);
    font-weight: bold;
}

.ticket-priority-high {
    color: var(--theme-btn-warning-bg);
    font-weight: bold;
}

.ticket-priority-urgent {
    color: var(--theme-btn-danger-bg);
    font-weight: bold;
}

/* ========== TICKET FORMS AND INPUTS ========== */

/* Forum-style reply input */
.ticket-reply-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--theme-border-light);
    border-radius: 5px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}

.ticket-reply-input:focus {
    outline: none;
    border-color: var(--theme-btn-primary-bg);
}

/* Forum reply form */
.forum-reply-form {
    margin-top: 10px;
    padding-left: 40px;
}

.forum-replies {
    margin-top: 10px;
}

/* New ticket form styling */
.new-post-form .icon-toolbar {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--theme-text-primary);
    border-radius: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.new-post-form .toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

.new-post-form .toolbar-icon {
    padding: 5px 8px;
    background: var(--theme-bg-primary);
    border: 1px solid var(--theme-border-light);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    min-width: 30px;
    text-align: center;
    transition: background 0.2s;
}

.new-post-form .toolbar-icon:hover {
    background: var(--theme-text-primary);
}

.new-post-form .toolbar-select {
    padding: 5px 8px;
    border: 1px solid var(--theme-border-light);
    border-radius: 4px;
    background: var(--theme-bg-primary);
    cursor: pointer;
    font-size: 13px;
}

.new-post-form .ticket-subject-input {
    width: 100%;
    padding: 8px 12px;
    margin: 10px 0;
    border: 1px solid var(--theme-border-light);
    border-radius: 4px;
    font-size: 14px;
}

.new-post-form .new-post-text {
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--theme-border-light);
    border-radius: 4px;
    background: var(--theme-bg-primary);
    font-size: 14px;
    line-height: 1.5;
    outline: none;
}

.new-post-form .new-post-text:focus {
    border-color: var(--theme-btn-primary-bg);
    box-shadow: 0 0 0 2px var(--theme-focus-ring);
}

.new-post-form .new-post-text[placeholder]:empty:before {
    content: attr(placeholder);
    color: var(--theme-border-light);
    pointer-events: none;
}

.new-post-form .forum-submit-btn {
    padding: 8px 16px;
    background: var(--theme-btn-primary-bg);
    color: var(--theme-text-on-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.new-post-form .forum-submit-btn:hover {
    background: var(--theme-btn-primary-hover-bg);
}

.new-post-form .char-count {
    margin-left: 10px;
    color: var(--theme-text-secondary);
    font-size: 13px;
}

/* ========== TICKET ACTIONS (CLAIM, RESOLVE, ETC.) ========== */

.claim-btn, .unclaim-btn, .resolve-btn, .reopen-btn {
    margin-left: 10px;
}

.claim-btn:hover {
    background: var(--theme-btn-success-bg);
    color: var(--theme-text-on-primary);
}

.unclaim-btn:hover {
    background: var(--theme-btn-warning-bg);
    color: var(--theme-text-primary);
}

.resolve-btn:hover {
    background: var(--theme-btn-primary-bg);
    color: var(--theme-text-on-primary);
}

.reopen-btn:hover {
    background: var(--theme-btn-danger-bg);
    color: var(--theme-text-on-primary);
}

/* ========== STAFF REPLIES AND INTERNAL NOTES ========== */

/* Admin/Support staff colored backgrounds - REMOVED per user request */
/* All posts (messages, forum, support tickets) now have clean, uniform styling */
/* Staff members are identified by role badges instead of background colors */

/* Internal note styling - yellow background with lock icon */
.forum-post.internal-note,
.forum-reply.internal-note {
    background-color: var(--theme-badge-warning-bg) !important;
    border: 2px solid var(--theme-btn-warning-hover-bg) !important;
    box-shadow: none !important;
    position: relative;
}

/* ========== ANIMATIONS ========== */

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
