body {
  font-family: Arial, sans-serif;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 60px; /* Height of the footer */
}

@font-face {
  font-family: Raleway;
  src: url('fonts/Raleway/Raleway-VariableFont_wght.ttf') format("truetype-variations");
  font-weight: 600;
  font-display: swap;
  font-variation-settings: "ital" 2;
}

@font-face {
  font-family: Gotham;
  src: url('fonts/Raleway/Raleway-VariableFont_wght.ttf') format("truetype-variations");
}

.hero {
  color: white;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero h1 {
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
  font-weight: 700;
}

.hero p {
  text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.7);
  font-weight: 500;
}

section h2 {
  margin-bottom: 20px;
  font-size: 2.5rem;
}

footer {
  position: relative;
  bottom: 0;
  width: 100%;
}

#firstSection {
  background-color: #3498db;
  background-image: linear-gradient(135deg, #5dade2 0%, #2980b9 100%);
  background-size: cover;
  background-position: center;
}

.useRaleway {
  font-family: Raleway, Arial, Helvetica, sans-serif;
}

.headshot {
  max-width: 300px
}

a.disabled {
  pointer-events: none;
}

.img-cover {
  object-fit: cover;
  height: 50% !important;
}

/* Enhance navbar with visual feedback */
.navbar {
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
padding: 0.75rem 1rem;
}

.navbar-brand {
font-weight: 600;
color: #333;
transition: color 0.3s ease;
}

.navbar-brand:hover {
color: #0d6efd;
}

.navbar-nav .nav-link {
position: relative;
transition: all 0.3s ease;
color: #333;
font-weight: 500;
padding: 0.5rem 1rem;
}

.navbar-nav .nav-link::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
width: 0;
height: 2px;
background-color: #0d6efd;
transition: all 0.3s ease;
transform: translateX(-50%);
opacity: 0.7;
}

.navbar-nav .nav-link:hover {
color: #0d6efd;
transform: translateY(-1px);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
width: 80%;
opacity: 1;
}

.navbar-nav .nav-link.active {
color: #0d6efd;
font-weight: 600;
}

/* Ensure proper spacing for navbar items */
.navbar-nav .nav-item {
margin: 0 0.25rem;
}

/* Responsive adjustments for navbar */
@media (max-width: 991.98px) {
.navbar-collapse {
  padding: 1rem 0;
}

.navbar-nav .nav-item {
  margin: 0.5rem 0;
}

/* Fix for mobile view - align underline with text */
.navbar-nav .nav-link::after {
  left: 0;
  transform: none;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
  width: 100%;
}
}

/* Back to top button */
/* #back-to-top {
z-index: 1000;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
} */

/* PDF viewer controls */
#current_page {
width: 60px;
text-align: center;
-moz-appearance: textfield; /* Firefox */
}

/* Remove arrows for Chrome, Safari, Edge, Opera */
#current_page::-webkit-outer-spin-button,
#current_page::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

.nav-tabs .rounded-circle {
transition: background-color 0.2s ease;
}

.nav-tabs .rounded-circle:hover {
background-color: #f8f9fa;
}

/* Social media links */
.social-links a {
font-size: 1.5rem;
transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
color: #0d6efd !important;
transform: translateY(-3px);
}

/* for Masonry grid */

* { box-sizing: border-box; }

.grid:after {
content: '';
display: block;
clear: both;
}

.grid-sizer,
.grid-item {
width: 33.333%;
}
@media (max-width: 575px) {
.grid-sizer,
.grid-item {
  width: 100%;
}

section {
  padding: 3rem 1rem !important;
}

.headshot {
  max-width: 200px;
}

h1 {
  font-size: 2rem !important;
}

h2 {
  font-size: 1.75rem !important;
}
}
@media (min-width: 576px) and (max-width: 767px) {
.grid-sizer,
.grid-item {
  width: 50%;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.grid-sizer,
.grid-item {
  width: 50%;
}
}
@media (min-width: 992px) {
.grid-sizer,
.grid-item {
  width: 33.333%;
}
}

.grid-item {
float: left;
background-size: cover;
}

.grid-item img {
z-index: 0;
display: block;
max-width: 100%;
opacity: 0;
transition: opacity 0.5s ease;
}

.grid-item img.loaded {
opacity: 1;
}

.grid-item p {
z-index: 1;
}

.container-sm {
  height: auto;
  overflow: visible;
}

/* Grid container to prevent overflow issues */
.grid {
  overflow: visible;
  height: auto !important;
  min-height: 200px;
}

#pdf-links-container > a:hover {
opacity: 0.2;
background: #ff0;
box-shadow: 0px 2px 10px #ff0;
}

section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Research section container fixes */
#research,
#research .container,
#research .container-sm,
.grid {
  height: auto !important;
  min-height: 200px;
  overflow: visible !important;
  position: relative;
}

/* Ensure content displays properly */
.grid {
  display: block;
  overflow: hidden;
  margin-bottom: 20px;
}

#pdf-links-container > a:hover {
opacity: 0.2;
background: #ff0;
box-shadow: 0px 2px 10px #ff0;
}

/* Advanced Masonry Grid Styles with Animations */
.grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
}

.grid-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.grid-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
    filter: grayscale(0%);
}

.grid-item:hover img {
    transform: scale(1.05);
    filter: grayscale(100%);
}

.grid-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 20px 20px 30px 20px; /* Added padding at bottom to make room for attribution */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.grid-item:hover .grid-item-overlay {
    opacity: 1;
    transform: translateY(0);
}

.grid-item-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1.1rem;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s ease 0.1s;
    font-family: Raleway, Arial, Helvetica, sans-serif;
}

.grid-item:hover .grid-item-title {
    transform: translateY(0);
    opacity: 1;
}

.grid-item-description {
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.2s;
}

.grid-item:hover .grid-item-description {
    opacity: 0.9;
    transform: translateY(0);
}

/* Research Category Badge */
.research-category {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(13, 110, 253, 0.8);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 10;
    opacity: 1; /* Always visible */
    font-family: Raleway, Arial, Helvetica, sans-serif;
}

/* Interactive Elements with Advanced Animations */
.grid-item-details {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 20px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 20;
    backdrop-filter: blur(5px);
    overflow: auto !important; /* Allow scrolling when content is too large */
}

.grid-item:hover .grid-item-details {
    opacity: 1;
    transform: scale(1);
}

.grid-item-details-title {
    font-size: 1.1rem !important; /* Smaller font size */
    font-weight: 600;
    margin-bottom: 8px !important;
    width: 100% !important; /* Full width */
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important; /* Add ellipsis for long titles */
    white-space: nowrap !important; /* Prevent wrapping */
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease 0.1s;
    font-family: Raleway, Arial, Helvetica, sans-serif;
}

.grid-item:hover .grid-item-details-title {
    transform: translateY(0);
    opacity: 1;
}

.grid-item-details-description {
    font-size: 0.85rem !important; /* Smaller text */
    width: 100% !important;
    max-height: 120px !important; /* Limit height */
    overflow-y: auto !important; /* Add vertical scrolling */
    margin-bottom: 15px !important;
    padding-right: 5px !important; /* Room for scrollbar */
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease 0.2s;
}

.grid-item:hover .grid-item-details-description {
    transform: translateY(0);
    opacity: 1;
}

/* Hide scrollbar for cleaner look but maintain functionality */
.grid-item-details-description::-webkit-scrollbar {
    width: 4px;
}

.grid-item-details-description::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.grid-item-details-button {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 0.4rem 1.2rem !important;
    font-size: 0.9rem !important;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease 0.3s;
}

.grid-item:hover .grid-item-details-button {
    transform: translateY(0);
    opacity: 1;
}

.grid-item-details-button:hover {
    background: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

@media (max-width: 576px) {
    /* Mobile grid styling */
    .grid-item {
        margin-bottom: 15px;
        cursor: pointer;
        transform: none !important;
        opacity: 1 !important;
    }

    /* Ensure content has proper visibility and position */
    .grid-item-details,
    .grid-item-details-title,
    .grid-item-details-description {
        display: none !important; /* Hide all details on the main grid item */
    }

    /* Make overlay always visible with basic info */
    .grid-item-overlay {
        opacity: 1 !important;
        transform: translateY(0) !important;
        padding: 10px;
        background: linear-gradient(to top, rgba(0,0,0,0.8) 50%, rgba(0,0,0,0.4) 100%);
        height: auto;
        min-height: 60px;
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .grid-item-title, .grid-item-description {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    .grid-item-title {
        font-size: 0.9rem;
        margin-bottom: 0; /* Remove margin to align with "Tap for details" */
        margin-right: 5px; /* Add some spacing between title and "Tap for details" */
        flex: 1; /* Allow title to take available space */
    }

    .grid-item-description {
        font-size: 0.8rem;
        display: none !important; /* Hide description text on mobile */
    }

    /* Add button to view details - now inline with title */
    .grid-item-overlay:after {
        content: "Tap for details";
        font-size: 0.7rem;
        color: rgba(255,255,255,0.8);
        text-align: right;
        white-space: nowrap; /* Prevent wrapping */
        position: static; /* Remove absolute positioning */
    }

    /* Mobile Research Modal */
    .mobile-research-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.9);
        z-index: 1050;
        display: none;
        padding: 1rem;
        overflow-y: auto;
        cursor: pointer; /* Indicate it's clickable for closing */
    }

    .mobile-research-modal.active {
        display: block;
    }

    .mobile-modal-content {
        background: #222;
        border-radius: 10px;
        padding: 20px;
        color: white;
        position: relative;
        margin: 2rem auto;
        max-width: 90%;
        cursor: default; /* Reset cursor for content area */
    }

    .mobile-modal-image-container {
        position: relative;
        margin-bottom: 25px;
    }

    .mobile-modal-image {
        width: 100%;
        height: auto;
        max-height: 200px;
        object-fit: contain;
        background-color: #fff;
        border-radius: 5px;
    }

    .modal-category {
        display: none !important; /* Hide category in mobile modal */
    }

    .mobile-modal-title {
        font-size: 1.2rem;
        margin-bottom: 10px;
        font-weight: 600;
        font-family: Raleway, Arial, Helvetica, sans-serif;
    }

    .mobile-modal-description {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .mobile-modal-close {
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(0,0,0,0.3);
        border: none;
        color: white;
        font-size: 1.5rem;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        line-height: 0;
        cursor: pointer;
        z-index: 10;
    }

    .mobile-modal-close:hover {
        background: rgba(255,0,0,0.5);
    }

    /* Mobile attribution styling */
    .mobile-attribution {
        position: relative !important;
        transform: translateY(0) !important;
        margin-top: 5px;
        font-size: 0.7rem;
        background: rgba(0, 0, 0, 0.7);
        padding: 4px 8px;
        border-radius: 0 0 5px 5px;
        text-align: center;
    }

    #aboutme, #research, #cv {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Keep vertical padding */
    #aboutme, #research, #cv {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    /* for CV, reduce horizontal padding */
    #cv, #cv .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100%;
    }

    /* Adjust container width */
    #aboutme .container, #research .container {
        padding-left: 5px;
        padding-right: 5px;
        max-width: 100%;
    }
}

/* Image Attribution Styling */
.image-container {
    position: relative;
    overflow: hidden;
}

.attribution-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.7rem;
    padding: 4px 8px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    text-align: center;
    z-index: 2;
}

/* Modified to show attribution with the overlay on hover */
.grid-item:hover .attribution-text {
    transform: translateY(0);
    z-index: 25; /* Higher than the grid-item-overlay z-index */
}

.image-container:hover .attribution-text {
    transform: translateY(0);
}

/* For desktop only - not mobile */
@media (min-width: 577px) {
    .grid-item-details .attribution-text {
        position: absolute;
        bottom: 10px;
        transform: translateY(0);
        background: transparent;
        font-size: 0.7rem;
        padding: 4px 8px;
        text-align: center;
        z-index: 25; /* Above other content */
        opacity: 0;
        transition: opacity 0.3s ease 0.3s;
    }

    .grid-item:hover .grid-item-details .attribution-text {
        opacity: 1;
    }

    /* Wider Research section on desktop */
    #research {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Allow container to be wider on large screens */
    @media (min-width: 1200px) {

        /* #cv {
          padding-left: 2rem !important;
          padding-right: 2rem !important;
        } */

        #research .container, #cv .container {
            max-width: 1800px; /* Wider than Bootstrap's default 1140px */
        }

        #research .container-sm {
            max-width: 1750px; /* Wider container for the grid */
        }

        /* Ensure the CV canvas has more horizontal space */
        #cv canvas {
            max-width: 95%;
        }
    }
}
