/**
 * FILE: /var/www/html/assets/css/knowledgebase.css
 * DESCRIPTION: Styles for knowledge base page
 */

/* Login Button */
.login-btn {
    background: var(--accent) !important;
    color: #ffffff !important;
    padding: 6px 16px !important;
    border-radius: var(--radius-sm) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    transition: background 0.2s ease !important;
    display: inline-block !important;
    border: none !important;
    cursor: pointer !important;
    margin-left: 10px;
}
.login-btn:hover { background: var(--accent-hover) !important; }

/* Logo */
.logo-link { display: flex; align-items: center; text-decoration: none; transition: opacity 0.2s ease; }
.logo-link:hover { opacity: 0.85; }
.logo-image { height: 70px; width: auto; display: block; }

/* Navigation */
.nav-links { display: flex; list-style: none; gap: 30px; align-items: center; }
.nav-item { position: relative; }
.dropdown { position: relative; }
.dropdown-toggle { cursor: pointer; display: flex; align-items: center; gap: 5px; }
.dropdown-toggle::after { content: '▼'; font-size: 0.65em; transition: transform 0.2s ease; }
.dropdown:hover .dropdown-toggle::after { transform: rotate(180deg); }
.dropdown-menu {
    position: absolute; top: 100%; left: 0; background: var(--bg-raised);
    border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px 0; min-width: 200px;
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all 0.2s ease; z-index: 1000;
}
.dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu li { list-style: none; }
.dropdown-menu a {
    display: block; padding: 10px 18px; color: var(--text-secondary); text-decoration: none; transition: all 0.2s ease;
    border-left: 2px solid transparent; font-size: 0.95rem;
}
.dropdown-menu a:hover { background: var(--accent-dim); border-left-color: var(--accent); color: var(--text-primary); padding-left: 22px; }

/* KB Search */
.kb-search-container {
    max-width: 800px;
    margin: 0 auto 60px;
    text-align: center;
    padding: 0 20px;
}
#kbSearch {
    width: 100%;
    padding: 13px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-raised);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}
#kbSearch::placeholder { color: var(--text-muted); }
#kbSearch:focus { outline: none; border-color: var(--accent); }

/* Category Tags */
.categories-grid {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.category-tag {
    padding: 8px 18px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
}
.category-tag:hover, .category-tag.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* KB Grid */
.kb-grid { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.kb-category { margin-bottom: 60px; }
.kb-category h3 {
    color: var(--text-primary);
    font-size: 1.6rem;
    margin-bottom: 28px;
    text-align: center;
    font-weight: 700;
}

/* Guide Cards */
.guide-card {
    background: var(--bg-raised);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    transition: border-color 0.2s ease;
    overflow: hidden;
}
.guide-card:hover { border-color: var(--border-strong); }
.guide-card h4 { color: var(--text-primary); margin-bottom: 8px; font-size: 1.1rem; font-weight: 600; }
.guide-card p { color: var(--text-secondary); margin-bottom: 14px; font-size: 0.97rem; }

/* Expand Button */
.expand-btn {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 7px 16px;
    border: 1px solid var(--border-focus);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    margin-bottom: 14px;
}
.expand-btn:hover { background: var(--accent); color: #ffffff; }

/* Guide Details */
.guide-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    opacity: 0;
}
.guide-card.expanded .guide-details {
    max-height: 1000px;
    opacity: 1;
    margin-top: 18px;
}
.guide-details ol { padding-left: 20px; color: var(--text-secondary); margin: 10px 0; }
.guide-details ol li { margin-bottom: 8px; }
.guide-details code {
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-family: monospace;
    font-size: 0.875rem;
}
.guide-details pre code {
    display: block;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 14px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    white-space: pre-wrap;
}

/* Support CTA */
.support-cta {
    text-align: center;
    margin-top: 60px;
    padding: 40px;
    background: var(--bg-raised);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.support-cta p { font-size: 1rem; color: var(--text-secondary); margin-bottom: 20px; }

/* Legal Modal */
.legal-modal { position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.75); backdrop-filter: blur(4px); }
.legal-modal-content {
    background: var(--bg-raised); margin: 2% auto; padding: 0;
    border: 1px solid var(--border); border-radius: var(--radius-lg); width: 90%; max-width: 900px; max-height: 90vh;
    position: relative; overflow: hidden;
}
.legal-modal-header {
    background: var(--bg-elevated); border-bottom: 1px solid var(--border);
    padding: 20px 28px; display: flex; justify-content: space-between; align-items: center;
}
.legal-modal-header h2 { color: var(--text-primary); margin: 0; font-size: 1.5rem; font-weight: 600; }
.legal-close { color: var(--text-secondary); font-size: 1.6rem; cursor: pointer; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; transition: color 0.2s ease; }
.legal-close:hover { color: var(--danger); }
.legal-modal-body { padding: 28px; max-height: calc(90vh - 80px); overflow-y: auto; color: var(--text-secondary); line-height: 1.6; }
.legal-modal-body::-webkit-scrollbar { width: 6px; }
.legal-modal-body::-webkit-scrollbar-track { background: var(--bg); }
.legal-modal-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.loading-spinner { text-align: center; padding: 40px; color: var(--text-muted); font-size: 1rem; }

/* Responsive */
@media (max-width: 768px) {
    .login-btn { padding: 5px 12px !important; font-size: 0.85rem !important; margin-left: 5px; }
    .nav-links { gap: 15px; }
    .logo-image { height: 55px; }
    .categories-grid { gap: 6px; }
    .category-tag { padding: 7px 14px; font-size: 0.85rem; }
    .kb-grid { padding: 0 10px; }
    .kb-category h3 { font-size: 1.3rem; }
    .guide-card { padding: 18px; }
}
@media (max-width: 480px) {
    .logo-image { height: 45px; }
}
