/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF0000;
    --secondary-color: #FFD700;
    --bg-dark: #000000;
    --bg-darker: #111111;
    --text-light: #FFFFFF;
    --text-gray: #CCCCCC;
    --glass-bg: rgba(0, 0, 0, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Glass Effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu {
        display: none;
    }
    
    .mobile-menu.active {
        display: flex;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hero {
        min-height: calc(100vh - 60px);
        padding: 6rem 0 2rem 0; /* More top padding for mobile to clear navbar */
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-top: 1rem; /* Additional margin to ensure visibility */
    }
    
    .hero-visual {
        margin-top: 2rem;
    }
    
    .floating-cards {
        gap: 1rem;
    }
    
    .floating-card {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .institute-grid,
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .papers-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
        margin-top: 2rem; /* Extra space on smaller screens */
    }
    
    .hero {
        padding: 8rem 0 2rem 0; /* Even more top padding for small screens */
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .research-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .floating-card {
        padding: 1rem;
        font-size: 0.85rem;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
}

.logo-subtitle {
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-shadow: 0 0 5px var(--secondary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--secondary-color);
    text-shadow: 0 0 5px var(--secondary-color);
}

.nav-link.external::after {
    content: '↗';
    margin-left: 5px;
    font-size: 0.8rem;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 3000;
    position: relative;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    margin: 3px 0;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}



.nav-link.external::after {
    content: '↗';
    margin-left: 5px;
    font-size: 0.8rem;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    margin: 3px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: 
        radial-gradient(circle at 20% 50%, var(--primary-color)20 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--secondary-color)20 0%, transparent 50%),
        linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    padding-top: 80px; /* Account for fixed navbar */
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px var(--primary-color);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #CC0000);
    color: var(--text-light);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(255, 0, 0, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--secondary-color);
    color: var(--bg-dark);
    transform: translateY(-2px);
}

.floating-cards {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
}

.floating-card {
    padding: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    text-align: center;
    font-weight: 600;
    animation: float 6s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.1);
    text-decoration: none !important;
    color: var(--text-light) !important;
    display: block;
    transition: var(--transition);
    cursor: pointer;
}

/* Ensure floating cards maintain theme colors even when visited or active */
.floating-card:visited,
.floating-card:link,
.floating-card:active {
    color: var(--text-light) !important;
    text-decoration: none !important;
}

.floating-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.3);
    border-color: var(--secondary-color);
    color: var(--secondary-color) !important;
    text-decoration: none !important;
}

.floating-card:nth-child(2) {
    animation-delay: -2s;
}

.floating-card:nth-child(3) {
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 20px solid var(--secondary-color);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* Section Styles */
section {
    padding: 5rem 0;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 10;
    padding: 1rem 0;
}

/* Institute Section */
.institute-section {
    background: 
        radial-gradient(circle at 80% 50%, var(--secondary-color)20 0%, transparent 50%),
        linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
}

.institute-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.institute-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.institute-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s;
}

.institute-card:hover::before {
    left: 100%;
}

.institute-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 0, 0, 0.2);
    border-color: var(--secondary-color);
}

.institute-card img {
    max-width: 100%;
    height: auto;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.institute-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.institute-card p {
    color: var(--text-gray);
    line-height: 1.6;
}

.svg-placeholder {
    background: var(--bg-darker);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svg-placeholder img {
    max-width: 100%;
    height: auto;
}

.svg-placeholder span {
    color: var(--text-gray);
    font-style: italic;
}

/* Projects Section */
.projects-section {
    background: var(--bg-dark);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.2);
}

.project-image {
    margin-bottom: 1.5rem;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darker);
    border-radius: 8px;
}

.project-image img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.project-image span {
    font-size: 3rem;
}

.project-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.project-card p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--secondary-color);
    text-shadow: 0 0 5px var(--secondary-color);
}

/* Research Section */
.research-section {
    background: 
        radial-gradient(circle at 20% 80%, var(--primary-color)20 0%, transparent 50%),
        linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
}

.research-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.tab-btn {
    padding: 1rem 2rem;
    background: transparent;
    border: 2px solid var(--glass-border);
    color: var(--text-gray);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.tab-btn.active,
.tab-btn:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background: rgba(255, 215, 0, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.papers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.paper-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    transition: var(--transition);
}

.paper-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(255, 215, 0, 0.2);
}

.paper-image {
    margin-bottom: 1.5rem;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darker);
    border-radius: 8px;
}

.paper-image img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.paper-card h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.paper-card p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.paper-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.paper-link:hover {
    color: var(--secondary-color);
    text-shadow: 0 0 5px var(--secondary-color);
}

/* Contact Section */
.contact-section {
    background: var(--bg-dark);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.contact-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateY(-5px);
    border-color: var(--secondary-color);
}

.contact-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.contact-item h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.contact-item a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.contact-item a:hover {
    color: var(--secondary-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-darker);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    color: var(--text-gray);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.close:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 800px) {
    .nav-links {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .institute-grid,
    .projects-grid,
    .papers-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .research-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    /* Fix mobile section spacing and title positioning */
    section {
        padding: 4rem 0 3rem 0;
        margin-top: 70px; /* Account for fixed navbar */
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
        padding: 0.5rem 1rem;
        position: relative;
        z-index: 100;
    }
    
    /* Ensure content doesn't overlap with section titles */
    .container {
        position: relative;
        z-index: 1;
    }
}

@media (max-width: 480px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Scroll animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(var(--secondary-color), var(--primary-color));
}