/**
 * ThunderOT Wiki - Component Styles
 * Reusable UI components for the wiki
 */

/* ============================================
   1. CALLOUTS / ADMONITIONS
   ============================================ */

.callout {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--card);
}

.callout-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.125rem;
}

.callout-content {
    flex: 1;
    min-width: 0;
}

.callout-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.callout-body p:last-child {
    margin-bottom: 0;
}

/* Callout Types */
.callout-tip {
    background: var(--success-bg);
    border-color: var(--success-border);
}

.callout-tip .callout-icon {
    color: var(--success);
}

.callout-tip .callout-title {
    color: var(--success);
}

.callout-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
}

.callout-warning .callout-icon {
    color: var(--warning);
}

.callout-warning .callout-title {
    color: var(--warning);
}

.callout-danger,
.callout-important {
    background: var(--danger-bg);
    border-color: var(--danger-border);
}

.callout-danger .callout-icon,
.callout-important .callout-icon {
    color: var(--danger);
}

.callout-danger .callout-title,
.callout-important .callout-title {
    color: var(--danger);
}

.callout-info,
.callout-note {
    background: var(--info-bg);
    border-color: var(--info-border);
}

.callout-info .callout-icon,
.callout-note .callout-icon {
    color: var(--info);
}

.callout-info .callout-title,
.callout-note .callout-title {
    color: var(--info);
}

.callout-example {
    background: rgba(109, 94, 248, 0.1);
    border-color: rgba(109, 94, 248, 0.3);
}

.callout-example .callout-icon {
    color: var(--accent);
}

.callout-example .callout-title {
    color: var(--accent);
}

/* ============================================
   2. BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--muted);
    white-space: nowrap;
}

.badge svg {
    width: 12px;
    height: 12px;
}

/* Badge variants */
.badge-level {
    background: rgba(109, 94, 248, 0.15);
    border-color: rgba(109, 94, 248, 0.3);
    color: var(--accent);
}

.badge-vip {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(239, 68, 68, 0.2) 100%);
    border-color: rgba(245, 158, 11, 0.4);
    color: var(--warning);
}

.badge-token {
    background: rgba(34, 211, 238, 0.15);
    border-color: rgba(34, 211, 238, 0.3);
    color: var(--accent-2);
}

.badge-time {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.badge-cooldown {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.badge-new {
    background: var(--gradient-arcane);
    border: none;
    color: white;
}

/* Badge group */
.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

/* ============================================
   3. CARDS - GAMER STYLE
   ============================================ */

.card {
    background: linear-gradient(145deg, rgba(20, 30, 50, 0.8) 0%, rgba(10, 18, 30, 0.6) 100%);
    border: 1px solid rgba(100, 140, 200, 0.15);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.5), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.card:hover {
    background: linear-gradient(145deg, rgba(30, 45, 70, 0.9) 0%, rgba(20, 30, 50, 0.8) 100%);
    border-color: rgba(124, 58, 237, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(124, 58, 237, 0.15);
}

.card:hover::before {
    opacity: 1;
}

.card-link {
    text-decoration: none;
    display: block;
}

.card-link:hover {
    text-decoration: none;
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3) 0%, rgba(6, 182, 212, 0.2) 100%);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.card-description {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--muted-2);
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

/* Feature Cards - Enhanced Gamer Style */
.feature-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(145deg, rgba(20, 30, 50, 0.7) 0%, rgba(10, 18, 30, 0.5) 100%);
    border: 1px solid rgba(100, 140, 200, 0.12);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.feature-card:hover {
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--radius-md);
    color: var(--accent);
    font-size: 1.5rem;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.2);
}

.feature-content {
    flex: 1;
}

.feature-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.feature-description {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0;
}

/* ============================================
   4. TABLES
   ============================================ */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead {
    background: var(--bg-2);
    position: sticky;
    top: 0;
}

th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-heading);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--card);
}

/* Table with filter */
.table-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
}

.table-filter-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.875rem;
}

.table-filter-input::placeholder {
    color: var(--muted-2);
}

.table-filter-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ============================================
   5. ACCORDION / FAQ
   ============================================ */

.accordion {
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--border);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-2);
    border: none;
    text-align: left;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.accordion-trigger:hover {
    background: var(--card-hover);
}

.accordion-trigger[aria-expanded="true"] {
    background: var(--card);
}

.accordion-trigger .chevron {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--muted);
    transition: transform var(--transition-fast);
}

.accordion-trigger[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 1rem 1.25rem;
    background: var(--bg);
    font-size: 0.875rem;
    color: var(--muted);
}

.accordion-content.open {
    display: block;
}

.accordion-content p:last-child {
    margin-bottom: 0;
}

/* ============================================
   6. CODE BLOCKS WITH COPY
   ============================================ */

.code-block {
    position: relative;
    margin: 1rem 0;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.code-lang {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
}

.code-copy {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.code-copy:hover {
    background: var(--card-hover);
    color: var(--text);
}

.code-copy.copied {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

.code-copy svg {
    width: 14px;
    height: 14px;
}

.code-block pre {
    margin: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.code-block:not(:has(.code-header)) pre {
    border-radius: var(--radius-md);
}

/* Command inline with copy */
.command {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.command-text {
    color: var(--accent-2);
}

.command-copy {
    padding: 0.25rem;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.command-copy:hover {
    color: var(--text);
    background: var(--card);
}

/* ============================================
   7. STEPS / NUMBERED LIST
   ============================================ */

.steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.step {
    position: relative;
    padding-left: 3rem;
    padding-bottom: 1.5rem;
    counter-increment: step;
}

.step:last-child {
    padding-bottom: 0;
}

.step::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-arcane);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.step::after {
    content: '';
    position: absolute;
    left: calc(1rem - 1px);
    top: 2rem;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.step:last-child::after {
    display: none;
}

.step-title {
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.step-content {
    color: var(--muted);
    font-size: 0.9375rem;
}

.step-content p:last-child {
    margin-bottom: 0;
}

/* ============================================
   8. HERO SECTION
   ============================================ */

.page-hero {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.page-hero h1 {
    margin-bottom: 0.75rem;
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--muted);
    margin-bottom: 1rem;
    max-width: 600px;
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ============================================
   9. RELATED CONTENT
   ============================================ */

.related-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.related-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 1rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.related-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.related-card:hover {
    background: var(--card-hover);
    border-color: var(--accent);
    text-decoration: none;
}

.related-card-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.related-card-title {
    font-weight: 500;
    color: var(--text);
    font-size: 0.9375rem;
}

/* ============================================
   10. IMAGES & MEDIA
   ============================================ */

.wiki-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.image-caption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

/* ============================================
   11. TAGS / CHIPS
   ============================================ */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--muted);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.tag:hover {
    background: var(--card-hover);
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.tag.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

/* ============================================
   12. LOADING STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg,
            var(--card) 25%,
            var(--card-hover) 50%,
            var(--card) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

/* ============================================
   13. TOOLTIP
   ============================================ */

.tooltip-trigger {
    position: relative;
    cursor: help;
    border-bottom: 1px dashed var(--border);
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--text);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border);
}

.tooltip-trigger:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* ============================================
   14. PROGRESS
   ============================================ */

.progress {
    width: 100%;
    height: 8px;
    background: var(--card);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-arcane);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

/* ============================================
   15. CHECKLIST
   ============================================ */

.checklist {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    background: var(--card);
    border: 1px solid var(--border);
}

.checklist-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.125rem;
}

.checklist-item.done .checklist-icon {
    color: var(--success);
}

.checklist-item.pending .checklist-icon {
    color: var(--muted-2);
}

.checklist-text {
    flex: 1;
    font-size: 0.9375rem;
}

.checklist-item.done .checklist-text {
    color: var(--muted);
    text-decoration: line-through;
}

/* ============================================
   16. NPC / ITEM DISPLAY
   ============================================ */

.npc-card {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
}

.npc-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    background: var(--bg-2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.npc-info {
    flex: 1;
}

.npc-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.25rem;
}

.npc-role {
    font-size: 0.875rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.npc-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted);
}

/* Item row in tables */
.item-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-icon {
    width: 32px;
    height: 32px;
    background: var(--card);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-name {
    font-weight: 500;
    color: var(--text);
}

.item-price {
    color: var(--accent-2);
    font-weight: 500;
}

/* ============================================
   17. STATS / METRICS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* ============================================
   18. MOBILE TOC
   ============================================ */

.mobile-toc {
    display: none;
    margin: 1rem 0;
}

.mobile-toc-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}

.mobile-toc-content {
    display: none;
    padding: 1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.mobile-toc.open .mobile-toc-content {
    display: block;
}

@media (max-width: 1280px) {
    .mobile-toc {
        display: block;
    }
}

/* ============================================
   19. PRICING / STORE CARDS
   ============================================ */

.price-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-fast);
}

.price-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.price-card.featured {
    border-color: var(--accent);
    position: relative;
}

.price-card.featured::before {
    content: 'Popular';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.75rem;
    background: var(--gradient-arcane);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.price-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.price-value {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-arcane);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.price-value small {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--muted);
    -webkit-text-fill-color: initial;
}

.price-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    text-align: left;
}

.price-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

.price-features li:last-child {
    border-bottom: none;
}

.price-features li svg {
    width: 16px;
    height: 16px;
    color: var(--success);
    flex-shrink: 0;
}