/**
 * @package     Joomla.Site
 * @subpackage  mod_eotgwiki_terminal
 *
 * @copyright   (C) 2025 Echoes of the Grid
 * @license     GNU General Public License version 2 or later
 */

/* Module Container */
.mod-eotgwiki-terminal {
    font-family: 'OpenDyslexic', 'VT323', monospace;
    background: #0a0a0a;
    color: #38bdf8;
}

.mod-eotgwiki-terminal .wiki-container {
    height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Tab Navigation */
.mod-eotgwiki-terminal .tab-navigation {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mod-eotgwiki-terminal .tab-button {
    background: transparent;
    border: 2px solid #38bdf8;
    color: #38bdf8;
    font-family: 'OpenDyslexic', 'VT323', monospace;
    font-size: 1.2em;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 5px #38bdf8;
    position: relative;
}

.mod-eotgwiki-terminal .tab-button:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.mod-eotgwiki-terminal .tab-button.active {
    background: rgba(0, 255, 0, 0.3);
    box-shadow: 
        0 0 20px rgba(0, 255, 0, 0.5),
        inset 0 0 10px rgba(0, 255, 0, 0.3);
}

.mod-eotgwiki-terminal .tab-button.terminal-tab {
    border-color: #c77dff;
    color: #c77dff;
    text-shadow: 0 0 5px #c77dff;
}

.mod-eotgwiki-terminal .tab-button.terminal-tab:hover {
    background: rgba(199, 125, 255, 0.2);
    box-shadow: 0 0 15px rgba(199, 125, 255, 0.5);
}

.mod-eotgwiki-terminal .tab-button.terminal-tab.active {
    background: rgba(199, 125, 255, 0.3);
    box-shadow: 
        0 0 20px rgba(199, 125, 255, 0.5),
        inset 0 0 10px rgba(199, 125, 255, 0.3);
}

.mod-eotgwiki-terminal .tab-button .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0000;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: eotgwiki-pulse 2s infinite;
}

@keyframes eotgwiki-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Tab Content */
.mod-eotgwiki-terminal .tab-content {
    flex: 1;
    display: none;
    background: #0a0a0a;
    border: 3px solid #38bdf8;
    border-radius: 10px;
    padding: 30px;
    overflow-y: auto;
    position: relative;
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 255, 0, 0.2);
}

.mod-eotgwiki-terminal .tab-content.active {
    display: block;
}

.mod-eotgwiki-terminal .tab-content.terminal-content {
    border-color: #c77dff;
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(199, 125, 255, 0.2);
    padding: 20px;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.mod-eotgwiki-terminal .tab-content.terminal-content.active {
    display: flex;
}

/* CRT Scanline Effect */
.mod-eotgwiki-terminal .tab-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 2px;
    pointer-events: none;
    animation: eotgwiki-scanlines 8s linear infinite;
    z-index: 1;
}

@keyframes eotgwiki-scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

.mod-eotgwiki-terminal .content-inner {
    position: relative;
    z-index: 2;
}

/* Headers */
.mod-eotgwiki-terminal .terminal-header {
    font-size: 1.3em;
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #c77dff;
    text-shadow: 0 0 10px #c77dff;
    color: #c77dff;
    position: relative;
    z-index: 2;
}

.mod-eotgwiki-terminal .terminal-header.regular {
    font-size: 1.5em;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #38bdf8;
    text-shadow: 0 0 10px #38bdf8;
    color: #38bdf8;
}

/* Status Panel */
.mod-eotgwiki-terminal .status-panel {
    background: rgba(0, 255, 0, 0.1);
    padding: 15px;
    border: 2px solid #38bdf8;
    margin-bottom: 20px;
    font-size: 1.1em;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.mod-eotgwiki-terminal .status-item {
    padding: 10px;
    border-left: 3px solid #38bdf8;
}

/* Tree Navigation */
.mod-eotgwiki-terminal .tree-node {
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2em;
}

.mod-eotgwiki-terminal .tree-node:hover {
    background: rgba(0, 255, 0, 0.2);
    padding-left: 10px;
}

.mod-eotgwiki-terminal .tree-node.category {
    font-weight: bold;
}

.mod-eotgwiki-terminal .indicator {
    display: inline-block;
    margin-right: 8px;
}

.mod-eotgwiki-terminal .indicator.unread {
    color: #ff0000;
    animation: eotgwiki-blink 1.5s infinite;
}

@keyframes eotgwiki-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.mod-eotgwiki-terminal .indicator.locked {
    opacity: 0.5;
}

/* Article Display */
.mod-eotgwiki-terminal .article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #38bdf8;
}

.mod-eotgwiki-terminal .article-title {
    font-size: 3em;
    text-shadow: 0 0 15px #38bdf8;
    margin-bottom: 15px;
}

.mod-eotgwiki-terminal .article-meta {
    font-size: 1.1em;
    opacity: 0.8;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.mod-eotgwiki-terminal .article-content {
    line-height: 1.8;
    font-size: 1.2em;
}

.mod-eotgwiki-terminal .article-content p {
    margin: 20px 0;
}

.mod-eotgwiki-terminal .article-content h2 {
    font-size: 2em;
    margin: 30px 0 20px;
    text-shadow: 0 0 10px #38bdf8;
}

/* Locked/Unlocked Content */
.mod-eotgwiki-terminal .locked-content,
.mod-eotgwiki-terminal .lore-locked {
    background: rgba(255, 0, 0, 0.1);
    border: 3px solid #ff0000;
    padding: 30px;
    margin: 30px 0;
    text-align: center;
    color: #ff0000;
}

.mod-eotgwiki-terminal .lock-indicator {
    font-size: 2em;
    margin-bottom: 15px;
}

.mod-eotgwiki-terminal .unlocked-content,
.mod-eotgwiki-terminal .lore-unlocked {
    background: rgba(0, 255, 0, 0.1);
    border: 3px solid #38bdf8;
    padding: 30px;
    margin: 30px 0;
}

.mod-eotgwiki-terminal .unlock-badge {
    background: rgba(0, 255, 0, 0.3);
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 1em;
    display: inline-block;
    border: 1px solid #38bdf8;
}

/* Recent Articles */
.mod-eotgwiki-terminal .recent-list {
    display: grid;
    gap: 15px;
}

.mod-eotgwiki-terminal .recent-item {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #38bdf8;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.mod-eotgwiki-terminal .recent-item:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.mod-eotgwiki-terminal .recent-item-title {
    font-size: 1.5em;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #38bdf8;
}

.mod-eotgwiki-terminal .recent-item-meta {
    opacity: 0.8;
    font-size: 0.9em;
}

/* Search */
.mod-eotgwiki-terminal .search-form {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.mod-eotgwiki-terminal .search-input {
    flex: 1;
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #38bdf8;
    color: #38bdf8;
    font-family: 'OpenDyslexic', 'VT323', monospace;
    font-size: 1.5em;
    padding: 15px;
    outline: none;
}

.mod-eotgwiki-terminal .search-input:focus {
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.mod-eotgwiki-terminal .search-button {
    background: rgba(0, 255, 0, 0.3);
    border: 2px solid #38bdf8;
    color: #38bdf8;
    font-family: 'OpenDyslexic', 'VT323', monospace;
    font-size: 1.2em;
    padding: 10px 30px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 5px #38bdf8;
}

.mod-eotgwiki-terminal .search-button:hover {
    background: rgba(0, 255, 0, 0.5);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.mod-eotgwiki-terminal .search-note {
    margin: 15px 0;
    opacity: 0.7;
    font-size: 0.9em;
}

.mod-eotgwiki-terminal .search-result {
    background: rgba(0, 255, 0, 0.05);
    border-left: 3px solid #38bdf8;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.mod-eotgwiki-terminal .search-result:hover {
    background: rgba(0, 255, 0, 0.15);
    padding-left: 20px;
}

.mod-eotgwiki-terminal .search-result-title {
    font-size: 1.3em;
    margin-bottom: 5px;
}

.mod-eotgwiki-terminal .search-result-path {
    opacity: 0.6;
    font-size: 0.9em;
}

/* Terminal Output */
.mod-eotgwiki-terminal .terminal-output {
    position: relative;
    z-index: 2;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    font-size: 1.15em;
    line-height: 1.6;
    color: #38bdf8;
}

.mod-eotgwiki-terminal .terminal-output::-webkit-scrollbar {
    width: 8px;
}

.mod-eotgwiki-terminal .terminal-output::-webkit-scrollbar-track {
    background: rgba(199, 125, 255, 0.1);
}

.mod-eotgwiki-terminal .terminal-output::-webkit-scrollbar-thumb {
    background: #c77dff;
    border-radius: 4px;
}

.mod-eotgwiki-terminal .output-line {
    margin: 3px 0;
    animation: eotgwiki-typeIn 0.05s;
}

@keyframes eotgwiki-typeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mod-eotgwiki-terminal .output-line.command {
    color: #38bdf8;
    text-shadow: 0 0 5px #38bdf8;
}

.mod-eotgwiki-terminal .output-line.system {
    color: #c77dff;
}

.mod-eotgwiki-terminal .output-line.error {
    color: #ff0000;
    text-shadow: 0 0 5px #ff0000;
}

.mod-eotgwiki-terminal .output-line.success {
    color: #38bdf8;
    font-weight: bold;
}

.mod-eotgwiki-terminal .output-line.secret {
    color: #ffb000;
    text-shadow: 0 0 8px #ffb000;
    animation: eotgwiki-glow 2s infinite alternate;
}

@keyframes eotgwiki-glow {
    from { text-shadow: 0 0 5px #ffb000; }
    to { text-shadow: 0 0 15px #ffb000; }
}

/* Terminal Input */
.mod-eotgwiki-terminal .command-input-container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    background: rgba(199, 125, 255, 0.1);
    border: 2px solid #c77dff;
    padding: 10px;
    margin-bottom: 10px;
}

.mod-eotgwiki-terminal .prompt {
    color: #38bdf8;
    margin-right: 10px;
    text-shadow: 0 0 5px #38bdf8;
}

.mod-eotgwiki-terminal .command-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #38bdf8;
    font-family: 'OpenDyslexic', 'VT323', monospace;
    font-size: 1.2em;
    outline: none;
    text-shadow: 0 0 5px #38bdf8;
}

.mod-eotgwiki-terminal .command-input::placeholder {
    color: rgba(0, 255, 0, 0.5);
}

/* Terminal Status Bar */
.mod-eotgwiki-terminal .terminal-status-bar {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: rgba(199, 125, 255, 0.1);
    border-top: 1px solid #c77dff;
    font-size: 0.9em;
    position: relative;
    z-index: 2;
    color: #c77dff;
}

/* Help Section */
.mod-eotgwiki-terminal .help-section {
    background: rgba(199, 125, 255, 0.1);
    border: 2px solid #c77dff;
    padding: 15px;
    margin: 10px 0;
    color: #c77dff;
}

.mod-eotgwiki-terminal .help-command {
    color: #38bdf8;
    margin: 5px 0;
    padding-left: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .mod-eotgwiki-terminal .tab-button {
        font-size: 1em;
        padding: 8px 15px;
    }
    
    .mod-eotgwiki-terminal .article-title {
        font-size: 2em;
    }
    
    .mod-eotgwiki-terminal .status-panel {
        grid-template-columns: 1fr;
    }

    .mod-eotgwiki-terminal .search-form {
        flex-direction: column;
    }

    .mod-eotgwiki-terminal .search-input {
        font-size: 1.2em;
    }
}

/* Scrollbar Styling */
.mod-eotgwiki-terminal .tab-content::-webkit-scrollbar {
    width: 10px;
}

.mod-eotgwiki-terminal .tab-content::-webkit-scrollbar-track {
    background: rgba(0, 255, 0, 0.1);
}

.mod-eotgwiki-terminal .tab-content::-webkit-scrollbar-thumb {
    background: #38bdf8;
    border-radius: 5px;
}

.mod-eotgwiki-terminal .tab-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 0, 0.8);
}

/* Unlock Notifications */
.unlock-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.95);
    border: 3px solid #38bdf8;
    border-radius: 8px;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10000;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease-out;
    font-family: 'OpenDyslexic', 'VT323', monospace;
}

.unlock-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.unlock-notification .unlock-icon {
    font-size: 2.5em;
    animation: eotgwiki-unlock-pulse 1s infinite;
}

@keyframes eotgwiki-unlock-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.unlock-notification .unlock-text {
    color: #38bdf8;
    text-shadow: 0 0 5px #38bdf8;
}

.unlock-notification .unlock-text strong {
    font-size: 1.2em;
    display: block;
    margin-bottom: 5px;
}

/* Search Results Styling */
.mod-eotgwiki-terminal .search-results-list {
    margin-top: 15px;
}

.mod-eotgwiki-terminal .search-result {
    padding: 10px;
    margin: 5px 0;
    background: rgba(199, 125, 255, 0.1);
    border-left: 3px solid #c77dff;
}

.mod-eotgwiki-terminal .search-result.locked {
    border-left-color: #dc2626;
    opacity: 0.7;
}

.mod-eotgwiki-terminal .search-result .article-link {
    color: #c77dff;
    text-decoration: none;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.mod-eotgwiki-terminal .search-result .article-link:hover {
    color: #38bdf8;
    text-shadow: 0 0 5px #38bdf8;
}

.mod-eotgwiki-terminal .search-result .result-snippet {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
}

/* Recent Articles Styling */
.mod-eotgwiki-terminal .recent-articles {
    margin-top: 15px;
}

.mod-eotgwiki-terminal .recent-article {
    padding: 10px;
    margin: 5px 0;
    background: rgba(199, 125, 255, 0.1);
    border-left: 3px solid #c77dff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mod-eotgwiki-terminal .recent-article .article-link {
    color: #c77dff;
    text-decoration: none;
    font-weight: bold;
    flex: 1;
}

.mod-eotgwiki-terminal .recent-article .article-link:hover {
    color: #38bdf8;
    text-shadow: 0 0 5px #38bdf8;
}

.mod-eotgwiki-terminal .recent-article .read-time {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    margin-left: 10px;
}

/* Terminal Command Line Styling */
.mod-eotgwiki-terminal .terminal-line {
    margin: 2px 0;
    padding: 2px 0;
}

.mod-eotgwiki-terminal .terminal-line.command {
    color: #38bdf8;
    font-weight: bold;
}

.mod-eotgwiki-terminal .terminal-line.response {
    color: #c77dff;
}

.mod-eotgwiki-terminal .terminal-line.error {
    color: #dc2626;
}

/* ============================================================
   LORE KEY CONTENT FILTERING
   ============================================================ */

/* Unlocked Content */
.lore-unlocked {
    margin: 15px 0;
    padding: 15px;
    border-left: 4px solid #38bdf8;
    background: rgba(0, 255, 0, 0.05);
    border-radius: 4px;
    position: relative;
}

.lore-unlocked .lore-indicator {
    font-size: 0.85em;
    color: #38bdf8;
    margin-bottom: 10px;
    font-family: 'OpenDyslexic', 'VT323', monospace;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.lore-unlocked .lore-key-name {
    font-weight: bold;
    letter-spacing: 1px;
}

/* Locked Content */
.lore-locked {
    margin: 15px 0;
    padding: 15px;
    border-left: 4px solid #dc2626;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 4px;
    position: relative;
}

.lore-locked .locked-content-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #dc2626;
    font-family: 'OpenDyslexic', 'VT323', monospace;
}

.lore-locked .lock-icon {
    font-size: 1.5em;
    animation: eotgwiki-lock-pulse 2s infinite;
}

@keyframes eotgwiki-lock-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.lore-locked .locked-message {
    flex: 1;
}

.lore-locked code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
    color: #c77dff;
    font-family: 'VT323', monospace;
    letter-spacing: 1px;
}

/* Inline Locked Content */
.lore-locked-inline {
    display: inline;
    padding: 2px 8px;
    background: rgba(220, 38, 38, 0.2);
    border-radius: 3px;
    color: #dc2626;
    font-size: 0.9em;
    white-space: nowrap;
}

/* Article Content with Lore Keys */
.mod-eotgwiki-terminal .article-content .lore-unlocked {
    animation: eotgwiki-lore-reveal 0.5s ease-out;
}

@keyframes eotgwiki-lore-reveal {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Nested Lore Content */
.lore-unlocked .lore-unlocked,
.lore-unlocked .lore-locked {
    margin-left: 15px;
    border-left-width: 2px;
}

/* Accessibility - High Contrast Mode */
@media (prefers-contrast: high) {
    .lore-locked {
        border-left-width: 6px;
        background: rgba(220, 38, 38, 0.2);
    }
    
    .lore-unlocked {
        border-left-width: 6px;
        background: rgba(0, 255, 0, 0.1);
    }
}

/* Print Styles */
@media print {
    .lore-locked {
        border: 2px solid #000;
        background: #f0f0f0;
    }
    
    .lore-locked::after {
        content: " [LOCKED - " attr(data-lore-key) "]";
        font-weight: bold;
    }
    
    .lore-unlocked .lore-indicator {
        display: none;
    }
}

