/* Project Page Styles */
.project-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(40px, 4vw, 60px) 1.5rem 4rem 1.5rem;
    text-align: left;
    font-family: 'Inter', 'Arial', sans-serif;
}
.project-title {
    font-size: 2.7rem;
    font-weight: 800;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #40C0FF, #7F7FFF 80%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    letter-spacing: -1px;
}
.project-sub-title {
    font-size: 1.3rem;
    font-weight: 400;
    color: #5a6b7a;
    margin-bottom: 2.5rem;
    font-style: italic;
    letter-spacing: 0.01em;
}
.project-section-heading {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #3a4a6b;
    letter-spacing: 0.01em;
}
.project-sub-heading {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #40C0FF;
    letter-spacing: 0.01em;
}
.project-text {
    font-size: 1.05rem;
    color: #2d3748;
    line-height: 1.7;
    margin-bottom: 1.2rem;
}
.project-list {
    margin: 0 0 1.5rem 1.5rem;
    padding: 0;
    color: #2d3748;
    font-size: 1.05rem;
    line-height: 1.7;
}
.project-list li {
    margin-bottom: 0.4rem;
}
.project-annotation {
    background: linear-gradient(90deg, #e0f7fa 60%, #f3e8ff 100%);
    color: #3a4a6b;
    border-left: 4px solid #40C0FF;
    padding: 0.9rem 1.2rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-size: 1rem;
    position: relative;
    transition: all 0.3s ease;
}
.project-annotation:hover {
    background: linear-gradient(90deg, #d0f0f5 60%, #e8d8ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 192, 255, 0.15);
}
.annotation-label {
    font-size: 0.85em;
    font-weight: 700;
    color: #40C0FF;
    text-transform: uppercase;
    margin-right: 0.7em;
    letter-spacing: 0.05em;
}
.project-video-section {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}
.video-container {
    position: relative;
    display: block;
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(64,192,255,0.10);
    transition: all 0.3s ease;
}
.video-container:hover {
    box-shadow: 0 12px 40px rgba(64,192,255,0.15);
    transform: translateY(-2px);
}
.audio-toggle-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(8px);
}
.audio-toggle-btn:hover {
    background: linear-gradient(135deg, #FF00FF, #C040FF, #8080FF, #40C0FF);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(64, 192, 255, 0.3);
}
.audio-toggle-btn:active {
    transform: scale(0.95);
}
.audio-toggle-btn.audio-on {
    background: linear-gradient(135deg, #FF00FF, #C040FF, #8080FF, #40C0FF);
    border-color: rgba(255, 255, 255, 0.9);
}
.audio-toggle-btn.audio-on .audio-icon {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.project-video {
    width: 100%;
    max-width: 1200px;
    border-radius: 24px;
    background: #000;
    transition: all 0.3s ease;
    display: block;
}
.project-video:hover {
    box-shadow: 0 12px 40px rgba(64,192,255,0.15);
    transform: translateY(-2px);
}
.project-info-float {
    position: absolute;
    top: 15%;
    left: 20%;
    min-width: 220px;
    padding: 1rem 1.5rem;
    background: rgba(40,60,100,0.85);
    color: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(64,192,255,0.15);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.1s;
    z-index: 2;
    font-size: 1rem;
    text-align: left;
    backdrop-filter: blur(8px);
} 

.project-video-container {
    position: relative;
    display: inline-block;
}

.main-video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
}

.video-overlay {
    position: fixed;
    pointer-events: none;
    opacity: 0;
    background: rgba(24, 24, 24, 0.92);
    color: #fff;
    border-radius: 12px;
    padding: 1.2rem 2rem;
    z-index: 2000;
    min-width: 220px;
    max-width: 320px;
    transition: opacity 0.2s;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    text-align: left;
    font-size: 1rem;
    left: 0;
    top: 0;
    backdrop-filter: blur(8px);
}

.video-overlay h3 {
    color: #40C0FF;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.video-overlay p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.video-overlay strong {
    color: #7F7FFF;
    font-weight: 600;
}

.home-btn {
    position: fixed;
    top: 24px;
    left: 32px;
    z-index: 1100;
    padding: 0.45rem 1.3rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(90deg, rgba(64,192,255,0.75), rgba(127,127,255,0.75) 80%);
    border: none;
    outline: none;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(64,192,255,0.12);
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
    letter-spacing: 0.01em;
}
.home-btn:hover {
    background: linear-gradient(90deg, rgba(127,127,255,0.85) 0%, rgba(64,192,255,0.85) 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(64,192,255,0.18);
    transform: translateY(-2px);
}

/* Enhanced Link Styling */
.project-text a,
.project-annotation a {
    color: #8C979A;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.project-text a:hover,
.project-annotation a:hover {
    color: #7F7FFF;
    border-bottom: 2px solid #7F7FFF;
    transform: translateY(-1px);
}

.project-text a::before,
.project-annotation a::before {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, #40C0FF, #7F7FFF);
    transition: width 0.3s ease;
    z-index: -1;
}

.project-text a:hover::before,
.project-annotation a:hover::before {
    width: 100%;
}

/* External link indicator */
.project-text a[href^="http"],
.project-annotation a[href^="http"] {
    position: relative;
}

.project-text a[href^="http"]::after,
.project-annotation a[href^="http"]::after {
    content: '↗';
    margin-left: 0.2em;
    font-size: 1em;
    opacity: 0.7;
    transition: all 0.3s ease;
    vertical-align: baseline;
    display: inline-block;
}


.project-text a[href^="http"]:hover::after,
.project-annotation a[href^="http"]:hover::after {
    opacity: 1;
    transform: translate(2px, -2px);
}

/* Embedded Content Styles */
.embedded-content {
    margin: 2rem 0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.embedded-content:hover {
    box-shadow: 0 20px 60px rgba(64,192,255,0.15);
    transform: translateY(-2px);
}

.embedded-iframe {
    width: 100%;
    height: 600px;
    border: none;
    background: #f8f9fa;
    display: block;
}

.embedded-iframe.full-height {
    height: 100vh;
    min-height: 600px;
}

.embedded-iframe.medium-height {
    height: 500px;
}

.embedded-iframe.small-height {
    height: 400px;
}

.embedded-content-header {
    background: linear-gradient(90deg, #f8f9fa, #e9ecef);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.embedded-content-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #3a4a6b;
    margin: 0;
}

.embedded-content-controls {
    display: flex;
    gap: 0.5rem;
}

.embedded-btn {
    padding: 0.3rem 0.8rem;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #6c757d;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.embedded-btn:hover {
    background: #40C0FF;
    color: #fff;
    border-color: #40C0FF;
    transform: translateY(-1px);
}

/* Loading state for embedded content */
.embedded-content.loading {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.embedded-content.loading::after {
    content: 'Loading...';
    color: #6c757d;
    font-size: 1rem;
}

/* Responsive iframe adjustments */
@media (max-width: 768px) {
    .embedded-iframe {
        height: 400px;
    }
    
    .embedded-iframe.full-height {
        height: 70vh;
    }
    
    .embedded-iframe.medium-height {
        height: 350px;
    }
    
    .embedded-iframe.small-height {
        height: 300px;
    }
    
    .embedded-content-header {
        padding: 0.8rem 1rem;
    }
    
    .embedded-content-title {
        font-size: 1rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .project-page {
        padding: clamp(35px, 3.5vw, 50px) 1rem 3rem 1rem;
    }
    
    .project-title {
        font-size: 2.2rem;
    }
    
    .project-sub-title {
        font-size: 1.1rem;
    }
    
    .project-section-heading {
        font-size: 1.3rem;
    }
    
    .project-text {
        font-size: 1rem;
    }
    
    .home-btn {
        top: 16px;
        left: 16px;
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
    
    .video-overlay {
        min-width: 200px;
        max-width: 280px;
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .project-page {
        padding: clamp(30px, 3vw, 40px) 1rem 2rem 1rem;
    }
    
    .project-title {
        font-size: 1.8rem;
    }
    
    .project-sub-title {
        font-size: 1rem;
    }
    
    .project-video {
        border-radius: 16px;
    }
}

.project-image-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: stretch;
    margin: 2.5rem 0;
    flex-wrap: nowrap;
}

.project-figure {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.project-img {
    border-radius: 16px;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    flex: 1 1 auto;
    min-height: 0;
}

.project-caption {
    font-size: 0.8rem;
    color: #5a6b7a;
    padding: 1.0rem 0.2rem;
    text-align: center;
    font-style: italic;
    width: 100%;
    letter-spacing: 0.01em;
}

@media (max-width: 900px) {
    .project-image-row {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
    }
    .project-figure {
        max-width: 100%;
    }
}

table {
    border-collapse: collapse;
    margin: 2em 0;
    font-size: 1.1em;
    width: 100%;
    background: #fff;
}
th, td {
    border: 2px solid #222;
    padding: 0.5em 1em;
    text-align: center;
}
th {
    background: #f8f9fa;
    font-weight: bold;
}
td {
    font-size: 1em;
}

caption,
.table-caption {
    caption-side: top;
    text-align: left;
    font-size: 0.8em;
    font-weight: 600;
    color: #8C979A;
    padding: 0.5em 0 0.5em 0.2em;
    background: none;
    letter-spacing: 0.01em;
}

.gallery-section {
    margin: 2rem 0;
    padding: 0 0%;
    overflow: visible;
}
  
.gallery-container {
    display: flex;
    overflow-x: auto;
    overflow-y: visible;
    gap: 3rem;
    padding: 3rem 3rem 3rem 3rem; /* Increased padding for hover effects */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    position: relative;
    transition: all 0.3s ease;
    margin: 0 -1rem; /* Negative margin to allow overflow */
}

.gallery-container:hover {
    transform: translateY(-2px);
}
  
.gallery-item {
    flex: 0 0 auto;
    width: 30vw;
    overflow: visible;
    position: relative;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}
  
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 16px;
    transition: transform 0.3s cubic-bezier(.25,.8,.25,1), box-shadow 0.3s;
    will-change: transform;
    z-index: 1;
    position: relative;
}

.gallery-item:hover img {
    transform: scale(1.15) translateY(-10px);
    z-index: 10;
    box-shadow: 0 8px 16px rgba(64,192,255,0.25), 0 2px 8px rgba(0,0,0,0.10);
}

/* Custom Scrollbar Styling */
.gallery-container::-webkit-scrollbar {
    height: 10px;
    background: #f8f8f8;
}
.gallery-container::-webkit-scrollbar-thumb {
    background: linear-gradient(
        135deg,
        rgba(255, 0, 255, 0.5),
        rgba(192, 64, 255, 0.5),
        rgba(128, 128, 255, 0.5),
        rgba(64, 192, 255, 0.5)
      );    
      border-radius: 8px;
}
.gallery-container::-webkit-scrollbar-track {
    background: #f8f8f8;
    border-radius: 8px;
}

/* Project Stamps Container */
.project-stamps-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

/* Project Stamp Styles */
.project-stamp {
    opacity: 0;
    transform: scale(0) rotate(180deg);
    transition: all 0.3s ease;
    cursor: pointer;
    width: fit-content;
}

.project-stamp.visible {
    animation: stampAppear 0.8s ease-out forwards, floatStamp 3s ease-in-out infinite 0.8s;
}

.stamp-icon-image {
    width: clamp(40px, 4vw, 60px);
    height: clamp(40px, 4vw, 60px);
    object-fit: contain;
    display: block;
    margin: 0 auto 8px auto;
    border-radius: 50%;
    padding: clamp(4px, 0.5vw, 8px);
    transition: all 0.3s ease;
}

.project-stamp:hover .stamp-icon-image {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 24px rgba(64, 192, 255, 0.6);
    filter: brightness(1.2);
}

.stamp-content {
    text-align: center;
    color: #3a4a6b;
    font-weight: 700;
    font-size: 0.9rem;
    background: transparent;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.project-stamp:hover .stamp-content {
    transform: translateY(-2px);
}

.stamp-title {
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 800;
    background: linear-gradient(135deg, #FF00FF, #C040FF, #8080FF, #40C0FF);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

@keyframes floatStamp {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(2deg);
    }
    50% {
        transform: translateY(-4px) rotate(-1deg);
    }
    75% {
        transform: translateY(-12px) rotate(1deg);
    }
}

@keyframes stampAppear {
    0% {
        opacity: 0;
        transform: scale(0) rotate(180deg);
    }
    20% {
        opacity: 0.3;
        transform: scale(0.3) rotate(135deg);
    }
    40% {
        opacity: 0.6;
        transform: scale(0.6) rotate(90deg);
    }
    60% {
        opacity: 0.8;
        transform: scale(1.1) rotate(45deg);
    }
    80% {
        opacity: 0.9;
        transform: scale(0.95) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Gaming effects for stamp */
@keyframes stampGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(64, 192, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(64, 192, 255, 0.8), 0 0 40px rgba(255, 0, 255, 0.4);
    }
}

.project-stamp.visible {
    animation: stampAppear 0.8s ease-out forwards, floatStamp 3s ease-in-out infinite 0.8s;
}

/* Collected stamps styling */
.collected-stamp {
    transform: scale(0.8);
    opacity: 0.9;
}

.collected-stamp:hover {
    transform: scale(0.9);
    opacity: 1;
}

/* Responsive stamp positioning */
@media (max-width: 768px) {
    .project-stamp {
        left: 1.5rem;
        transform: scale(0.8);
    }
    
    .collected-stamp {
        transform: scale(0.7);
    }
    
    .collected-stamp:hover {
        transform: scale(0.8);
    }
    
    .stamp-icon-image {
        width: clamp(35px, 3.5vw, 50px);
        height: clamp(35px, 3.5vw, 50px);
        padding: clamp(3px, 0.4vw, 6px);
    }
    
    .stamp-content {
        padding: clamp(6px, 1vw, 12px);
        font-size: clamp(0.7rem, 1.5vw, 0.8rem);
    }
    
    .stamp-title {
        font-size: clamp(0.6rem, 1.3vw, 0.7rem);
    }
}

@media (max-width: 480px) {
    .project-stamp {
        left: 1.5rem;
        transform: scale(0.7);
    }
    
    .stamp-icon-image {
        width: clamp(30px, 3vw, 40px);
        height: clamp(30px, 3vw, 40px);
        padding: clamp(2px, 0.3vw, 4px);
    }
    
    .stamp-content {
        padding: clamp(4px, 0.8vw, 10px);
        font-size: clamp(0.6rem, 1.2vw, 0.7rem);
    }
    
    .stamp-title {
        font-size: clamp(0.5rem, 1vw, 0.6rem);
    }
}