/* ============================================
   Idle Mogul Support System Styles
   (extends page-header.php base styles)
   ============================================ */

:root {
    --status-open: #3B82F6;
    --status-in-progress: #F59E0B;
    --status-waiting: #8B5CF6;
    --status-resolved: #10B981;
    --status-closed: #6B7280;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* ── Hero ─────────────────────────────── */
.support-hero {
    text-align: center;
    padding: 4rem 1.5rem 2rem;
    position: relative;
}

.support-hero h1 {
    font-family: 'Cinzel Decorative', 'Cinzel', serif;
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #FFD700 0%, #D4AF37 40%, #10B981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Search ───────────────────────────── */
.search-container {
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 48px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    transition: all 0.3s ease;
    outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
    border-color: var(--gold-main);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: var(--bg-deep);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
    z-index: 100;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.search-results.active { display: block; }

.search-result-item {
    display: block;
    padding: 14px 20px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--glass-bg); color: var(--text-primary); }
.search-result-item strong { color: var(--gold-main); }

/* ── FAQ ──────────────────────────────── */
.faq-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

.faq-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2rem;
    justify-content: center;
}

.faq-tab {
    padding: 10px 18px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.faq-tab:hover { border-color: var(--glass-border-hover); color: var(--text-primary); }
.faq-tab.active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(212, 175, 55, 0.08));
    border-color: var(--gold-main);
    color: var(--gold-main);
    font-weight: 500;
}

.faq-category { display: none; }
.faq-category.active { display: block; }

.faq-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.faq-item:hover { border-color: rgba(255, 255, 255, 0.12); }

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 400;
    font-size: 0.95rem;
    gap: 12px;
    min-height: 44px;
}
.faq-question:hover { color: var(--gold-main); }

.faq-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--text-muted);
}
.faq-item.open .faq-arrow { transform: rotate(180deg); color: var(--gold-main); }

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.faq-item.open .faq-answer { max-height: 500px; }

.faq-answer-content {
    padding: 0 20px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}
.faq-answer-content ul { padding-left: 1.2rem; margin-top: 0.5rem; }
.faq-answer-content li { margin-bottom: 0.3rem; }

.faq-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.faq-helpful { display: flex; align-items: center; gap: 8px; }

.faq-helpful-btn {
    padding: 4px 12px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    min-height: 32px;
}
.faq-helpful-btn:hover { border-color: var(--glass-border-hover); color: var(--text-primary); }
.faq-helpful-btn.voted { border-color: var(--gold-main); color: var(--gold-main); pointer-events: none; }

.faq-helpful-thanks {
    color: var(--gold-main);
    font-size: 0.8rem;
    display: none;
}

/* ── CTA Section ──────────────────────── */
.support-cta {
    max-width: 800px;
    margin: 2rem auto 0;
    padding: 0 1.5rem 3rem;
}

.cta-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
}
.cta-card h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.cta-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ──────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    min-height: 48px;
}

.btn-gold {
    background: linear-gradient(135deg, #FFD700, #D4AF37);
    color: #000;
    font-weight: 600;
}
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3);
    color: #000;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}
.btn-ghost:hover {
    border-color: var(--glass-border-hover);
    color: var(--text-primary);
}

.btn-sm { padding: 10px 20px; font-size: 0.85rem; min-height: 40px; }

/* ── Form Elements ────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.form-label .required { color: var(--gold-main); margin-left: 2px; }

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 300;
    transition: all 0.3s ease;
    outline: none;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--gold-main);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.form-input.error,
.form-select.error,
.form-textarea.error { border-color: #EF4444; }

.form-error {
    color: #EF4444;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}
.form-error.visible { display: block; }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}
.form-select option { background: #1a1a2e; color: #fff; }

.form-textarea { min-height: 140px; resize: vertical; line-height: 1.6; }

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--gold-main);
    flex-shrink: 0;
}

/* ── Wizard (multi-step form) ─────────── */
.wizard-steps {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
    position: relative;
}
.wizard-step.active { color: var(--gold-main); font-weight: 500; }
.wizard-step.completed { color: var(--emerald); }

.wizard-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}
.wizard-step.active .wizard-step-num { border-color: var(--gold-main); color: var(--gold-main); }
.wizard-step.completed .wizard-step-num {
    border-color: var(--emerald);
    background: var(--emerald);
    color: #000;
}

.wizard-connector {
    width: 40px;
    height: 2px;
    background: var(--glass-border);
    align-self: center;
}
.wizard-connector.completed { background: var(--emerald); }

.wizard-panel { display: none; }
.wizard-panel.active { display: block; }

.wizard-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    gap: 12px;
}

/* ── File Upload ──────────────────────── */
.file-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--gold-main);
    background: rgba(212, 175, 55, 0.05);
    color: var(--text-secondary);
}
.file-upload-area input { display: none; }

.file-list { margin-top: 1rem; }

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-item-remove {
    color: #EF4444;
    cursor: pointer;
    padding: 4px;
    border: none;
    background: none;
    font-size: 1rem;
}

/* ── Card Container ───────────────────── */
.support-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.support-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

/* ── Success Card ─────────────────────── */
.success-card { text-align: center; }

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
}

.success-card h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.ticket-id-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-main);
    letter-spacing: 0.1em;
    margin: 1rem 0;
    padding: 16px 24px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-md);
    display: inline-block;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}
.copy-btn:hover { border-color: var(--gold-main); color: var(--gold-main); }

/* ── Ticket View (Status page) ────────── */
.ticket-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 12px;
}

.ticket-header-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gold-main);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ticket-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.ticket-meta-item {
    font-size: 0.85rem;
}
.ticket-meta-item span {
    color: var(--text-muted);
    display: block;
    margin-bottom: 2px;
}
.ticket-meta-item strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* ── Conversation / Messages ──────────── */
.conversation { margin: 1.5rem 0; }

.message {
    margin-bottom: 1rem;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    position: relative;
}

.message-user {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    margin-right: 2rem;
}

.message-admin {
    background: rgba(212, 175, 55, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-left: 3px solid var(--gold-main);
    margin-left: 2rem;
}

.message-system {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 8px;
    background: none;
    border: none;
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.message-sender {
    font-weight: 600;
    color: var(--text-primary);
}
.message-admin .message-sender { color: var(--gold-main); }

.message-time { color: var(--text-muted); }

.message-body {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-attachments {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.message-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}
.message-attachment:hover { border-color: var(--gold-main); color: var(--gold-main); }

.message-attachment-img {
    display: block;
    max-width: 280px;
}
.message-attachment-img img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    transition: border-color 0.3s ease;
}
.message-attachment-img:hover img { border-color: var(--gold-main); }

/* ── Reply Box ────────────────────────── */
.reply-box {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.reply-box .form-textarea { min-height: 100px; }

.reply-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    gap: 12px;
}

/* ── Rating ───────────────────────────── */
.star-rating {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 1.5rem 0;
}

.star {
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    user-select: none;
}
.star:hover,
.star.active { color: var(--gold-light); transform: scale(1.1); }
.star.hovered { color: var(--gold-main); }

/* ── Contact Bar ──────────────────────── */
.contact-bar {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 0 1.5rem;
    text-align: center;
}

.contact-bar p {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.contact-bar a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

/* ── Alert / Toast ────────────────────── */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #6EE7B7;
}
.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93C5FD;
}

/* ── Cloudflare Turnstile ─────────────── */
.cf-turnstile { margin: 1rem 0; display: flex; justify-content: center; }

/* ── Responsive ───────────────────────── */
@media (min-width: 768px) {
    .support-hero { padding: 5rem 2rem 3rem; }
    .faq-section { padding: 0 2rem 2rem; }
    .support-container { padding: 3rem 2rem 5rem; }
    .support-cta { padding: 0 2rem 4rem; }
}

@media (max-width: 480px) {
    .wizard-step span { display: none; }
    .message-user { margin-right: 0; }
    .message-admin { margin-left: 0; }
    .ticket-id-display { font-size: 1.2rem; padding: 12px 16px; }
    .cta-buttons { flex-direction: column; }
}

/* ── Animations ───────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.pulse { animation: pulse 2s infinite; }
