/* Popup Modal Styles */
.post-popup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.popup-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Popup Header */
.popup-header {
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 15px;
    padding: 20px;
    background: #fff;
    box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.15);
    position: relative;
    height: 100px;
}

.popup-header .nav-arrow,
.popup-header h2 {
    display: none;
}

.popup-current-title {
    margin: 0;
    padding: 0 20px;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    flex: 1;
    line-height: 1.4;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.popup-nav-btn.disabled,
.popup-nav-btn {
    background: #E8EAEB;
    color: #2D2D2D;
    border: none;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 150px;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    height: 56px;
}

.popup-nav-btn i {
    display: none;
}

.nav-arrow {
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
}

.nav-post-title {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
}

.popup-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #000;
    border: none;
    color: white;
    font-size: 24px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.popup-close-btn:hover {
    background: #000;
    transform: rotate(90deg);
}

/* Popup Body */
.popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #f8f9fa;
}

.popup-content-area {
    padding: 30px;
    min-height: 300px;
    animation: contentFadeIn 0.5s ease;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 15px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Post Content Styles inside Popup */
.popup-content-area .post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
}

.popup-content-area .post-content>* {
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.popup-content-area .post-content>*:nth-child(1) {
    animation-delay: 0.1s;
}

.popup-content-area .post-content>*:nth-child(2) {
    animation-delay: 0.2s;
}

.popup-content-area .post-content>*:nth-child(3) {
    animation-delay: 0.3s;
}

.popup-content-area .post-content>*:nth-child(4) {
    animation-delay: 0.4s;
}

.popup-content-area .post-content>*:nth-child(5) {
    animation-delay: 0.5s;
}

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

.popup-content-area .post-content h1,
.popup-content-area .post-content h2,
.popup-content-area .post-content h3 {
    color: #2d3748;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.popup-content-area .post-content p {
    color: #4a5568;
}

.popup-content-area .post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
}

.popup-content-area .post-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #4a5568;
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
}

.popup-content-area .post-content ul,
.popup-content-area .post-content ol {
    padding-left: 2rem;
    margin: 1.5rem 0;
}

.popup-content-area .post-content li {
    margin-bottom: 0.5rem;
}

/* Popup Footer */
.popup-footer {
    padding: 15px 30px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.post-meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #718096;
    flex-wrap: wrap;
    gap: 15px;
}

.post-meta-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-meta-info i {
    font-size: 1rem;
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .popup-container {
        width: 95%;
        max-height: 95vh;
    }

    .popup-current-title {
        order: -1;
        width: 100%;
        margin-bottom: 10px;
        max-width: 100%;
        font-size: 1.2rem;
    }

    .popup-nav-btn {
        min-width: 120px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .nav-post-title {
        max-width: 70px;
    }

    .popup-content-area {
        padding: 20px;
    }

    .popup-footer {
        padding: 12px 20px;
    }

    .post-meta-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .popup-nav-btn {
        min-width: auto;
        padding: 8px;
    }

    .nav-post-title {
        display: none;
    }

    .popup-current-title {
        font-size: 1.1rem;
    }

    .popup-content-area .post-content {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}