/* ==========================================================================
   HavenCraft — 24/7 Support Desk Stylesheet (/support/)
   Dedicated styles for Ticket Creation Wizard, Chat Engine & Deflection FAQs
   ========================================================================== */

/* --- 1. Page Header & Hero Section --- */
.page-header {
    padding-top: calc(var(--nav-height) + 50px);
    padding-bottom: 30px;
    text-align: center;
}

.page-header h1 {
    font-size: 2.8rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 4s linear infinite;
}

@keyframes shimmerText {
    to { background-position: 200% center; }
}

@media (max-width: 640px) {
    .page-header h1 {
        font-size: 2.1rem;
    }
}

.support-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(0, 200, 150, 0.12);
    border: 1px solid rgba(0, 200, 150, 0.3);
    border-radius: var(--radius-full);
    color: var(--primary);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.support-sla-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 24px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.sla-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.sla-item strong {
    color: var(--text);
}

.sla-dot.online {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #00e676;
    box-shadow: 0 0 8px #00e676;
    animation: slaPulse 2s ease-in-out infinite;
}

@keyframes slaPulse {
    0%, 100% { box-shadow: 0 0 8px #00e676; }
    50% { box-shadow: 0 0 20px #00e676, 0 0 40px rgba(0, 230, 118, 0.3); }
}

/* --- 2. FAQ & Self-Service Deflection Cards --- */
.support-deflection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 32px;
    margin-bottom: 40px;
}

@media (max-width: 860px) {
    .support-deflection-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .support-deflection-grid {
        grid-template-columns: 1fr;
    }
}

.support-faq-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: left;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.support-faq-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%,
                rgba(0, 200, 150, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
}

.support-faq-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 200, 150, 0.12);
}

.support-faq-card:hover::before {
    opacity: 1;
}

.support-faq-card h4 {
    margin: 0 0 8px 0;
    font-size: 0.98rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.support-faq-card p {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.deflection-notice {
    background: rgba(0, 200, 150, 0.08);
    border: 1px solid rgba(0, 200, 150, 0.3);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    display: none;
    align-items: flex-start;
    gap: 12px;
    animation: fadeIn 0.25s ease;
}

.deflection-notice i {
    color: var(--primary);
    font-size: 1.2rem;
    margin-top: 3px;
    flex-shrink: 0;
}

.deflection-notice-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.deflection-notice-text strong {
    color: #fff;
}

/* --- 3. Main Support Wrapper & Container Card --- */
.support-wrapper {
    max-width: 860px;
    margin: 0 auto;
    padding-bottom: 60px;
}

.support-container-card {
    background: var(--surface);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 30px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4);
    transition: all var(--transition);
}

@media (max-width: 640px) {
    .support-container-card {
        padding: 24px 18px;
    }
}

.dynamic-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .dynamic-field-row {
        grid-template-columns: 1fr;
    }
}

/* --- 4. Interactive Ticket Creation Wizard --- */
.wizard-5col-grid,
.wizard-category-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    width: 100%;
}

@media (max-width: 860px) and (min-width: 601px) {
    .wizard-5col-grid,
    .wizard-category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
    .wizard-5col-grid .wizard-category-card:last-child,
    .wizard-category-grid .wizard-category-card:last-child {
        grid-column: 2 / span 1;
    }
}

@media (max-width: 600px) {
    .wizard-5col-grid,
    .wizard-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .wizard-5col-grid .wizard-category-card:last-child:nth-child(odd),
    .wizard-category-grid .wizard-category-card:last-child:nth-child(odd) {
        grid-column: span 2;
        max-width: 280px;
        margin: 0 auto;
        width: 100%;
    }
}

.wizard-category-card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 10px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    user-select: none;
}

.wizard-category-card:hover {
    border-color: rgba(0, 200, 150, 0.5);
    background: var(--surface-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.wizard-category-card.active {
    border-color: var(--primary);
    background: rgba(0, 200, 150, 0.12);
    box-shadow: 0 0 20px rgba(0, 200, 150, 0.28);
}

.wizard-category-card i {
    font-size: 1.65rem;
    color: var(--primary);
    transition: transform 0.25s ease;
}

.wizard-category-card:hover i {
    transform: scale(1.1);
}

.wizard-category-card strong {
    font-size: 0.90rem;
    font-weight: 700;
    color: var(--text);
    white-space: normal;
    word-break: normal;
    line-height: 1.25;
    min-height: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.wizard-category-card span {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.35;
    text-align: center;
}

/* --- 5. Support Form Controls & Buttons --- */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(17, 21, 32, 0.85);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea,
[data-theme="light"] .form-group select {
    background: #ffffff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(0, 200, 150, 0.25);
    background: rgba(22, 27, 42, 0.95);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.55;
}

.form-group select {
    cursor: pointer;
}

.form-submit-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 22px rgba(0, 200, 150, 0.35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.form-submit-btn::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    filter: blur(14px);
    transition: opacity 0.3s;
}

.form-submit-btn:hover::after {
    opacity: 0.55;
}

.form-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 200, 150, 0.5);
    color: #ffffff;
}

.form-submit-btn:active {
    transform: translateY(0);
}

.form-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.lookup-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 22px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
    font-family: var(--font-body);
    text-decoration: none;
}

.lookup-toggle-btn:hover {
    background: rgba(0, 200, 150, 0.12);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 200, 150, 0.2);
    color: #ffffff;
}

/* --- 6. Live Ticket Chat Room & Messenger UI --- */
/* --- Support Chat Mode (Unified Single-Border Architecture) --- */
.support-container-card.chat-mode {
    padding: 0;
    max-width: 960px;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    transition: all 0.3s ease;
}

.support-container-card.chat-mode .ticket-chat-card {
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 24px 28px;
}

@media (max-width: 640px) {
    .support-container-card.chat-mode .ticket-chat-card {
        padding: 16px 14px;
    }
}

.ticket-chat-card {
    background: var(--surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    text-align: left;
    animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.ticket-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}

.ticket-agent-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ticket-agent-avatar-wrap {
    position: relative;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
}

.ticket-agent-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: 0 0 14px rgba(0, 200, 150, 0.35);
}

.ticket-agent-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #00e676;
    border: 2px solid var(--bg);
    box-shadow: 0 0 8px #00e676;
}

.ticket-title-area h3 {
    font-size: 1.3rem;
    margin: 0;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticket-meta-subtitle {
    font-size: 0.86rem;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ticket-badge {
    background: rgba(0, 200, 150, 0.12);
    color: var(--primary);
    border: 1px solid rgba(0, 200, 150, 0.3);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.ticket-badge.closed {
    background: rgba(255, 75, 75, 0.15);
    color: #ff5252;
    border-color: rgba(255, 75, 75, 0.3);
}

.ticket-messages-box {
    height: 520px;
    min-height: 440px;
    overflow-y: auto;
    padding: 18px 16px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
    scroll-behavior: smooth;
}

.ticket-messages-box::-webkit-scrollbar {
    width: 6px;
}

.ticket-messages-box::-webkit-scrollbar-track {
    background: transparent;
}

.ticket-messages-box::-webkit-scrollbar-thumb {
    background: rgba(0, 200, 150, 0.25);
    border-radius: 99px;
}

.ticket-messages-box::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.chat-msg {
    max-width: 75%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.55;
    position: relative;
    word-break: break-word;
    animation: fadeInUp 0.25s ease;
}

.chat-msg.player {
    align-self: flex-end;
    background: linear-gradient(135deg, #00c896 0%, #00a87d 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 18px rgba(0, 200, 150, 0.22),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.chat-msg.staff {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.chat-msg.system {
    align-self: center;
    max-width: 85%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
    border-radius: var(--radius-full);
    padding: 6px 16px;
    border: 1px solid var(--border);
}

.chat-sender {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
}

.chat-sender.staff-label {
    color: var(--primary);
}

.chat-msg.player .chat-sender {
    color: rgba(255, 255, 255, 0.92);
}

.chat-time {
    font-size: 0.72rem;
    opacity: 0.75;
    margin-top: 6px;
    text-align: right;
}

.ticket-input-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 10px 14px;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.ticket-input-area:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 24px rgba(0, 200, 150, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.ticket-input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
}

.ticket-input-area textarea {
    flex: 1;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.96rem;
    line-height: 1.5;
    resize: none;
    height: 42px;
    min-height: 42px;
    max-height: 180px;
    outline: none;
    overflow-y: hidden;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 200, 150, 0.4) transparent;
}

.ticket-input-area textarea::-webkit-scrollbar {
    width: 5px;
}

.ticket-input-area textarea::-webkit-scrollbar-track {
    background: transparent;
}

.ticket-input-area textarea::-webkit-scrollbar-thumb {
    background: rgba(0, 200, 150, 0.35);
    border-radius: 99px;
}

.ticket-input-area textarea::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.ticket-attach-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    flex-shrink: 0;
    margin-bottom: 2px;
}

.ticket-attach-btn:hover {
    color: var(--primary);
    background: rgba(0, 200, 150, 0.12);
    border-color: var(--primary);
}

.ticket-send-btn {
    height: 38px;
    padding: 0 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.94rem;
    box-shadow: 0 4px 14px rgba(0, 200, 150, 0.3);
    flex-shrink: 0;
    margin-bottom: 2px;
}

.ticket-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 200, 150, 0.45);
}

/* --- Attachment Staging & Upload UI --- */
.ticket-attachment-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: rgba(0, 200, 150, 0.08);
    border: 1px solid rgba(0, 200, 150, 0.25);
    border-radius: 12px;
    animation: fadeIn 0.2s ease;
}

.attach-thumb-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.attach-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attach-remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    color: #ff5252;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    transition: background 0.15s, transform 0.15s;
}

.attach-remove-btn:hover {
    background: #ff5252;
    color: #fff;
    transform: scale(1.1);
}

.attach-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.attach-filename {
    font-size: 0.82rem;
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attach-filesize {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.ticket-attach-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: var(--primary);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.ticket-attach-btn:hover,
.ticket-attach-btn:active {
    background: rgba(0, 200, 150, 0.15);
    border-color: rgba(0, 200, 150, 0.35);
    color: #ffffff;
    transform: scale(1.04);
}

.ticket-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.chat-custom-emoji {
    width: 24px;
    height: 24px;
    vertical-align: -5px;
    display: inline-block;
    object-fit: contain;
    margin: 0 2px;
}

.chat-media-attachment {
    display: block;
    max-width: 100%;
    max-height: 240px;
    border-radius: 10px;
    margin-top: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease;
}

.chat-media-attachment:hover {
    transform: scale(1.02);
}

/* --- 7. CSAT Star Rating Box --- */
.csat-rating-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    margin-top: 14px;
}

.csat-stars {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    font-size: 1.6rem;
    cursor: pointer;
}

.csat-star {
    color: var(--text-muted);
    transition: transform 0.15s, color 0.15s;
}

.csat-star:hover,
.csat-star.active {
    color: #ffd600;
    transform: scale(1.15);
}
