/* Related Posts Slide-in - Kadence Conversions Inspired Design */

.rps-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999998;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.rps-overlay.active {
    display: block;
    opacity: 1;
}

.rps-slidein {
    position: fixed;
    bottom: -100%;
    right: 30px;
    width: 440px;
    max-width: calc(100% - 60px);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px 16px 0 0;
    box-shadow: 
        0 -10px 40px rgba(0, 0, 0, 0.12),
        0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 999999;
    overflow: hidden;
    transition: bottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: none;
}

.rps-slidein.active {
    bottom: 0;
}

/* Kadence-style close button */
.rps-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(15, 23, 42, 0.06);
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #475569;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    z-index: 10;
    font-weight: 400;
}

.rps-close:hover {
    background: rgba(15, 23, 42, 0.1);
    color: #0f172a;
    transform: scale(1.05);
}

.rps-close:active {
    transform: scale(0.95);
}

.rps-content {
    padding: 28px 24px 24px 24px;
    overflow-y: auto;
    max-height: 85vh;
}

/* Kadence-style title with accent */
.rps-title {
    margin: 0 0 6px 0;
    padding: 0 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 3px solid #6366f1;
    line-height: 1.4;
}

/* Loading state */
.rps-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    color: #64748b;
    font-size: 14px;
    gap: 16px;
}

.rps-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Post item container */
.rps-post-item {
    display: block;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.rps-post-item:hover {
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

/* Thumbnail with overlay effect */
.rps-post-thumbnail {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.rps-post-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rps-post-thumbnail:hover::after {
    opacity: 1;
}

.rps-post-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.rps-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rps-post-thumbnail:hover img {
    transform: scale(1.08);
}

/* Post details section */
.rps-post-details {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Kadence-style post title */
.rps-post-title {
    margin: 0;
    font-size: 19px;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: #0f172a;
}

.rps-post-title a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s ease;
    background: linear-gradient(to right, #6366f1 0%, #6366f1 100%);
    background-size: 0 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s ease;
}

.rps-post-title a:hover {
    background-size: 100% 2px;
    color: #6366f1;
}

/* Excerpt styling */
.rps-post-excerpt {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #64748b;
    font-weight: 400;
}

/* Kadence-style CTA button */
.rps-read-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    align-self: flex-start;
    margin-top: 6px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    letter-spacing: 0.3px;
}

.rps-read-more:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.rps-read-more:active {
    transform: translateY(0);
}

/* Arrow animation */
.rps-read-more::after {
    content: '→';
    transition: transform 0.3s ease;
    display: inline-block;
}

.rps-read-more:hover::after {
    transform: translateX(4px);
}

/* Mobile Responsive - Kadence style */
@media (max-width: 768px) {
    .rps-slidein {
        right: 16px;
        width: calc(100% - 32px);
        max-width: none;
        border-radius: 20px 20px 0 0;
    }
    
    .rps-content {
        padding: 24px 18px 20px 18px;
    }
    
    .rps-title {
        font-size: 12px;
        letter-spacing: 0.8px;
    }
    
    .rps-post-thumbnail {
        height: 200px;
    }
    
    .rps-post-details {
        padding: 18px;
    }
    
    .rps-post-title {
        font-size: 17px;
    }
    
    .rps-post-excerpt {
        font-size: 13px;
        line-height: 1.65;
    }
    
    .rps-read-more {
        padding: 11px 20px;
        font-size: 13px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .rps-slidein {
        right: 12px;
        width: calc(100% - 24px);
    }
    
    .rps-post-thumbnail {
        height: 180px;
    }
}

/* Tablet optimization */
@media (min-width: 769px) and (max-width: 1024px) {
    .rps-slidein {
        width: 400px;
    }
}

/* Scrollbar styling - Kadence style */
.rps-content::-webkit-scrollbar {
    width: 8px;
}

.rps-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
}

.rps-content::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    transition: background 0.2s;
}

.rps-content::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Smooth animations */
@keyframes slideInUp {
    from {
        bottom: -100%;
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        bottom: 0;
        opacity: 1;
        transform: scale(1);
    }
}

/* Focus states for accessibility */
.rps-close:focus,
.rps-post-title a:focus,
.rps-read-more:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Prevent body scroll on mobile when active */
body.rps-active {
    overflow: hidden;
}

/* Loading shimmer effect */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

.rps-loading span:last-child {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Premium gradient accents */
.rps-slidein::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}
