@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@300;400;500;700&display=swap');

:root {
    --bg-primary: #010101;
    --bg-secondary: #080808;
    --bg-card: #0c0c0c;
    --accent: #104E4F; /* New Deep Teal */
    --accent-glow: rgba(16, 78, 79, 0.4);
    --text-primary: #FFFFFF;
    --text-secondary: #888888;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #222;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.hidden { display: none !important; }
.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }

/* Typography Utility */
.text-accent { color: var(--accent); } 
.bg-accent { background-color: var(--accent); }
.border-accent { border-color: var(--accent); }
.text-secondary { color: var(--text-secondary); }

h1, h2, h3 {
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

/* Glassmorphism */
.glass {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

/* Navigation */
.nav-pill {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 100px;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link {
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    background: white;
    color: black;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 8%;
    overflow: hidden;
}

.hero h1 {
    font-size: clamp(4rem, 12vw, 9rem);
    margin-bottom: 2.5rem;
}

.hero-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 65%;
    height: 100%;
    background-image: url('assets/hero_bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    filter: sepia(0.5) hue-rotate(140deg); /* Adjust bg to match deep teal */
    mask-image: linear-gradient(to left, rgba(0,0,0,1) 40%, rgba(0,0,0,0));
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 40%, rgba(0,0,0,0));
}

/* Section Styling */
.section-container {
    padding: 140px 8%;
}

.section-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 5rem;
    font-weight: 800;
}

/* Publication Cards */
.pub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
}

.pub-card {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 0px;
    border: 1px solid var(--glass-border);
    transition: all 0.4s ease;
    cursor: pointer;
}

.pub-card:hover {
    border-color: var(--accent);
    background: #111;
}

.pub-card.expanded {
    grid-column: span 2;
    grid-row: span 2;
    background: #080808;
    border-color: var(--accent);
    z-index: 10;
    cursor: default;
}

@media (max-width: 768px) {
    .pub-card.expanded {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* Software Cards */
.sw-card {
    min-width: 450px;
    background: var(--bg-card);
    padding: 4rem;
    border-radius: 0px;
    border: 1px solid var(--glass-border);
    scroll-snap-align: start;
    transition: border-color 0.3s ease;
}

.sw-card:hover {
    border-color: var(--accent);
}

/* Fan Menu Styles */
.fan-menu-container {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    z-index: 1000;
}

.fan-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.fan-items {
    position: absolute;
    bottom: 0;
    right: 0;
    pointer-events: none;
}

.fan-item {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-decoration: none;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fan-menu-container.active .fan-item {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Reveal distances */
.fan-menu-container.active .fan-item:nth-child(1) { transform: translate(-80px, 0); }
.fan-menu-container.active .fan-item:nth-child(2) { transform: translate(-70px, -45px); }
.fan-menu-container.active .fan-item:nth-child(3) { transform: translate(-45px, -70px); }
.fan-menu-container.active .fan-item:nth-child(4) { transform: translate(0, -80px); }

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Updated Glassmorphism */
.glass {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

/* Nav Pill override for premium feel */
.nav-pill {
    position: fixed;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem;
    border-radius: 100px;
    z-index: 5000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(10, 10, 10, 0.4);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}

/* 3D Book Gallery */
.book-gallery {
    perspective: 2000px;
}

.book-3d {
    width: 240px;
    height: 340px;
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
}

.book-3d:hover {
    transform: rotateY(-25deg) rotateX(5deg) scale(1.05);
}

.book-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    background-image: var(--cover-url);
    background-size: cover;
    background-position: center;
    border-radius: 3px 8px 8px 3px;
    box-shadow: 
        15px 15px 35px rgba(0,0,0,0.8),
        inset -1px 0 2px rgba(255,255,255,0.1);
    z-index: 2;
}

.book-spine {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: -15px;
    width: 30px;
    background: #151515;
    transform: rotateY(-90deg);
    transform-origin: right;
    border-radius: 4px 0 0 4px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.book-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
    z-index: 3;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.book-3d:hover .book-title-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* Auth Modal Styling */
#login-modal > div {
    border-radius: 0px !important;
}

#auth-slider {
    background: var(--accent) !important;
}

/* ==========================================================================
   Chanakya AI Bot Enhanced Controls & Styling
   ========================================================================== */
#chat-modal {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(16, 78, 79, 0.25);
}

#chat-modal.chanakya-minimized {
    height: 58px !important;
    width: 320px !important;
    border-radius: 9999px !important;
    bottom: 24px !important;
    right: 20px !important;
    overflow: hidden !important;
    border-color: rgba(16, 78, 79, 0.5) !important;
}

#chat-modal.chanakya-minimized #api-drawer,
#chat-modal.chanakya-minimized #messages,
#chat-modal.chanakya-minimized .quick-chip-bar,
#chat-modal.chanakya-minimized #chat-form {
    display: none !important;
}

#chat-modal.chanakya-minimized header {
    padding: 10px 16px !important;
    border-bottom: none !important;
    cursor: pointer;
    background: rgba(10, 15, 20, 0.95) !important;
}

#chat-modal.chanakya-maximized {
    width: min(94vw, 1080px) !important;
    height: 88vh !important;
    max-height: 88vh !important;
    bottom: 24px !important;
    right: min(3vw, 40px) !important;
    border-radius: 28px !important;
    z-index: 6000 !important;
}

/* macOS-style Auto-Hiding Navigation Dock when Chanakya is Maximized */
body.chanakya-dock-autohide .nav-pill {
    transform: translate(-50%, calc(100% + 3.5rem)) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, box-shadow 0.3s ease !important;
}

body.chanakya-dock-autohide .nav-pill.dock-peek {
    transform: translate(-50%, 0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 7000 !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 242, 254, 0.25) !important;
}

/* Floating trigger hidden while Chanakya modal is open */
#chanakya-trigger.modal-open-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.6) translateY(20px) !important;
}

/* Chat Markdown Formatting */
.chat-content {
    line-height: 1.6;
    word-break: break-word;
}

.chat-content p {
    margin-bottom: 0.6rem;
}
.chat-content p:last-child {
    margin-bottom: 0;
}

.chat-content ul, .chat-content ol {
    margin: 0.5rem 0 0.6rem 1.4rem;
}

.chat-content li {
    margin-bottom: 0.3rem;
}

.chat-content strong {
    color: #5eead4;
    font-weight: 700;
}

.chat-content em {
    color: #99f6e4;
    font-style: italic;
}

.chat-content a {
    color: #2dd4bf;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.chat-content a:hover {
    color: #ffffff;
}

.chat-content code {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: #a7f3d0;
}

.chat-content pre {
    background: #090d12;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 0.6rem 0;
    overflow-x: auto;
}

.chat-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.82rem;
    color: #e2e8f0;
}

.chat-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 0.8rem;
    margin: 0.6rem 0;
    color: #94a3b8;
    font-style: italic;
}

.chat-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.6rem 0;
    font-size: 0.8rem;
}

.chat-content th, .chat-content td {
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 10px;
    text-align: left;
}

.chat-content th {
    background: rgba(255, 255, 255, 0.08);
    font-weight: 700;
}

/* Quick Chip styling */
.quick-chip {
    transition: all 0.2s ease;
    cursor: pointer;
}
.quick-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(94, 234, 212, 0.5);
    color: #ffffff;
}

