/* CyberEdu Documentation Platform - Styles (FREEMIUM + AUTH UI) */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@300;400;600;700&display=swap');

/* Base */
body { font-family: 'Inter', sans-serif; }
code, pre { font-family: 'JetBrains Mono', monospace; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Progress Bar */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    z-index: 100;
    transition: width 0.1s;
}

/* Markdown Body */
.markdown-body h1 { font-size: 2.25rem; font-weight: 700; color: #38bdf8; margin-bottom: 1.5rem; border-bottom: 1px solid #1e293b; padding-bottom: 0.5rem; }
.markdown-body h2 { font-size: 1.5rem; font-weight: 600; color: #e2e8f0; margin-top: 2.5rem; margin-bottom: 1rem; border-left: 4px solid #38bdf8; padding-left: 1rem; }
.markdown-body h3 { font-size: 1.25rem; font-weight: 600; color: #94a3b8; margin-top: 1.5rem; margin-bottom: 0.75rem; }
.markdown-body p { margin-bottom: 1rem; line-height: 1.8; color: #cbd5e1; }
.markdown-body ul, .markdown-body ol { margin-bottom: 1rem; color: #cbd5e1; }
.markdown-body li { margin-bottom: 0.5rem; line-height: 1.7; }
.markdown-body pre { background-color: #1e293b; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin-bottom: 1.5rem; border: 1px solid #334155; }
.markdown-body code { color: #f472b6; background-color: rgba(30, 41, 59, 0.7); padding: 0.2rem 0.4rem; border-radius: 0.25rem; font-size: 0.875em; }
.markdown-body pre code { color: #e2e8f0; background-color: transparent; padding: 0; }
.markdown-body strong { color: #f1f5f9; font-weight: 600; }
.markdown-body table { width: 100%; text-align: left; border-collapse: collapse; margin-bottom: 1.5rem; }
.markdown-body th { border-bottom: 2px solid #334155; padding: 0.75rem; color: #38bdf8; font-weight: 600; }
.markdown-body td { border-bottom: 1px solid #334155; padding: 0.75rem; }
.markdown-body hr { border-color: #334155; margin: 2rem 0; }

/* Note Boxes */
.note-box { border-left: 4px solid #38bdf8; background: rgba(56, 189, 248, 0.1); padding: 1rem; margin: 1.5rem 0; border-radius: 0 0.5rem 0.5rem 0; }
.warning-box { border-left: 4px solid #f59e0b; background: rgba(245, 158, 11, 0.1); padding: 1rem; margin: 1.5rem 0; border-radius: 0 0.5rem 0.5rem 0; }
.critical-box { border-left: 4px solid #ef4444; background: rgba(239, 68, 68, 0.1); padding: 1rem; margin: 1.5rem 0; border-radius: 0 0.5rem 0.5rem 0; }

/* Navigation */
.active-nav { background-color: #1e293b; border-right: 3px solid #38bdf8; color: #38bdf8 !important; }

/* Back to Top */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #38bdf8;
    color: #0f172a;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}
#back-to-top.visible { opacity: 1; transform: translateY(0); }
#back-to-top:hover { background: #7dd3fc; transform: translateY(-2px); }

/* Animations */
.opacity-0 { opacity: 0; }
.animate-fade-in { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Keyboard */
kbd { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; }

/* Copy Button */
.copy-btn.copied { background: #22c55e !important; }

/* Category Badges */
.category-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 600;
}
.category-L2 { background: #0ea5e9; color: white; }
.category-L3 { background: #22c55e; color: white; }
.category-L4 { background: #f59e0b; color: white; }
.category-L7 { background: #ef4444; color: white; }
.category-AD { background: #8b5cf6; color: white; }
.category-New { background: #ec4899; color: white; }
.category-general { background: #64748b; color: white; }

/* ============================================================ */
/* FREEMIUM - Premium Badge */
/* ============================================================ */

.premium-badge {
    font-size: 0.875rem;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.nav-item:hover .premium-badge {
    opacity: 1;
}

.premium-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.premium-link::after {
    content: "👑";
    font-size: 0.75em;
    opacity: 0.8;
}

.premium-link:hover::after {
    opacity: 1;
}

/* ============================================================ */
/* AUTH UI - MODALS
/* ============================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.hidden {
    display: none;
}

.modal-container {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 28rem;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #334155;
    color: white;
}

/* ============================================================ */
/* FORMS
/* ============================================================ */

.auth-form {
    animation: fadeIn 0.3s ease-out;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.form-input::placeholder {
    color: #64748b;
}

/* ============================================================ */
/* BUTTONS
/* ============================================================ */

.btn-primary {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-premium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-weight: 700;
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.5);
}

.btn-premium:active {
    transform: translateY(0);
}

/* ============================================================ */
/* MESSAGES
/* ============================================================ */

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.error-message.hidden {
    display: none;
}

.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #86efac;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.success-message.hidden {
    display: none;
}

/* ============================================================ */
/* USER MENU
/* ============================================================ */

#user-menu {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
}

.user-menu-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: #38bdf8;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.user-menu-btn:hover {
    background: #334155;
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: 3.5rem;
    right: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    min-width: 12rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown.hidden {
    display: none;
}

.dropdown-item {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: #334155;
    color: white;
}

/* ============================================================ */
/* SPINNER (Loading)
/* ============================================================ */

.spinner {
    border: 3px solid #334155;
    border-top: 3px solid #38bdf8;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================================ */
/* RESPONSIVE
/* ============================================================ */

@media (max-width: 768px) {
    #user-menu {
        top: 1rem;
        right: 1rem;
    }
    
    .user-menu-btn {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .modal-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .btn-premium {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* ============================================================ */
/* Print Styles */
/* ============================================================ */

@media print {
    body { background: white; color: black; }
    #sidebar, #mobile-menu-btn, #back-to-top, .copy-btn, #progress-bar, #user-menu, .modal-overlay { display: none !important; }
    .markdown-body h1, .markdown-body h2, .markdown-body h3 { color: #1e293b; }
    .markdown-body p, .markdown-body li { color: #334155; }
    .markdown-body pre { border: 1px solid #e2e8f0; background: #f8fafc; }
    .note-box, .warning-box, .critical-box { border-left-width: 3px; background: #f8fafc; }
    .premium-badge, .premium-link::after { display: none; }
}
