/* ==========================================================================
   Wiki Dark Theme Stylesheet with Transparent Red Accent
   ========================================================================== */

/* --- Variables & Theme Settings --- */
:root {
    --bg-dark: #0a0a0c;
    --bg-card: #121216;
    --bg-card-hover: #1a1a22;
    --text-primary: #ffffff;
    --text-secondary: #b0b0bc;
    --text-muted: #6e6e7e;
    
    /* Transparent Red Accents */
    --red-glow: rgba(239, 35, 60, 0.25);
    --red-glow-strong: rgba(239, 35, 60, 0.45);
    --red-border: rgba(239, 35, 60, 0.35);
    --red-solid: #ef233c;
    --red-dark-bg: rgba(239, 35, 60, 0.08);

    --border-color: rgba(255, 255, 255, 0.08);
    --radius: 8px;
    --transition: all 0.3s ease;
}

/* --- Global Reset & Fonts --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--red-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--red-solid);
}

/* --- Header Bar --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    background: rgba(10, 10, 12, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--red-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
}

.logo-icon {
    color: var(--red-solid);
    text-shadow: 0 0 10px var(--red-glow-strong);
}

.highlight {
    color: var(--red-solid);
    margin-right: 4px;
}

/* Search Box */
.search-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--red-border);
    border-radius: 20px;
    padding: 4px 15px;
    width: 380px;
    transition: var(--transition);
}

.search-wrapper:focus-within {
    border-color: var(--red-solid);
    box-shadow: 0 0 15px var(--red-glow);
}

.search-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    padding: 6px;
    font-family: inherit;
}

.search-wrapper button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
}

/* Top Nav */
.top-nav {
    display: flex;
    gap: 20px;
}

.top-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    padding: 6px 12px;
    border-radius: 6px;
}

.top-nav a:hover, .top-nav a.active {
    color: var(--text-primary);
    background: var(--red-dark-bg);
    border: 1px solid var(--red-border);
}

/* --- Layout Container --- */
.wiki-container {
    display: flex;
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
    gap: 30px;
}

/* --- Sidebar --- */
.wiki-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-block {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
}

.sidebar-block h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--red-border);
    padding-bottom: 8px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.side-link {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: var(--transition);
    border-right: 3px solid transparent;
}

.side-link:hover, .side-link.active {
    background: var(--red-dark-bg);
    color: var(--text-primary);
    border-right-color: var(--red-solid);
    box-shadow: -5px 0 15px var(--red-glow);
}

.stats-card {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--red-solid);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.info-box {
    background: var(--red-dark-bg);
    border: 1px solid var(--red-border);
}

.info-box h4 {
    color: var(--red-solid);
    margin-bottom: 6px;
}

.info-box p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --- Content Area --- */
.wiki-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Hero Section */
.hero-banner {
    background: linear-gradient(135deg, rgba(18, 18, 22, 0.9), rgba(30, 10, 15, 0.8)),
                radial-gradient(circle at top right, var(--red-glow), transparent 60%);
    border: 1px solid var(--red-border);
    border-radius: var(--radius);
    padding: 35px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero-tag {
    display: inline-block;
    background: var(--red-solid);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.hero-banner h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.hero-banner p {
    color: var(--text-secondary);
    max-width: 700px;
    margin-bottom: 20px;
}

.hero-actions {
    display: flex;
    gap: 15px;
}

/* Buttons */
.btn-primary {
    background: var(--red-solid);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--red-glow);
    transition: var(--transition);
}

.btn-primary:hover {
    background: #d90429;
    box-shadow: 0 6px 20px var(--red-glow-strong);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--red-border);
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--red-dark-bg);
    border-color: var(--red-solid);
}

/* Wiki Articles */
.wiki-article {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 25px;
    transition: var(--transition);
}

.wiki-article:hover {
    border-color: var(--red-border);
    box-shadow: 0 5px 20px rgba(239, 35, 60, 0.05);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.article-header h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.article-body p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.red-text {
    color: var(--red-solid);
}

.callout-red {
    background: var(--red-dark-bg);
    border-right: 4px solid var(--red-solid);
    padding: 15px;
    border-radius: 4px 0 0 4px;
    color: var(--text-primary);
    margin: 15px 0;
}

/* Wiki Table */
.wiki-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.wiki-table th, .wiki-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.wiki-table th {
    background: rgba(239, 35, 60, 0.1);
    color: var(--text-primary);
}

.wiki-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.status-high {
    color: #ff4d6d;
    font-weight: bold;
}
.status-med {
    color: #ffb703;
}

/* Code Box */
.code-block {
    background: #050507;
    border: 1px solid var(--red-border);
    border-radius: 6px;
    overflow: hidden;
    margin: 15px 0;
}

.code-header {
    display: flex;
    justify-content: space-between;
    background: rgba(239, 35, 60, 0.15);
    padding: 8px 15px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.code-header button {
    background: transparent;
    border: 1px solid var(--red-border);
    color: var(--text-primary);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.code-header button:hover {
    background: var(--red-solid);
}

.code-block pre {
    padding: 15px;
    color: #00f5d4;
    font-family: monospace;
    overflow-x: auto;
}

/* Accordions */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
}

.accordion-btn {
    width: 100%;
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border: none;
    padding: 15px;
    text-align: right;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.accordion-btn:hover {
    background: var(--red-dark-bg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 15px;
    background: rgba(0, 0, 0, 0.2);
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 200px;
    padding: 15px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--red-border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    padding: 25px;
    box-shadow: 0 10px 30px var(--red-glow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}
.close-btn:hover { color: var(--red-solid); }

.modal-body label {
    display: block;
    margin: 10px 0 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-body input, .modal-body select, .modal-body textarea {
    width: 100%;
    background: #0a0a0c;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
}

.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus {
    border-color: var(--red-solid);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 50px;
    background: #050507;
}

.footer-sub {
    font-size: 0.8rem;
    margin-top: 5px;
    color: #4a4a5a;
}

/* Responsive Design */
@media (max-width: 900px) {
    .wiki-container {
        flex-direction: column;
    }
    .wiki-sidebar {
        width: 100%;
    }
    .main-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    .search-wrapper {
        width: 100%;
    }
}
