/* General Styles */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Background Styles */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 90% auto;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000;
    transition: opacity 2s ease-in-out;
    -webkit-transition: opacity 2s ease-in-out;
    -moz-transition: opacity 2s ease-in-out;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 5;
}

/* Navigation Menu */
.nav-menu {
    position: fixed;
    top: -50px; /* Moved up by approximately 1 inch (combined with padding) */
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 60px 0 15px; /* Added top padding to ensure text remains visible */
    z-index: 15;
    display: flex;
    justify-content: center;
}

.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav-menu li {
    margin: 0 15px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 10px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a:hover, .nav-menu a.active {
    color: #f0f0f0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: white;
    transition: width 0.3s ease;
}

.nav-menu a.active::after {
    width: 100%;
}

.nav-menu a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 16;
    position: fixed;
    top: 25px; /* Adjusted to be more visible with the new nav position */
    right: 15px;
}

/* Content Styles */
.content {
    position: relative;
    z-index: 10;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 5vh; /* Moved up by 10vh (approximately 1 inch at typical screen sizes) */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Slideshow control buttons */
.controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.control-btn {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.5);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.content-box {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 30px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    text-align: left;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-height: 75vh; /* Limit height to enable scrolling */
    overflow-y: auto; /* Enable vertical scrolling */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent; /* For Firefox */
}

/* Custom scrollbar styling for webkit browsers */
.content-box::-webkit-scrollbar {
    width: 8px;
}

.content-box::-webkit-scrollbar-track {
    background: transparent;
}

.content-box::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.content-box::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* Gallery Styles */
.gallery-container {
    width: 100%;
}

.gallery-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.gallery-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    margin: 0 10px;
    padding: 5px 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.gallery-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: white;
    transition: width 0.3s ease;
}

.gallery-btn:hover::after, .gallery-btn.active::after {
    width: 100%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
    max-height: 65vh;
    overflow-y: scroll;
    padding: 5px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    grid-auto-rows: 160px; /* Fix the row height to prevent shrinking */
}

/* WebKit (Chrome/Safari) scrollbar styling for gallery */
.gallery-grid::-webkit-scrollbar {
    width: 8px;
    display: block;
}

.gallery-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 5px;
    cursor: pointer;
    background-color: #000;
    position: relative;
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, opacity 0.3s ease;
    box-sizing: border-box;
    width: 100%;
}

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

.gallery-item img {
    max-height: 150px;
    width: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.gallery-item:hover img {
    opacity: 0.7;
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px 5px;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.gallery-item-title {
    color: white;
    font-size: 0.85rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 5px;
}

/* Image Modal */
.image-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
}

.image-modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 90%;
    max-height: 90vh;
}

#modal-image {
    max-height: 65vh;
    width: auto;
    background-color: #000;
    margin-bottom: 20px;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* We've removed the bottom mobile close button */

.modal-caption {
    color: white;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #f0f0f0;
}

.modal-description {
    font-size: 1rem;
    line-height: 1.6;
    max-height: 150px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.modal-description::-webkit-scrollbar {
    width: 6px;
}

.modal-description::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.modal-description::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
}

.mobile-modal-hint {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    opacity: 0.9;
    transition: opacity 0.5s ease;
    z-index: 102;
    pointer-events: none;
}

/* Video Styles */
.video-container {
    width: 100%;
}

.video-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mobile-instructions {
    display: none;
    text-align: center;
    padding: 0 0 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 20px;
    max-height: 65vh;
    overflow-y: scroll;
    padding: 5px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    grid-auto-rows: auto;
}

/* WebKit scrollbar styling for video grid */
.video-grid::-webkit-scrollbar {
    width: 8px;
    display: block;
}

.video-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.video-grid::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.video-item {
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.video-item:hover {
    transform: translateY(-5px);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 15px;
}

.video-info h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.2rem;
    color: white;
    font-weight: bold;
}

.video-info p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
    color: #e0e0e0;
    transition: max-height 0.3s ease;
}

.video-info p.expanded {
    max-height: 200px;
}

/* Projects Styles */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 20px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    background-color: rgba(255, 255, 255, 0.2);
}

.project-date {
    font-style: italic;
    margin-top: -10px;
    color: #ccc;
}

/* Contact Styles */
.contact-info p {
    margin-bottom: 30px;
}

.contact-methods {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.contact-method {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
}

.social-link {
    color: white;
    text-decoration: none;
    margin-right: 15px;
    transition: opacity 0.3s ease;
}

.social-link:hover {
    opacity: 0.7;
}

.contact-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: none;
    background-color: rgba(255, 255, 255, 0.9);
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
}

.checkbox-group label {
    display: inline;
    cursor: pointer;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.form-error {
    background-color: rgba(220, 53, 69, 0.2);
    color: #f8d7da;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.submit-btn {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: white;
}

.form-success {
    text-align: center;
    padding: 20px;
    background-color: rgba(120, 200, 120, 0.2);
    border-radius: 5px;
    margin-top: 20px;
}

.form-success h3 {
    color: #8fbc8f;
    margin-bottom: 10px;
}

/* Thank you page styles */
.thank-you-message {
    text-align: center;
    padding: 30px 0;
}

.thank-you-message h2 {
    color: #8fbc8f;
    margin-bottom: 20px;
}

.navigation-options {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Description Panel */
.description-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 90%;
    max-width: 1400px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 30px;
    z-index: 12;
    text-align: center;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
}

.description-panel.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.description-title {
    font-size: 1.6rem;
    margin-bottom: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.description-text {
    font-size: 1.1rem;
    line-height: 1.6;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s;
}

.loading-indicator.visible {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Styles */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .content-box {
        padding: 20px;
    }
    
    /* Make close button bigger and more visible on mobile */
    .close-modal {
        top: 10px;
        right: 10px;
        font-size: 40px;
        background-color: rgba(0, 0, 0, 0.5);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        text-align: center;
        line-height: 40px;
        padding-bottom: 5px;
    }
    
    .nav-menu {
        padding: 60px 0 10px;
        background-color: transparent;
        top: -50px; /* Keep the same positioning as desktop */
    }
    
    /* Mobile video adjustments */
    .video-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        max-height: 72vh;
        padding: 10px 5px;
    }
    
    .video-item {
        background-color: rgba(0, 0, 0, 0.6);
        margin-bottom: 15px;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    }
    
    .video-wrapper {
        padding-bottom: 62.25%; /* Slightly taller to accommodate better mobile viewing */
    }
    
    .video-info {
        padding: 12px 10px;
        background-color: rgba(0, 0, 0, 0.4);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .video-info h3 {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 6px;
    }
    
    .video-info p {
        font-size: 0.8rem;
        line-height: 1.4;
        max-height: 70px;
        overflow-y: auto;
    }
    
    /* Better mobile controls */
    .video-controls {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        margin-bottom: 15px;
    }
    
    .video-controls::-webkit-scrollbar {
        display: none; /* Hide scrollbar but maintain functionality */
    }
    
    .gallery-btn {
        white-space: nowrap;
        padding: 8px 15px;
        margin: 0 5px;
        background-color: rgba(0, 0, 0, 0.4);
        border-radius: 20px;
        font-size: 0.9rem;
    }
    
    /* Show mobile instructions */
    .mobile-instructions {
        display: block;
        margin-bottom: 10px;
    }
    
    .nav-menu ul {
        display: none;
        flex-direction: column;
        background-color: rgba(0, 0, 0, 0.85);
        position: fixed;
        top: -50px; /* Match the nav menu position */
        left: 0;
        width: 100%;
        height: 110%; /* Slightly taller to account for the -50px top position */
        justify-content: center;
        align-items: center;
    }
    
    .nav-menu.open ul {
        display: flex;
    }
    
    .nav-menu li {
        margin: 20px 0;
    }
    
    .nav-menu a {
        font-size: 1.5rem;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .projects-container {
        grid-template-columns: 1fr;
    }
    
    /* Mobile gallery adjustments */
    .content-box {
        max-height: 65vh;
        padding: 15px 10px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
        max-height: 55vh;
        grid-auto-rows: 120px; /* Match mobile item height */
    }
    
    .gallery-item {
        height: 120px;
    }
    
    .gallery-item img {
        max-height: 110px;
    }
    
    .gallery-item-overlay {
        padding: 5px 2px;
    }
    
    .gallery-item-title {
        font-size: 0.7rem;
    }
    
    /* Mobile description panel adjustments */
    .description-panel {
        width: 100%;
        max-width: 100%;
        padding: 15px 15px;
        border-radius: 0;
    }
    
    .description-title {
        font-size: 1.3rem;
        margin-bottom: 5px;
    }
    
    .description-text {
        font-size: 0.95rem;
        line-height: 1.4;
        max-height: 110px;
        overflow-y: auto;
    }
}