/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: white;
    background-color: #000000;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: -2;
}

body::before {
    background: radial-gradient(circle at center, 
        rgba(30, 144, 255, 0.1) 0%,
        transparent 40%),
        radial-gradient(circle at 20% 80%, 
        rgba(30, 144, 255, 0.2) 0%,
        transparent 30%),
        radial-gradient(circle at 80% 20%, 
        rgba(30, 144, 255, 0.2) 0%,
        transparent 30%);
    animation: pulseGlow 8s ease-in-out infinite;
}

body::after {
    background: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 40% 70%, #1e90ff, transparent),
        radial-gradient(3px 3px at 60% 20%, white, transparent),
        radial-gradient(2px 2px at 70% 90%, #1e90ff, transparent),
        radial-gradient(2px 2px at 80% 40%, white, transparent);
    background-size: 300px 300px;
    animation: sparkleStars 4s linear infinite;
    opacity: 0.5;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, #000000, #ff1744);
    transform-origin: 0;
    z-index: 1001;
}

main {
    flex: 1;
    margin-top: 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Projects Section */
.projects-section {
    padding: 80px 0;
}

.title-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 40px;
}




.section-title:after {
    display: none;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.5; }
}

@keyframes sparkleStars {
    0% { transform: translateY(0); }
    100% { transform: translateY(-300px); }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    transition: all 0.5s ease;
}

/* Full width project view */
.projects-grid.full-width-mode .project-card.expanded {
    grid-column: 1 / -1;
    max-width: 100%;
    margin: 0 auto;
}

.projects-grid.full-width-mode .project-card:not(.expanded) {
    display: none;
}

/* Back button */
.back-button {
    display: none;
    margin: 0 auto 30px;
    padding: 10px 20px;
    background: linear-gradient(90deg, #1e90ff);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    align-items: center;
    gap: 8px;
}

.back-button.visible {
    display: flex;
}

.back-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(71, 118, 230, 0.3);
}

/* Project Card */
.project-card {
    background-color: rgba(30, 144, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
}

.project-card.hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Hide view more button in expanded mode */
.project-card.expanded .view-more-btn {
    display: none;
}

/* Hide the card thumbnail in expanded view */
.project-card.expanded .project-media {
    display: none;
}

/* Hide the entire project summary content in expanded view */
.project-card.expanded .project-summary {
    padding: 0;
    margin: 0;
    height: 0;
    overflow: hidden;
    border: none;
}

.project-summary {
    padding: 25px;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: white;
}

.project-year {
    display: inline-block;
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 12px;
    padding: 3px 10px;
    background-color: #f0f0f0;
    border-radius: 20px;
}

.project-overview {
    margin-bottom: 15px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 8px;
}

.tech-stack span {
    font-size: 0.8rem;
    background: linear-gradient(90deg, #1e90ff);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
}

.view-more-btn, .view-less-btn {
    padding: 8px 20px;
    background: none;
    border: 2px solid #4776E6;
    color: white;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.view-more-btn:hover, .view-less-btn:hover {
    background: #4776E6;
    color: white;
}

/* Project Details */
.project-details {
    padding: 0 25px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease;
    background-color: rgba(0, 0, 0, 0.3);
    border-top: 1px solid #eee;
}

.project-card.expanded .project-details {
    padding: 30px;
    max-height: 2000px; /* Increased to allow for more content */
    border-top: 1px solid #eee;
}

/* Additional styling for detailed project view */
.project-details h3 {
    font-size: 1.3rem;
    margin: 25px 0 12px;
    color: white;
    position: relative;
}

.project-details h3:first-child {
    margin-top: 0;
}

.detailed-tech-stack {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 8px;
}

.detailed-tech-stack span {
    font-size: 0.85rem;
    background: linear-gradient(90deg, #ff1744);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
}

/* Expanded view styling */
.project-card.expanded .project-summary {
    border-bottom: 1px solid #eee;
}

.project-card.expanded {
    transform: none;
    transition: all 0.5s ease;
}

.project-details p {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.project-details ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.project-details li {
    margin-bottom: 8px;
}

.project-links {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.project-link {
    text-decoration: none;
    color: #4776E6;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

.project-link:hover {
    color: #8E54E9;
}

.view-less-btn {
    margin-top: 10px;
}

/* Hide view less button in full-width mode (using back button instead) */
.projects-grid.full-width-mode .view-less-btn {
    display: none;
}

/* Project Media */
.project-media {
    margin: -25px -25px 20px -25px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.project-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.project-card:hover .project-thumbnail {
    transform: scale(1.05);
}

/* Detailed project media gallery */
.project-media-gallery {
    margin: 0 -30px 25px -30px;
    background-color: #000;
    position: relative;
    max-width: 800px; /* Limit the maximum width */
    margin-left: auto;
    margin-right: auto;
}

/* Media navigation controls */
.media-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 10;
    pointer-events: none; /* Allow clicks to pass through the container */
}

.media-control-btn {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto; /* Make buttons clickable */
}

.media-control-btn:hover {
    background-color: rgba(71, 118, 230, 0.8);
    transform: scale(1.1);
}

.media-control-btn i {
    font-size: 1rem;
}

.main-media {
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    position: relative;
    background-color: #000;
}

.main-media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

/* Add styling for video element */
.main-media video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 450px;
    margin: 0 auto;
    object-fit: contain;
}

.media-thumbnails {
    display: flex;
    overflow-x: auto;
    padding: 10px;
    gap: 10px;
    background-color: #111;
    scrollbar-width: thin;
    scrollbar-color: #4776E6 #222;
}

.media-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.media-thumbnails::-webkit-scrollbar-track {
    background: #222;
}

.media-thumbnails::-webkit-scrollbar-thumb {
    background-color: #4776E6;
    border-radius: 10px;
}

.media-thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
    flex-shrink: 0;
}

.media-thumbnail:hover, .media-thumbnail.active {
    transform: translateY(-5px);
    opacity: 1;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.video-thumbnail {
    position: relative;
    background-color: #000;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumbnail .fa-play-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    z-index: 2;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Project header in expanded view */
.project-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.detail-project-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.detail-project-year {
    display: inline-block;
    font-size: 1rem;
    color: #777;
    padding: 4px 12px;
    background-color: #f0f0f0;
    border-radius: 20px;
}

/* Back to top button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e90ff);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(71, 118, 230, 0.25);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .project-media-gallery {
        max-width: 700px;
    }
    
    .main-media video {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    main {
        margin-top: 60px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .project-thumbnail {
        height: 180px;
    }
    
    .media-thumbnails {
        padding: 8px;
        gap: 8px;
    }
    
    .media-thumbnail {
        width: 70px;
        height: 50px;
    }
    
    .project-media-gallery {
        max-width: 100%;
    }
    
    .media-control-btn {
        width: 36px;
        height: 36px;
    }

    .detail-project-title {
        font-size: 1.8rem;
    }

    .back-to-top-btn {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
    
    .main-media video {
        max-height: 350px;
    }
}

@media (max-width: 480px) {
    .project-summary {
        padding: 20px;
    }
    
    .project-title {
        font-size: 1.3rem;
    }
    
    .project-card.expanded .project-details {
        padding: 20px;
    }
    
    .project-thumbnail {
        height: 160px;
    }
    
    .media-thumbnails {
        padding: 5px;
        gap: 5px;
    }
    
    .media-thumbnail {
        width: 60px;
        height: 45px;
    }
    
    .media-control-btn {
        width: 32px;
        height: 32px;
    }

    .detail-project-title {
        font-size: 1.5rem;
    }
    
    .project-header {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }

    .back-to-top-btn {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
        font-size: 1rem;
    }
    
    .main-media video {
        max-height: 250px;
    }
}

/* Footer integration styles */
.footer {
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    text-align: center;
    padding: 20px 0;
    font-size: 16px;
    width: 100%;
    margin-top: auto;
}

.social-icons {
    margin-top: 10px;
}

.social-icons a {
    color: white;
    font-size: 24px;
    margin: 0 10px;
    text-decoration: none;
    transition: color 0.3s ease-in-out;
}

.social-icons a:hover {
    color: #ff1744;
}
