@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* General Styles */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Spectral', serif;
    color: white;
    overflow-x: hidden;
}

/* Home Page Background */
#bg-video {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -100;
    filter: brightness(50%);
    background: url('background.webp') no-repeat;
    background-size: cover;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none; /* Allow clicks to pass through header */
}

.title {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Courier New', serif;
    font-size: 1.8em; /* Made smaller and centered */
    font-weight: bold;
    color: white;
    z-index: 10;
    margin: 0;
}

/* Menu Icon */
#menu-icon {
    position: fixed;
    top: 20px;
    left: 30px; /* Moved to top-left */
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1002;
    transition: transform 0.3s ease;
}

#menu-icon:hover {
    transform: scale(1.1);
}

/* Sidebar Styles */
#sidebar {
    height: 100%;
    width: 25%;
    max-width: 400px;
    position: fixed;
    z-index: 1500;
    top: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    overflow-x: hidden;
    transition: transform 0.5s ease;
    box-sizing: border-box;
    transform: translateX(100%);
}

#sidebar.is-open {
    transform: translateX(0);
}

#sidebar-content {
    padding: 50px;
    color: black;
    white-space: normal;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.sidebar-thumbnail {
    width: 100%;
    max-width: 280px;
    margin-bottom: 20px;
    display: block; /* Fix for overlay sizing */
}

#sidebar-close-button {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 2.5rem;
    color: #888; /* Changed to grey */
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s ease;
}

#sidebar-close-button:hover {
    color: #555; /* Changed to darker grey */
}

#sidebar-content h2,
#sidebar-content p {
    color: black;
    margin-top: 0;
}

#sidebar-content p {
    line-height: 1.6;
}

#sidebar-content .project-crew {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ccc;
}

#sidebar-content .project-crew h4 {
    margin: 0 0 10px 0;
    font-weight: bold;
    color: #000;
}

#sidebar-content .crew-role-group {
    display: flex;
    margin-bottom: 8px;
}

#sidebar-content .crew-role {
    font-weight: bold;
    color: #333;
    width: 140px;
    flex-shrink: 0;
    padding-right: 15px;
    text-transform: capitalize;
}

#sidebar-content .crew-names {
    color: #555;
    line-height: 1.5;
}

.sidebar-contact-info {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #ccc;
}

/* Info Modal Styles */
#info-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
}

#info-modal {
    background: rgba(20, 20, 20, 0.9);
    color: white;
    padding: 40px;
    border-radius: 0;
    width: 80%;
    max-width: 1200px;
    max-height: 80vh;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

#modal-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 15px; /* Space for scrollbar */
    margin-right: -15px; /* Counteract padding to keep content aligned */
}

#modal-close-button {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10;
}

#modal-close-button:hover {
    color: #bbb;
}

/* Modal Tabs */
.modal-header {
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
}

.modal-tabs {
    display: flex;
    gap: 25px;
}

.tab-link {
    background: none;
    border: none;
    color: #aaa;
    font-family: 'Spectral', serif;
    font-size: 1.5em;
    font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-link:hover {
    color: #fff;
}

.tab-link.active {
    color: #fff;
    border-bottom-color: #fff;
}

/* Tab Content */
.tab-content {
    display: none;
}

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

#modal-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.project-card {
    background-color: rgba(10, 10, 10, 0.7);
    border: 1px solid #222;
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    box-shadow: 0 15px 30px rgba(0,0,0,0.6);
    border-color: #444;
}

.project-card .project-thumbnail {
    width: 100%;
    height: auto;
    display: block;
}

.project-card .project-info {
    padding: 20px 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-card .project-title {
    margin: 0 0 5px 0;
    font-size: 1.4em;
    font-weight: normal;
    letter-spacing: 1px;
}

.project-card .project-format {
    margin: 0 0 20px 0;
    font-style: italic;
    color: #aaa;
    font-size: 0.9em;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
}

.project-card .project-description,
.project-card .project-crew {
    font-size: 0.95em;
    line-height: 1.6;
    color: #ccc;
    white-space: pre-wrap; /* To respect newlines from <br> and data */
}

.project-card .project-crew {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.project-card .project-crew h4 {
    margin: 0 0 10px 0;
    font-weight: bold;
    color: #ddd;
}

.project-card .crew-role-group {
    display: flex;
    margin-bottom: 8px;
}

.project-card .crew-role {
    font-weight: bold;
    color: #bbb;
    width: 140px;
    flex-shrink: 0;
    padding-right: 15px;
    text-transform: capitalize;
}

.project-card .crew-names {
    color: #999;
    line-height: 1.5;
}

.project-format-line {
    margin-bottom: 0;
}

/* Accolades Styling for Sidebar */
.project-accolades-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 3px; /* Tighter gap between tags */
    margin-top: 5px; /* Minimal space from Format line */
    margin-bottom: 15px;
    padding: 0;
}

/* This specifically styles the tags in the sidebar */
.accolade-item {
    background-color: rgba(255, 255, 255, 0.07);
    color: #bbb;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    font-style: italic;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Accolades Styling for Modal (plain text) */
.project-accolades-modal {
    color: #aaa;
    font-style: italic;
    font-size: 0.9em;
    line-height: 1.6;
}

/* About Tab Styling */
.about-section {
    margin-bottom: 40px;
}

.about-section-title {
    color: #eee;
    font-size: 1.4em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
    font-weight: 300;
    letter-spacing: 1px;
}

.contact-info p {
    margin: 5px 0;
    color: #ccc;
    font-size: 1em;
    line-height: 1.6;
}

.contact-info a {
    color: #eee;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: #fff;
    text-decoration: underline;
}

.about-card {
    background-color: #1a1a1a; /* Slightly lighter than modal background */
}

.member-name {
    font-size: 1.2em;
    color: #f5f5f5;
    margin-bottom: 5px;
}

.member-role {
    font-size: 0.9em;
    color: #aaa;
    font-style: italic;
    margin-bottom: 15px;
}

.member-bio {
    font-size: 0.95em;
    color: #ccc;
    line-height: 1.6;
}


/* Custom Scrollbar for Modal Content */
#modal-content::-webkit-scrollbar {
    width: 10px;
}

#modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

#info-modal::-webkit-scrollbar-thumb {
    background-color: #222;
    border-radius: 10px;
    border: 2px solid #333;
}

#modal-content::-webkit-scrollbar-thumb:hover {
    background-color: #444;
    border-color: #555;
}

/* Thumbnail Link and Play Icon */
.thumbnail-link {
    position: relative;
    display: inline-block; /* Shrink-to-fit the image */
    line-height: 0; /* Force line-height to 0 to remove extra space */
}

.thumbnail-link .project-thumbnail {
    display: block; /* Definitive fix for extra space causing overlay issues */
}



.thumbnail-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.thumbnail-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 20px 0 20px 35px; /* Triangle shape */
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.thumbnail-link:hover::before,
.thumbnail-link:hover::after {
    opacity: 1;
}

/* Project Card Spacing */
.project-card .project-info {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Use gap for consistent spacing */
}

.project-card .project-description {
    line-height: 1.6;
    color: #aaa;
}

.project-card .project-format {
    color: #bbb;
    font-style: italic;
}

/* Animation Styles */
#animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5; /* Below GIFs */
}

.trace-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.trace-circle, .trace-line {
    stroke: white;
    stroke-width: 2;
    fill: none;
    position: absolute;
}

.trace-circle {
    animation: draw-circle 1s ease-out forwards;
}

.trace-line {
    animation: draw-line 1s ease-out forwards;
}

.fading-out {
    animation: fade-out 1s ease-out forwards;
}

@keyframes draw-circle {
    to { stroke-dashoffset: 0; }
}

@keyframes draw-line {
    to { stroke-dashoffset: 0; }
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.border-fading-out {
    animation: fade-out 0.5s ease-out forwards;
}

/* GIF Styles */
#gif-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 6; /* Above animations */
}

.gif-border {
    position: absolute;
    overflow: visible;
    pointer-events: none;
    transition: width 0.5s ease, transform 0.5s ease;
}

.gif-border path {
    stroke: white;
    stroke-width: 2;
    fill: none;
}

@keyframes draw-border {
    to { stroke-dashoffset: 0; }
}

.random-gif {
    position: absolute;
    cursor: pointer;
    pointer-events: all;
    max-width: 280px;
    max-height: 220px;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

/* Fade-in overlay */
#fade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    z-index: 9999;
    animation: fade-out 1.5s 0.5s ease-out forwards;
    pointer-events: none;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .title {
        font-size: 1.5em;
    }
    header {
        padding: 20px;
    }
    .work-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .thumbnail {
        margin-bottom: 15px;
        width: 100%;
        height: auto;
    }
}
