:root {
    --blue1: #3b82f6;
    --blue2: #2563eb;
    --blue3: rgba(37, 99, 235, 0.4);
    --blue4: rgba(59, 130, 246, 0.5);
    --blue5: #1d4ed8; 
    --blue6: rgba(37, 99, 235, 0.4);
    --blue7: rgba(37, 99, 235, 0.3);
    --blue8: rgba(37, 99, 235, 0.2);
    --blue9: rgba(37, 99, 235, 0.1);
    /* --blue5: #1d4ed8; */
    
    /* Origignal Cyan color scheme
    --cyan1: #00ffff;
    --cyan2: #00e6e6;
    --cyan3: rgba(0, 180, 180, 0.4)
    --cyan4: (0, 255, 255, 0.5);
    --cyan5: #00b3b3;
    --cyan6: rgba(0, 255, 255, 0.4);
    --cyan7: rgba(0, 255, 255, 0.3);
    
     */
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.project-card {
    aspect-ratio: 1/1;
    min-height: 350px;
    background: #1e293b;  
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);  
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}


.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.project-image-container {
    height: 55%;
    overflow: hidden;
    background-color: #f3f4f6;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image {
    transform: scale(1.1);
} 

.project-content {
    height: 60%;
    padding: 1.25rem;
    padding-bottom: 15px;
    display: flex;
    flex-direction: column;
    background: #2d2d2d;  
    position: relative;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f0f0f0;  
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.project-description {
    font-size: 0.95rem;
    color: #b5b6b6;  
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* logo section styles */
.project-logos {
    margin-top: auto;  /* Pushes logos to the bottom */
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    
}

.project-logos-modal {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 1rem;
    padding-bottom: 1rem;
    padding-left: 1rem; 
    text-decoration: none;
}

.project-logo-item {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

a.project-logo-item {
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

/* Custom tooltip */
.project-logo-item::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    padding: 3px 7px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.project-logo-item:hover::after {
    opacity: 1;
}

.project-logo-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
}

.project-logo-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/*  "more" indicator for many logos */
.project-logos-more {
    font-size: 0.5rem;
    color: #b5b6b6;
    padding: 0 4px;
}

/* Plus logo special styling */
.project-logo-item.plus-logo {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.plus-text {
    font-size: 14px;
    font-weight: 600;
    color: #00ffff;
}

.plus-count {
    font-size: 12px;
    font-weight: 500;
    color: #00ffff;
    margin-left: 2px;
}



/* Modal Styles */
.project-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.project-modal.active {
    display: block;
}

.modal-content {
    position: relative;
    background: #232323;  
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.4s ease;
}

.modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2.5rem;
    font-weight: 300;
    color: #64748b;  
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #f1f5f9;  
}

.modal-header {
    margin-bottom: 2rem;
    padding-right: 2rem;
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;  
    margin: 0 0 1rem 0;
}

.modal-metadata {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.modal-badge.course {
    background-color: #0c4a6e;
    color: #bae6fd;
    border: 1px solid #0369a1;
}

.modal-badge.organization {
    background-color: #4c1d95;
    color: #ddd6fe;
    border: 1px solid #6d28d9;
}

.modal-badge.personal {
    background-color: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
}

.modal-badge.group {
    background-color: #1e3a8a;
    color: #bfdbfe;
    border: 1px solid #2563eb;
}

.modal-badge.hackathon {
    background-color: #854d0e;
    color: #fef9c3;
    border: 1px solid #a16207;
}

.modal-badge.research {
    background-color: #14532d;
    color: #bbf7d0;
    border: 1px solid #166534;
}

.modal-date {
    display: inline-block;
    padding: 0.35rem 1rem;
    background-color: #1e293b;  
    color: #cbd5e1;  
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #334155;
}

.modal-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.modal-skill-tag {
    background-color: #334155;  
    color: var(--blue1);  
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #475569;
}

.modal-body {
    color: #f0f0f0;  
    line-height: 1.7;
}

.modal-body h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
}

.modal-body h3:first-of-type {
    margin-top: 0;
}

.modal-body p {
    margin: 0 0 1.5rem 0;
    font-size: 1.05rem;
    text-decoration: none;
}

.modal-body ul {
    margin: 0 0 1.5rem 0;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-inline-image {
    width: 100%;
    object-fit: cover;
    border-radius: 12px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.modal-pdf-section {
    margin-top: 2.5rem;
    text-align: center;
}

.modal-pdf-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--blue1);
    /* color: #232323;  */
    color: white;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
}

/* Override the global visited style for project PDF buttons */
.modal-pdf-button:visited {
    color: white !important; /* Keep the same dark color even when visited */
}

.modal-pdf-button:hover,
.modal-pdf-button:visited:hover {
    background-color: var(--blue2);
    color: #232323; /* Keep dark text on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 10px -1px var(--blue3);
}

.modal-pdf-arrow {
    transition: transform 0.2s ease;
}

.modal-pdf-button:hover .modal-pdf-arrow {
    transform: translateX(4px);
}

.modal-gh-repo-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #6b99b2;
    /* color: #232323;  */
    color: white;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
}

/* Override the global visited style for project PDF buttons */
.modal-gh-repo-button:visited {
    color: white !important; /* Keep the same dark color even when visited */
}

.modal-gh-repo-button:hover,
.modal-gh-repo-button:visited:hover {
    background-color: #86b4ae;
    color: #232323; /* Keep dark text on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 10px -1px var(--blue3);
}

.modal-gh-repo-arrow {
    transition: transform 0.2s ease;
}

.modal-gh-repo-button:hover .modal-pdf-arrow {
    transform: translateX(4px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 640px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
        width: 95%;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-body h3 {
        font-size: 1.2rem;
    }
    
    .modal-close {
        right: 1rem;
        top: 0.5rem;
    }
}


/* Project page specific link colors */
.project-advisor-link,
.project-content .content-link,
.projects-page .content-link {
    color: var(--blue1);
}

/* Stays original link color after being visited */
.project-advisor-link:visited,
.project-content .content-link:visited,
.projects-page .content-link:visited {
    color: var(--blue1); 
}

.project-advisor-link:hover,
.project-content .content-link:hover,
.projects-page .content-link:hover {
    color: #ffffff;
    text-shadow: 0 0 8px var(--blue4);
}

/* ============================================= */
/* VIDEO/LAUNCH BUTTON STYLES */
/* ============================================= */

.video-button-container {
    text-align: center;
    margin: 2rem 0 1rem 0;
    width: 100%;
}

.launch-video-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--blue1);
    background-origin: border-box;
    color: var(--color-cream);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 50px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--blue7);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.launch-video-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--blue4);
    background: linear-gradient(135deg, var(--blue5), var(--blue-color));
    color: white;
}

.launch-video-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--blue6);
}

.ph-website-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #6b99b2;
    background-origin: border-box;
    color: var(--color-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 50px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--blue7);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ph-website-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--blue4);
    background: linear-gradient(135deg, #86b4ae, #6b99b2);
    color: #232323;
}

.ph-website-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px #86b4ae;
}

/* pulsing animation */
@keyframes pulse-cyan {
    0% {
        box-shadow: 0 0 0 0 var(--blue5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 255, 0);
    }
}

.launch-video-btn {
    animation: pulse-cyan 2s infinite;
}

.launch-video-btn:hover {
    animation: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .video-button-container {
        margin: 1.5rem 0;
    }
    
    .launch-video-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        width: auto;
        min-width: 250px;
    }

    .ph-website-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        width: auto;
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    .launch-video-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        min-width: 200px;
        width: 100%;
        max-width: 300px;
    }

    .ph-website-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        min-width: 200px;
        width: 100%;
        max-width: 300px;
    }
}

/* ============================================= */
/*                 GALLERY STYLES                */
/* ============================================= */

/* Gallery grid - 2 columns */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

/* Gallery item */
.gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px var(--blue7);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Gallery overlay on hover */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--blue8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Gallery caption */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    font-size: 0.9rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* Lightbox styles */
.gallery-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    overflow: auto;
}

.gallery-lightbox.active {
    display: block;
}

.gallery-lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    box-shadow: 0 0 30px var(--blue8);
}

.gallery-close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s ease, transform 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

.gallery-close-btn:hover {
    color: var(--blue-color);
    transform: rotate(90deg);
    background: var(--blue9);
}

#gallery-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: white;
    padding: 10px 0;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Loading indicator */
.gallery-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-loading i {
    color: var(--blue-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Navigation for lightbox */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.gallery-nav:hover {
    background: var(--blue-color);
    color: black;
    transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-close-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .gallery-prev {
        left: 10px;
    }
    
    .gallery-next {
        right: 10px;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .gallery-lightbox-content {
        box-shadow: 0 0 30px var(--blue7);
    }
}