@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 100%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    padding: 2rem 0;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #64b5f6, #42a5f5, #1e88e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(100, 181, 246, 0.3);
}

main {
    flex: 1;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 2rem 0;
}

.post {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(100, 181, 246, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post:hover::before {
    opacity: 1;
}

.post:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(100, 181, 246, 0.2);
    border-color: rgba(100, 181, 246, 0.3);
}

.post img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.post:hover img {
    transform: scale(1.03);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-image {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    user-select: none;
    line-height: 1;
    font-family: monospace;
}

.carousel-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
}

.carousel-nav.prev {
    left: -30px;
}

.carousel-nav.next {
    right: -30px;
}

.carousel-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

footer {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    padding: 2rem 0;
    color: rgba(255, 255, 255, 0.7);
}

/* Tablet View */
@media (max-width: 1024px) {
    .post-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
    
    .carousel-image {
        max-height: 80vh;
    }
}

/* Mobile View */
@media (max-width: 768px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 0 1rem;
    }
    
    .modal-content {
        padding: 1rem;
        max-width: 98vw;
        max-height: 98vh;
    }
    
    .carousel-image {
        max-height: 85vh;
    }
    
    .carousel-nav {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
    
    .carousel-nav.prev {
        left: -25px;
    }
    
    .carousel-nav.next {
        right: -25px;
    }
}

@media (max-width: 480px) {
    .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    .carousel-nav.prev {
        left: -20px;
    }
    
    .carousel-nav.next {
        right: -20px;
    }
}