/* ============================================
   HavenCraft — Commands Page Styles
   Beginner Friendly Accordion Design
   ============================================ */

.commands-section {
    padding: 20px 0 100px;
    position: relative;
    z-index: 1;
}

/* Background Glow Effects */
.commands-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 200, 150, 0.05) 0%, transparent 70%);
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
}

.wiki-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Accordion Section */
.wiki-section {
    background: var(--surface);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 20px; /* Added to prevent sticking */
}

[data-theme="dark"] .wiki-section {
    background: rgba(26, 30, 46, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.wiki-section:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.1);
}

.wiki-section.active {
    background: linear-gradient(145deg, var(--surface), rgba(255, 255, 255, 0.5));
    border-color: rgba(0, 200, 150, 0.3);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .wiki-section.active {
    background: linear-gradient(145deg, rgba(26, 30, 46, 0.9), rgba(20, 24, 36, 0.95));
    border-color: rgba(0, 200, 150, 0.4);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.25);
}

/* Header */
.wiki-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 30px;
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 2;
}

.wiki-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(0, 200, 150, 0.15), rgba(79, 140, 255, 0.15));
    border: 1px solid rgba(0, 200, 150, 0.25);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--primary);
    flex-shrink: 0;
    transition: all var(--transition);
}

.wiki-section.active .wiki-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 200, 150, 0.4);
}

.wiki-title {
    flex: 1;
}

.wiki-title h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 4px 0;
}

.wiki-title p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

.wiki-arrow {
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wiki-section.active .wiki-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

/* Content Area */
.wiki-content {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease-in-out;
}

.wiki-section.active .wiki-content {
    max-height: 2000px; /* Arbitrary large number for CSS transition */
    opacity: 1;
    visibility: visible;
}

.wiki-content-inner {
    padding: 0 30px 30px 30px;
    border-top: 1px solid rgba(150, 150, 150, 0.1);
    margin-top: 10px;
    padding-top: 24px;
}

/* Command Items Grid */
.cmd-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.cmd-item {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 14px;
    padding: 20px;
    border-left: 4px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

[data-theme="dark"] .cmd-item {
    background: rgba(0, 0, 0, 0.25);
    border-left-color: rgba(255, 255, 255, 0.1);
}

.cmd-item:hover {
    background: rgba(0, 200, 150, 0.05);
    border-left-color: var(--primary);
    transform: translateX(4px);
}

.cmd-syntax {
    font-family: 'JetBrains Mono', monospace, Consolas;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

[data-theme="dark"] .cmd-syntax {
    color: #00e0a8;
}

.cmd-syntax::before {
    content: '>';
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 900;
    opacity: 0.5;
}

.cmd-alias {
    background: rgba(0, 0, 0, 0.06);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

[data-theme="dark"] .cmd-alias {
    background: rgba(255, 255, 255, 0.06);
}

.cmd-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Helper Text */
.wiki-intro {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 40px;
    color: var(--text-muted);
}

/* Language Toggle */
.lang-toggle-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}
.lang-toggle {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 30px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
[data-theme='light'] .lang-toggle {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}
.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
    font-family: var(--font-body);
}
.lang-btn.active {
    color: #fff;
}
.lang-slider {
    position: absolute;
    top: 6px;
    left: 6px;
    width: calc(50% - 6px);
    height: calc(100% - 12px);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 24px;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 0;
    box-shadow: 0 4px 10px rgba(0, 200, 150, 0.3);
}
