:root {
    --primary-color: #ff4757;
    --secondary-color: #ff6b81;
    --background-color: #0f0f13;
    --surface-color: #1e1e24;
    --text-color: #ffffff;
    --text-secondary: #b2bec3;
    --accent-color: #ffa502;
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: radial-gradient(circle at top left, rgba(255, 71, 87, 0.15), transparent 40%),
        radial-gradient(circle at bottom right, rgba(255, 165, 2, 0.15), transparent 40%),
        #0f0f13;
}

header {
    text-align: center;
    padding: 2rem 1rem;
    z-index: 10;
}

.rsg-logo {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 150px;
    z-index: 100;
}

.toggle-button {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 20px auto;
    display: block;
}

.toggle-button:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.4);
}

.logo {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    transition: opacity 0.5s ease;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-weight: 300;
    transition: opacity 0.5s ease;
}

.text-fade-out {
    opacity: 0;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
    perspective: 1000px;
    flex-direction: column;
}

.search-container {
    margin-bottom: 20px;
    z-index: 20;
}

#post-filter {
    background-color: rgba(30, 30, 36, 0.8);
    border: 2px solid var(--surface-color);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-family: var(--font-family);
    width: 300px;
    transition: all 0.3s ease;
    outline: none;
}

#post-filter:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.3);
    width: 320px;
}

.swiper-container {
    width: 100%;
    padding-top: 50px;
    padding-bottom: 50px;
}

.swiper-slide {
    background-position: center;
    background-size: cover;
    width: 300px;
    height: 500px;
    background-color: var(--surface-color);
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    transition: transform 0.3s ease;
    margin-bottom: 0;
}

.swiper-slide:hover img {
    transform: scale(1.05);
}

.slide-content {
    position: relative;
    width: 100%;
    padding: 15px;
    background: transparent;
    color: white;
    transform: none;
    transition: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Image Wrapper for Border Isolation */
.image-wrapper {
    position: relative;
    width: 100%;
    height: 375px;
    background-color: var(--surface-color);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 0;
    transform: translateZ(0);
    flex-shrink: 0;
}

.image-wrapper:hover img {
    transform: scale(1.1);
}

.swiper-slide:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.swiper-slide-active .slide-content {
    transform: translateY(0);
}

.slide-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
    transform: translateY(-5px);
}

.slide-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Date-based border colors applied to wrapper*/
.border-recent {
    border: 5px solid #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.border-mid {
    border: 5px solid #FF4500;
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.5);
}

.border-old {
    border: 5px solid #1E90FF;
    box-shadow: 0 0 20px rgba(30, 144, 255, 0.5);
}

.swiper-slide p {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: var(--text-color);
}

footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    z-index: 10;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    position: relative;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    background-color: var(--surface-color);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-button {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-button:hover,
.close-button:focus {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-header {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

#modal-title {
    font-size: 1.5rem;
    color: var(--primary-color);
}

#modal-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.post-images {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-images img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

@media screen and (max-width: 768px) {
    .rsg-logo {
        display: none;
    }

    .logo {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
        padding: 0 1rem;
    }

    #post-filter {
        width: 80%;
        display: block;
        margin: 0 auto;
    }

    .swiper-slide {
        width: 220px;
        height: 380px;
    }

    .image-wrapper {
        height: 240px;
    }

    .slide-content {
        padding: 10px;
        justify-content: flex-start;
        padding-top: 15px;
    }

    .slide-title {
        font-size: 1rem;
        margin-bottom: 2px;
    }

    .slide-date {
        font-size: 0.8rem;
    }

    .modal-content {
        width: 95%;
        margin: 15% auto;
    }

    .close-button {
        font-size: 36px;
    }
}