:root {
    --primary: #6366f1;
    --primary-bright: #818cf8;
    --secondary: #a855f7;
    --background: #0b0f1a;
    --sidebar-bg: #161b2c;
    --card-bg: rgba(30, 41, 59, 0.4);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --accent: #22d3ee;
    --glass-border: rgba(255, 255, 255, 0.08);
    --success: #10b981;
    --error: #ef4444;
    --gold: #fbbf24;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

#plexus-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #020617;
    /* Deep midnight background */
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Nav */
.main-header {
    background: rgba(11, 15, 26, 0.82);
    backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-family: 'Outfit', sans-serif;
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.main-name {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(to right,
            #fff 20%,
            #94a3b8 40%,
            #6366f1 60%,
            #fff 80%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShimmer 4s linear infinite;
}

.tagline {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0;
    animation: taglineSlide 1s ease-out forwards;
    animation-delay: 0.5s;
}

@keyframes textShimmer {
    to {
        background-position: 200% center;
    }
}

@keyframes taglineSlide {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.logo img {
    height: 105px;
    mix-blend-mode: screen;
    animation: logoFloat 4s ease-in-out infinite;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 0 15px var(--accent));
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

@keyframes logoGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 15px rgba(34, 211, 238, 0.4));
    }

    50% {
        filter: drop-shadow(0 0 35px rgba(99, 102, 241, 0.7));
    }
}

.logo img:hover {
    transform: scale(1.15) !important;
    filter: drop-shadow(0 0 30px var(--primary));
}

.logo i {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2rem;
}

.top-nav {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.top-nav a {
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 600;
    transition: 0.3s;
    font-size: 0.95rem;
    position: relative;
    cursor: pointer;
}

.top-nav a.active,
.top-nav a:hover {
    color: white;
}

.top-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 10px;
}

/* User Stats */
.nav-stats {
    display: flex;
    gap: 1.5rem;
    margin-right: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    border: 1px solid var(--glass-border);
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.stat-chip i {
    color: var(--gold);
}

.stat-chip.xp i {
    color: var(--accent);
}

/* Layout Grid */
.layout-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    padding: 3rem 0;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.sidebar-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary-bright);
    margin-bottom: 1.5rem;
}

.cat-list {
    list-style: none;
}

.cat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-dim);
    text-decoration: none;
    transition: 0.3s;
    margin-bottom: 0.5rem;
    font-weight: 600;
    cursor: pointer;
}

.cat-item i {
    width: 20px;
    text-align: center;
}

.cat-item:hover,
.cat-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: white;
    border-left: 4px solid var(--primary);
}

/* AI Assistant */
.ai-assistant {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}

.ai-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.ai-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px var(--primary));
}

.ai-avatar::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: pulse 2s infinite;
    z-index: -1;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.ai-content {
    z-index: 2;
}

.ai-content h2 {
    font-family: 'Outfit';
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, var(--primary-bright));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textReveal 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.ai-content p {
    color: var(--text-dim);
    animation: fadeInSlide 1s ease-out 0.3s both;
}

@keyframes textReveal {
    from {
        transform: translateY(20px);
        opacity: 0;
        filter: blur(5px);
    }

    to {
        transform: translateY(0);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes fadeInSlide {
    from {
        transform: translateX(-10px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Buttons */
.btn-learn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    display: inline-block;
    text-align: center;
}

.btn-learn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.btn-learn:active,
.btn-learn.active {
    transform: translateY(0);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
    background: var(--primary-bright);
    border: 2px solid white;
}

.btn-learn.small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Cards Grid */
.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(255, 255, 255, 0.03),
            transparent);
    transform: rotate(45deg);
    transition: 0.6s;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.6);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
}

.card:hover::before {
    left: 100%;
}

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.type-tag {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.3rem 0.8rem;
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-bright);
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.word-val {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'Outfit';
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.word-def {
    color: var(--text-dim);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    min-height: 3rem;
}

.word-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: white;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.btn-icon:hover {
    background: var(--primary);
}

/* Overlays/Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 8, 15, 0.98);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
}

.quiz-container {
    width: 90%;
    max-width: 600px;
    background: var(--sidebar-bg);
    border-radius: 32px;
    padding: 3rem;
    border: 1px solid var(--glass-border);
    text-align: center;
}

.quiz-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 2.5rem;
}

.fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    width: 0%;
    border-radius: 10px;
    transition: 0.4s ease;
}

.question-text {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.options-list {
    display: grid;
    gap: 1rem;
}

.option-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 1.2rem;
    border-radius: 16px;
    color: white;
    text-align: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.2s;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.option-btn.correct {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success);
}

.option-btn.wrong {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error);
}

.hidden {
    display: none !important;
}

/* Library Styles */
.pdf-container {
    margin-top: 1.5rem;
    background: #111;
    border-radius: 16px;
    overflow: hidden;
}

/* Footer Styles */
.main-footer {
    margin-top: 5rem;
    padding: 3rem 0;
    border-top: 1px solid var(--glass-border);
    background: rgba(11, 15, 26, 0.6);
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dim);
    font-size: 0.95rem;
}

.footer-content a {
    color: var(--primary-bright);
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
}

.footer-content a:hover {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
}

/* Responsive */
@media (max-width: 1000px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

/* Live Chat Styles */
.chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    z-index: 2500;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-fab:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.6);
}

.notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 15px;
    height: 15px;
    background: var(--error);
    border: 3px solid var(--background);
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.chat-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    z-index: 2500;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom right;
}

.chat-window.hidden {
    transform: scale(0.5) translateY(100px);
    opacity: 0;
    pointer-events: none;
}

.chat-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.online-indicator {
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
}

.chat-user-info h4 {
    font-size: 1rem;
    font-weight: 700;
}

.chat-user-info p {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
}

.chat-close:hover {
    color: white;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.msg {
    max-width: 80%;
    padding: 1rem;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    animation: msgIn 0.3s ease-out both;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 4px;
    color: white;
}

.msg.user {
    align-self: flex-end;
    background: var(--primary);
    border-bottom-right-radius: 4px;
    color: white;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.chat-input-area {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    color: white;
    outline: none;
    transition: 0.3s;
}

.chat-input-area input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.chat-input-area button {
    background: var(--primary);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
}

.chat-input-area button:hover {
    background: var(--primary-bright);
    transform: translateY(-2px);
}

/* Compact Premium Profile Section Styles */
.profile-section-premium {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.6));
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-top: 2.5rem;
    animation: fadeInSlideUp 0.8s ease-out;
}

.profile-header-aura {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.profile-image-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.profile-image-container img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.status-badge {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.4);
}

.name-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-bright);
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 0.3rem;
}

.profile-info-content h2 {
    font-size: 2rem;
    font-family: 'Outfit';
    margin-bottom: 0.2rem;
    background: linear-gradient(to right, #fff, var(--primary-bright));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-text {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.location-chip {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.profile-details-grid {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 1.5rem;
}

.profile-bio-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.profile-bio-card h3 {
    margin-bottom: 1rem;
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-bio-card p {
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.profile-stats-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item-premium {
    background: rgba(99, 102, 241, 0.05);
    padding: 1rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.stat-val {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.social-links-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.social-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: 0.3s;
}

.social-icon-btn:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 850px) {
    .profile-header-aura {
        flex-direction: column;
        text-align: center;
    }

    .profile-details-grid {
        grid-template-columns: 1fr;
    }
}