/* Global Overrides for Dashboard Layout */
body {
    overflow: auto;
    min-height: 100vh;
    background: var(--bg-surface-alt);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Ambient Background */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    background: #F8FAFC;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    animation: float-blob 25s infinite ease-in-out alternate;
}

.blob-1 {
    top: -15%;
    left: -10%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle, var(--primary-light) 0%, rgba(96, 165, 250, 0) 70%);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -15%;
    right: -10%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--accent-light) 0%, rgba(167, 139, 250, 0) 70%);
    animation-delay: -8s;
}

.blob-3 {
    top: 35%;
    right: 15%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, #E0F2FE 0%, rgba(224, 242, 254, 0) 70%);
    animation-delay: -15s;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 1;
    pointer-events: none;
}

/* Decorative floating elements */
.grid-overlay::before,
.grid-overlay::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.12);
    animation: float-ring 20s infinite ease-in-out;
}

.grid-overlay::before {
    width: 300px;
    height: 300px;
    top: 10%;
    right: 5%;
    animation-delay: -5s;
}

.grid-overlay::after {
    width: 200px;
    height: 200px;
    bottom: 15%;
    left: 8%;
    animation-delay: -12s;
}

@keyframes float-blob {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    33% {
        transform: translate(40px, -60px) scale(1.1) rotate(120deg);
    }

    66% {
        transform: translate(-30px, 30px) scale(0.9) rotate(240deg);
    }

    100% {
        transform: translate(0, 0) scale(1) rotate(360deg);
    }
}

@keyframes float-ring {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.12;
    }

    50% {
        transform: translate(20px, -30px) scale(1.2);
        opacity: 0.2;
    }
}

/* Dashboard Container */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    overflow-y: auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 24px;
    width: 100%;
    max-width: 1200px;
    min-height: 85vh;
}

/* Cards - Glassmorphism Update */
.card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card:hover {
    transform: translateY(-8px) scale(1.01);
    background: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    border-color: var(--primary-light);
}

/* Hero Card (Large) */
.hero-card {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    background: #FFFFFF;
    cursor: default;
    padding: 32px;
    overflow: visible;
}

.hero-card:hover {
    transform: none;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}


/* Hero Typography */
.hero-name {
    font-size: 3rem;
    line-height: 1.1;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

.hero-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-tagline {
    font-size: 1.2rem;
    line-height: 1.4;
    color: var(--text-secondary);
    margin: 0 0 14px;
    font-weight: 400;
}

/* Specialty Tags */
.hero-specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    /* Slightly more space for readability */
    margin-bottom: 18px;
    /* Better separation */
}

.specialty-tag {
    padding: 6px 14px;
    /* More elegant padding */
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    /* Slightly bolder for clarity */
    color: var(--primary);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.specialty-tag:hover {
    background: #FFFFFF;
    border-color: var(--primary);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* Mini Stats */
.hero-stats-mini {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 14px;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Hero Footer Section */
.hero-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.update-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 10px;
    font-weight: 500;
}

/* Enhanced Social Links */
.social-links-enhanced {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.social-link:hover {
    background: white;
    border-color: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.social-link svg {
    flex-shrink: 0;
}

/* Nav Cards */
.nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 180px;
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(37, 99, 235, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-card:hover::before {
    opacity: 1;
}

.card-icon-wrapper {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-radius: 20px;
    margin-bottom: 20px;
    transition: all 0.3s;
    position: relative;
}

.nav-card:hover .card-icon-wrapper {
    transform: translateY(-5px) scale(1.05);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.card-icon-svg {
    width: 40px;
    height: 40px;
    color: var(--primary);
    transition: all 0.3s;
}

.nav-card:hover .card-icon-svg {
    color: var(--accent);
    transform: scale(1.1);
}

.nav-card h3 {
    font-size: 1.4rem;
    margin: 0 0 8px;
    color: var(--text-main);
    font-weight: 700;
    transition: color 0.3s;
}

.nav-card:hover h3 {
    color: var(--primary);
}

.nav-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.card-decoration {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.nav-card:hover .card-decoration {
    transform: scaleX(1);
}

/* Background Shapes for Hero */
.card-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
}

.s1 {
    top: -10%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: var(--primary-light);
}

.s2 {
    bottom: -10%;
    left: -10%;
    width: 200px;
    height: 200px;
    background: var(--accent-light);
}

.card-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Content Viewer (Overlay) */
.content-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-body);
    z-index: 2000;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.content-viewer.active {
    transform: translateY(0);
}

/* Viewer Navigation */
.viewer-nav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 16px 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-back {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.2s;
}

.btn-back:hover {
    background: var(--bg-surface-alt);
}

/* Viewer Menu (Top Right) */
.viewer-menu {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.nav-item:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.nav-item.active {
    color: var(--primary);
    font-weight: 700;
    background: rgba(37, 99, 235, 0.1);
}

.current-section-title {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Viewer Body */
.viewer-body {
    flex: 1;
    padding: 40px 0 80px;
}

.view-section {
    display: none;
    /* Hidden by default, shown via JS */
    animation: fadeIn 0.5s ease-out;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* About Section Updates */
.about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 60px;
    align-items: start;
}

.about-image-container {
    position: relative;
}

.profile-image-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: #E2E8F0;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fallback-avatar {
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-muted);
    display: none;
    /* Shown if image fails */
}

/* MacBook and smaller height screens */
@media (max-height: 900px) {
    .dashboard-container {
        padding: 24px;
    }

    .dashboard-grid {
        height: auto;
        min-height: 90vh;
        max-height: none;
        gap: 16px;
    }

    .hero-name {
        font-size: 2.2rem;
        margin: 0 0 4px;
    }

    .hero-title {
        font-size: 0.85rem;
        margin: 0 0 5px;
    }

    .hero-tagline {
        font-size: 0.95rem;
        line-height: 1.25;
        margin: 0 0 8px;
    }

    .hero-specialties {
        gap: 4px;
        margin-bottom: 8px;
    }

    .specialty-tag {
        padding: 3px 8px;
        font-size: 0.7rem;
    }

    .hero-stats-mini {
        gap: 10px;
        padding: 6px 0;
        margin-bottom: 8px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .hero-footer {
        padding-top: 6px;
    }

    .update-date {
        font-size: 0.65rem;
        margin: 0 0 6px;
    }

    .social-link {
        padding: 5px 8px;
        font-size: 0.7rem;
        gap: 3px;
    }

    .social-link svg {
        width: 16px;
        height: 16px;
    }

    .hero-card {
        padding: 22px;
    }

    body {
        overflow: auto;
    }
}

/* Very small height screens (small laptops, zoom) */
@media (max-height: 750px) {
    .dashboard-container {
        padding: 16px;
        align-items: flex-start;
    }

    .dashboard-grid {
        gap: 12px;
    }

    .hero-name {
        font-size: 1.8rem;
        margin: 0 0 2px;
    }

    .hero-title {
        font-size: 0.8rem;
        margin: 0 0 4px;
    }

    .hero-tagline {
        font-size: 0.85rem;
        line-height: 1.2;
        margin: 0 0 6px;
    }

    .hero-specialties {
        gap: 3px;
        margin-bottom: 6px;
    }

    .specialty-tag {
        padding: 2px 7px;
        font-size: 0.65rem;
    }

    .hero-stats-mini {
        gap: 8px;
        padding: 5px 0;
        margin-bottom: 6px;
    }

    .stat-value {
        font-size: 1rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .hero-footer {
        padding-top: 4px;
    }

    .update-date {
        font-size: 0.6rem;
        margin: 0 0 4px;
    }

    .social-link {
        padding: 4px 7px;
        font-size: 0.65rem;
        gap: 2px;
    }

    .social-link svg {
        width: 14px;
        height: 14px;
    }

    .hero-card {
        padding: 16px;
    }

    .card {
        padding: 16px;
        border-radius: 16px;
    }

    .card-icon-wrapper {
        width: 50px;
        height: 50px;
        margin-bottom: 10px;
        border-radius: 14px;
    }

    .card-icon-svg {
        width: 28px;
        height: 28px;
    }

    .nav-card h3 {
        font-size: 1rem;
        margin: 0 0 4px;
    }

    .nav-card p {
        font-size: 0.75rem;
    }
}

/* Responsive Adjustments */

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
        height: auto;
        max-height: none;
    }

    .hero-card {
        grid-column: 1 / -1;
        min-height: 400px;
    }

    .dashboard-container {
        height: auto;
        overflow-y: auto;
        display: block;
    }

    body {
        overflow: auto;
    }
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .profile-image-placeholder {
        width: 200px;
        margin: 0 auto 32px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .hero-card h1 {
        font-size: 2.5rem;
    }
}

/* Re-using existing styles for Papers, Timeline, etc. */
.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 40px;
}

/* Coming Soon Placeholder */
.coming-soon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    border: 2px dashed rgba(0, 0, 0, 0.1);
}

.coming-soon p {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
}