﻿body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: black;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 80px;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 10px 20px;
    transition: background-color 0.3s ease-in-out;
    z-index: 4;
}

/* TG Initials */
#logo {
    font-size: 80px;
    font-weight: bold;
    color: white;
    transition: font-size 0.6s ease-in-out, transform 0.6s ease-in-out;
    transform: translateX(850px);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7), 
    -2px -2px 0 rgba(0, 0, 0, 0.7),
    2px -2px 0 rgba(0, 0, 0, 0.7),
    -2px 2px 0 rgba(0, 0, 0, 0.7),
    0 0 10px rgba(59, 163, 223, 0.8),
    0 0 20px rgba(59, 163, 223, 0.8),
    0 0 30px rgba(59, 163, 223, 0.8);
}

#home-icon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

    #home-icon img {
        width: 32px;
        height: 32px;
        transition: transform 0.3s ease;
    }

        #home-icon img:hover {
            transform: scale(1.2);
        }

header.scrolled {
    background-color: rgba(0, 0, 0, 0.9);
    height: 60px;
}

/* Scroll Effect: Shrink TG */
header.scrolled #logo {
    font-size: 40px;
    transform: translateX(7px) scale(0.8); 
}

/* Custom Scrollbar - Shorter and Stylish */
::-webkit-scrollbar {
    width: 15px;
}

::-webkit-scrollbar-track {
    background: #161b24;
}

::-webkit-scrollbar-thumb {
    background: #222a38;
    height: 40px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2d384a;
}

main {
    position: relative;
    z-index: 1;
}

/* Background Particle Canvas */
#particleCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.grid-container {
    top: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 98.8vw;
    height: 100vh;
    position: absolute;
    clip-path: polygon(100% 0%, 100% 84%, 50% 100%, 0% 84%, 0% 0%);
    border: 5px solid rgba(0, 0, 0, 1);
    background-color: black;
    padding-left: 35px;
}

.grid-item {
    width: 98%;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 1.5em;
    position: relative;
    overflow: hidden;
    background-size: cover;
    filter: brightness(1);
    transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}

.grid-item img {
    width: 85%;
    height: 100%;
    object-fit: cover;
    max-height: 100%;
    box-shadow: 0 0 15px 2px rgba(59, 163, 223, 0.9);
}

.grid-item:hover {
    transform: scale(1.03);
    opacity: 1;
    z-index: 1;
    box-shadow: -15px 0 15px -5px rgba(59, 163, 223, 0.7);
} 

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #121212;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out;
}

#loading-screen.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #ff9900;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#loading-text {
    font-size: 1.5em;
    margin-top: 10px;
    color: white;
    animation: flicker 1.5s infinite;
}

@keyframes flicker {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

footer {
    background: linear-gradient(45deg, #2A3A60, #37343d );
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    height: 500px;
    animation: animatedBackground 8s ease infinite;
    margin-top: 820px;
}

/* Social Icons */
.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 60px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons img {
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}

.social-icons a:hover img {
    transform: scale(1.2);
    filter: drop-shadow(0px 0px 5px #ff9900);
}

@keyframes animatedBackground {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#projects {
    padding: 20px;
    text-align: center;
}

#projects h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.project-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    justify-items: center;
}

.project-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 350px;
    max-height: 400px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .project-card img {
        width: 100%;
        height: 200px;
        object-fit: cover;
        flex-shrink: 0;
    }

.project-info {
    flex-grow: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.modal {
    display: none; 
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    padding-top: 60px;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.project-detail img {
    width: 100%;
    height: auto;
    margin-bottom: 15px;
}

.media-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.modal-img:hover {
    transform: scale(1.1);
}

.project-images, .project-videos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.modal-img {
    width: 30%;
    max-width: 300px;
    height: auto;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}

.modal-img.expanded {
    width: 40%;
    max-width: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 1000;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.modal-img.expanded ~ * {
    z-index: 999;
}

.modal-video {
    width: 40%;
    max-width: 400px;
    height: auto;
    border-radius: 5px;
}

@media (max-width: 600px) {
    #projects h2 {
        font-size: 28px;
    }

    .project-info h3 {
        font-size: 20px;
    }

    .project-info p {
        font-size: 14px;
    }
}