/* 
 * Professor Binayak S Choudhury - Personal Academic Website
 * Stylesheet matching home.png layout and multi-level dynamic dropdown navigation
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800;900&family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --banner-bg: #0e2240;
    --banner-text: #ffffff;
    --nav-bg: #b7b7b7;
    --nav-bg-hover: #9e9e9e;
    --nav-text: #ffffff;
    --nav-dropdown-bg: #1e293b;
    --nav-dropdown-hover: #334155;
    --nav-dropdown-text: #f8fafc;
    --about-blue: #1c4587;
    --text-primary: #111111;
    --link-color: #0056b3;
    --link-hover: #003366;
    --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

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

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text-primary);
    line-height: 1.6;
}

body {
    display: flex;
    flex-direction: column;
    /* Exact multi-stop vertical gradient sampled from home.png */
    background: linear-gradient(
        180deg,
        #adb2db 0%,
        #cbc1db 6%,
        #e8d0dc 12%,
        #ebc3c3 19%,
        #ecac9d 28%,
        #ed9879 38%,
        #e1b5a4 48%,
        #d1dfde 60%,
        #dedbb7 72%,
        #ead791 84%,
        #f2d476 92%,
        #fad15c 100%
    );
    background-attachment: fixed;
    background-size: cover;
}

/* ==========================================================================
   1. Top Banner (matching home.png)
   ========================================================================== */
.top-banner {
    background-color: var(--banner-bg);
    background: linear-gradient(135deg, #0e2240 0%, #163660 50%, #1c4587 100%);
    color: var(--banner-text);
    padding: 16px 20px;
    text-align: center;
    border-bottom: 3px solid #c5a059;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.top-banner h1, .top-banner .banner-title {
    font-family: var(--font-heading);
    font-size: clamp(1.05rem, 2.2vw, 1.65rem);
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0;
    line-height: 1.35;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   2. Horizontal Multi-Level Navigation Bar
   ========================================================================== */
.navbar-container {
    background-color: var(--nav-bg);
    background: linear-gradient(180deg, #c4c4c4 0%, #b7b7b7 50%, #ababab 100%);
    border-top: 1px solid #dcdcdc;
    border-bottom: 2px solid #949494;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.nav-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    position: relative;
}

/* Horizontal Main Menu */
.main-nav {
    display: flex;
    list-style: none;
    margin: 0 auto;
    padding: 0;
    width: 100%;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    position: relative;
    flex: 1;
    text-align: center;
}

.nav-link {
    display: block;
    padding: 12px 16px;
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 1.6vw, 1.45rem);
    font-weight: 700;
    color: var(--nav-text);
    text-decoration: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.35);
    transition: all 0.25s ease-in-out;
    white-space: nowrap;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-item:first-child .nav-link {
    border-left: none;
}

.nav-item:last-child .nav-link {
    border-right: none;
}

.nav-link:hover, .nav-item.active > .nav-link {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.caret-icon {
    font-size: 0.75em;
    margin-left: 6px;
    transition: transform 0.2s ease;
}

.nav-item:hover > .nav-link .caret-icon {
    transform: rotate(180deg);
}

/* ==========================================================================
   Multi-Level Dropdown Menus (Level 2 & Level 3+)
   ========================================================================== */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background-color: var(--nav-dropdown-bg);
    list-style: none;
    padding: 8px 0;
    margin: 0;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1010;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-item:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    position: relative;
}

.dropdown-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    color: var(--nav-dropdown-text);
    text-decoration: none;
    font-size: 0.95rem;
    font-family: var(--font-heading);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.dropdown-link:hover {
    background-color: #2563eb;
    color: #ffffff;
    padding-left: 22px;
}

/* Nested Submenu (Level 3+) */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    border-radius: 6px;
    transform: translateX(10px);
}

.dropdown-submenu:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.submenu-arrow {
    font-size: 0.7em;
    margin-left: 8px;
}

/* Mobile Nav Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
}

/* ==========================================================================
   3. Main Content & Landing Page Grid (Exact home.png Layout)
   ========================================================================== */
.main-wrapper {
    flex: 1;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

.home-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 28px;
    align-items: start;
}

/* Left Sidebar Card ("About Me" + Poster Image) */
.about-sidebar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 180px;
}

.about-header-box {
    background-color: var(--about-blue);
    background: #1c4587;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    padding: 8px 12px;
    border: 1px solid #133366;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.about-card-image {
    width: 100%;
    display: block;
    background-color: #0f172a;
    border: 1px solid #133366;
    border-top: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.about-card-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.about-card-image:hover img {
    transform: scale(1.02);
}

/* Right Content Area */
.home-content-area {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.academic-paragraph {
    font-family: var(--font-body);
    font-size: 1.02rem;
    line-height: 1.62;
    color: #1a1a1a;
    text-align: justify;
    margin: 0;
}

.academic-paragraph a {
    color: var(--link-color);
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.academic-paragraph a:hover {
    color: var(--link-hover);
    text-decoration: underline;
    font-weight: 600;
}

/* ==========================================================================
   4. Inner Pages (Research, PhD Students, Language, Contact)
   ========================================================================== */
.page-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
    margin-bottom: 25px;
}

.page-title-section {
    border-bottom: 2px solid #df6e42;
    padding-bottom: 12px;
    margin-bottom: 24px;
}

.page-title-section h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: #1a3c6c;
}

.domain-card {
    background: #ffffff;
    border-left: 4px solid #1a3c6c;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.domain-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.domain-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a3c6c;
    margin-bottom: 6px;
}

.domain-category {
    display: inline-block;
    background: #e2e8f0;
    color: #334155;
    padding: 3px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 10px;
}

.publication-item {
    padding: 14px 0;
    border-bottom: 1px dashed #cbd5e1;
}

.publication-item:last-child {
    border-bottom: none;
}

.pub-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.05rem;
}

.pub-authors {
    color: #475569;
    font-size: 0.95rem;
}

.pub-journal {
    color: #64748b;
    font-style: italic;
    font-size: 0.92rem;
}

/* Table styling for PhD students */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.custom-table th {
    background-color: #1a3c6c;
    color: #ffffff;
    padding: 12px 16px;
    text-align: left;
    font-family: var(--font-heading);
    font-size: 0.95rem;
}

.custom-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

.custom-table tr:hover {
    background-color: #f8fafc;
}

.badge-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-awarded {
    background: #dcfce7;
    color: #166534;
}

.badge-ongoing {
    background: #fef3c7;
    color: #92400e;
}

/* Contact Form */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #334155;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.btn-primary {
    background-color: #1a3c6c;
    color: #ffffff;
    padding: 12px 26px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background-color: #0f2747;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #fecaca;
}

/* ==========================================================================
   Contact Page Layout & Academic Repositories
   ========================================================================== */
.contact-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 15px;
}

@media (max-width: 860px) {
    .contact-layout-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

.contact-affiliation-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.contact-section-heading {
    font-family: var(--font-heading);
    color: #1a3c6c;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.contact-info-list {
    margin-bottom: 20px;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.98rem;
    color: #334155;
}

.contact-info-icon {
    color: #2563eb;
    font-size: 1.1rem;
    width: 20px;
    margin-top: 3px;
    flex-shrink: 0;
}

/* Academic Repositories Section */
.academic-repos-container {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed #cbd5e1;
}

.academic-repos-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a3c6c;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.academic-repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.repo-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 10px;
    text-decoration: none;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.repo-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    transition: width 0.25s ease;
}

.repo-btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.repo-btn-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

.repo-btn-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1e293b;
    transition: color 0.2s ease;
}

.repo-btn-subtitle {
    font-size: 0.76rem;
    color: #64748b;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.repo-btn-arrow {
    color: #94a3b8;
    font-size: 0.85rem;
    transition: transform 0.2s ease, color 0.2s ease;
    margin-left: auto;
}

/* Google Scholar */
.repo-btn-scholar::before {
    background: #4285f4;
}
.repo-btn-scholar .repo-btn-icon {
    background: rgba(66, 133, 244, 0.12);
    color: #1a73e8;
}
.repo-btn-scholar:hover {
    border-color: #4285f4;
    background: #f8faff;
    box-shadow: 0 6px 18px rgba(66, 133, 244, 0.18);
    transform: translateY(-2px);
}
.repo-btn-scholar:hover::before {
    width: 6px;
}
.repo-btn-scholar:hover .repo-btn-title {
    color: #1a73e8;
}
.repo-btn-scholar:hover .repo-btn-icon {
    transform: scale(1.1);
}
.repo-btn-scholar:hover .repo-btn-arrow {
    color: #1a73e8;
    transform: translate(2px, -2px);
}

/* ResearchGate */
.repo-btn-researchgate::before {
    background: #00ccbb;
}
.repo-btn-researchgate .repo-btn-icon {
    background: rgba(0, 204, 187, 0.12);
    color: #008f82;
}
.repo-btn-researchgate:hover {
    border-color: #00ccbb;
    background: #f4fdfc;
    box-shadow: 0 6px 18px rgba(0, 204, 187, 0.18);
    transform: translateY(-2px);
}
.repo-btn-researchgate:hover::before {
    width: 6px;
}
.repo-btn-researchgate:hover .repo-btn-title {
    color: #008f82;
}
.repo-btn-researchgate:hover .repo-btn-icon {
    transform: scale(1.1);
}
.repo-btn-researchgate:hover .repo-btn-arrow {
    color: #008f82;
    transform: translate(2px, -2px);
}

/* ORCID */
.repo-btn-orcid::before {
    background: #a6ce39;
}
.repo-btn-orcid .repo-btn-icon {
    background: rgba(166, 206, 57, 0.15);
    color: #6d8e13;
}
.repo-btn-orcid:hover {
    border-color: #a6ce39;
    background: #fbfdf5;
    box-shadow: 0 6px 18px rgba(166, 206, 57, 0.2);
    transform: translateY(-2px);
}
.repo-btn-orcid:hover::before {
    width: 6px;
}
.repo-btn-orcid:hover .repo-btn-title {
    color: #5c7810;
}
.repo-btn-orcid:hover .repo-btn-arrow {
    color: #5c7810;
    transform: translate(2px, -2px);
}

/* ==========================================================================
   5. Footer
   ========================================================================== */
.site-footer {
    background: rgba(30, 41, 59, 0.9);
    color: #94a3b8;
    padding: 24px 20px;
    text-align: center;
    font-size: 0.9rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-footer a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

/* ==========================================================================
   6. Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
    .mobile-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #1e293b;
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    }

    .main-nav.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        text-align: left;
    }

    .nav-link {
        padding: 14px 20px;
        border-left: none;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: #0f172a;
        display: none;
        padding-left: 15px;
    }

    .dropdown-menu.mobile-open {
        display: block;
    }

    .dropdown-submenu > .dropdown-menu {
        position: static;
        transform: none;
        background-color: #090d16;
        padding-left: 15px;
    }

    .home-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .about-sidebar {
        width: 220px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .top-banner {
        padding: 10px 12px;
    }

    .top-banner h1 {
        font-size: 1rem;
    }

    .main-wrapper {
        padding: 16px 12px;
    }

    .academic-paragraph {
        font-size: 0.95rem;
        text-align: left;
    }
}
