* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #000000;
    color: #ffffff;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

#spaceCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(5, 5, 15, 0.9);
    backdrop-filter: blur(15px);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo svg {
    width: 40px;
    height: 40px;
}

.logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

#searchInput {
    padding: 10px 15px;
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    width: 200px;
}

#searchInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#searchInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.4);
    background: rgba(255, 255, 255, 0.1);
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

button:active {
    transform: translateY(0);
}

.gallery {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 30px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.6s ease-in-out;
    background: rgba(20, 20, 40, 0.6);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.5);
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    padding: 15px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-title {
    opacity: 1;
}

.loader {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 30px;
    display: none;
}

.loader.active {
    display: block;
}

.spinner {
    margin: 0 auto 15px;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 15px;
    max-width: 95%;
    max-height: 90%;
    overflow: auto;
    padding: 25px;
    box-shadow: 0 0 50px rgba(102, 126, 234, 0.5);
    border: 1px solid rgba(102, 126, 234, 0.3);
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 35px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
}

.close:hover {
    color: #667eea;
    transform: rotate(90deg);
}

#modalImage {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 15px;
}

.modal-info {
    color: #fff;
}

.modal-info h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    margin-bottom: 12px;
    color: #667eea;
}

.modal-info p {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

#downloadBtn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    margin-top: 10px;
}

#downloadBtn:hover {
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.5);
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
        padding: 12px 15px;
    }

    .logo h1 {
        font-size: 16px;
    }

    .logo svg {
        width: 35px;
        height: 35px;
    }

    .search-container {
        width: 100%;
        justify-content: center;
    }

    #searchInput {
        width: 60%;
    }

    button {
        padding: 10px 15px;
        font-size: 14px;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
        padding: 20px 15px;
    }

    .gallery-item img {
        height: 180px;
    }

    .modal-content {
        padding: 20px;
        max-width: 100%;
    }

    #modalImage {
        max-height: 50vh;
    }

    .modal-info h2 {
        font-size: 18px;
    }

    .modal-info p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 14px;
    }

    #searchInput {
        width: 100%;
        font-size: 13px;
    }

    button {
        padding: 8px 12px;
        font-size: 13px;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px 10px;
    }

    .gallery-item img {
        height: 200px;
    }

    .modal-content {
        padding: 15px;
    }

    #modalImage {
        max-height: 45vh;
    }
}

@media (min-width: 1440px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }

    .gallery-item img {
        height: 260px;
    }
}