/* ============================================
   PushForge Real-time System Styles
   Instagram/Facebook/NYT Inspired Design
   ============================================ */

/* ========== CSS VARIABLES ========== */
:root {
    --modal-backdrop: rgba(0, 0, 0, 0.85);
    --modal-bg: #262626;
    --overlay-gradient: linear-gradient(135deg, rgba(231, 79, 80, 0.1), rgba(247, 71, 104, 0.05));
}

/* ========== KEYFRAME ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalSlideUp {
    0% {
        opacity: 0;
        transform: translateY(100%) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateY(-10px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalPop {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    50% {
        transform: scale(1.02) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes storyProgress {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes storyPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 79, 80, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(231, 79, 80, 0); }
}

@keyframes slideInCard {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes statBump {
    0%, 100% { transform: scale(1); }
    50% {
        transform: scale(1.2);
        color: var(--primary);
    }
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(231, 79, 80, 0.3); }
    50% { box-shadow: 0 0 40px rgba(231, 79, 80, 0.6); }
}

/* ========== NEW CONTENT BANNER ========== */
.new-content-banner {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.new-content-banner.visible {
    transform: translateX(-50%) translateY(0);
}

.new-content-banner button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(231, 79, 80, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.new-content-banner button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(231, 79, 80, 0.5);
}

.new-content-banner button:active {
    transform: scale(0.98);
}

.new-content-banner button i {
    animation: bounce 1s infinite;
}

/* ========== LOGIN OVERLAY (Instagram-Style) ========== */
.login-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-backdrop);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-overlay.active {
    opacity: 1;
    visibility: visible;
}

.login-overlay-content {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    transform: scale(0.9) translateY(30px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.login-overlay-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--secondary));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

.login-overlay.active .login-overlay-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.login-overlay-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 1;
}

.login-overlay-close:hover {
    background: var(--hover);
    color: var(--text-primary);
    border-color: var(--border-light);
    transform: rotate(90deg);
}

.login-overlay-header {
    margin-bottom: 32px;
}

.login-overlay-header .icon-wrapper {
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconFloat 3s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(231, 79, 80, 0.4);
}

.login-overlay-header .icon-wrapper i {
    font-size: 40px;
    color: white;
}

.login-overlay-header i:not(.icon-wrapper i) {
    font-size: 52px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    display: block;
    animation: iconFloat 3s ease-in-out infinite;
}

.login-overlay-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-overlay-header p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 280px;
    margin: 0 auto;
}

.login-overlay-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-overlay-primary,
.btn-overlay-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-overlay-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 14px rgba(231, 79, 80, 0.3);
}

.btn-overlay-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 79, 80, 0.4);
}

.btn-overlay-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-overlay-secondary:hover {
    background: var(--hover);
    border-color: var(--text-secondary);
}

.login-overlay-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.login-overlay-footer p {
    font-size: 12px;
    color: var(--text-secondary);
}

.login-overlay-footer a {
    color: var(--text-primary);
    text-decoration: none;
}

.login-overlay-footer a:hover {
    text-decoration: underline;
}

/* ========== ACTIVE STATE FOR ACTION BUTTONS ========== */
.action-btn.active,
.repost-btn.active {
    color: #00ba7c !important;
}

.repost-btn.active i {
    animation: spin 0.5s ease;
}

/* ========== ARTICLE CARD ANIMATIONS ========== */
.article-card {
    transition: all 0.3s ease;
}

.article-card.new {
    animation: slideInCard 0.4s ease;
}

/* ========== STORY ITEM PULSE ========== */
.story-item.new .story-ring {
    animation: storyPulse 2s ease infinite;
}

/* ========== STORIES BLURRED (Non-logged users) ========== */
.stories-blurred {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stories-blurred:hover {
    transform: scale(1.01);
}

.stories-blurred .stories-scroll {
    filter: blur(6px);
    pointer-events: none;
    transition: filter 0.3s ease;
}

.stories-blurred:hover .stories-scroll {
    filter: blur(4px);
}

.stories-overlay-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    padding: 12px 24px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stories-blurred:hover .stories-overlay-prompt {
    transform: translate(-50%, -50%) scale(1.05);
    background: rgba(231, 79, 80, 0.9);
}

.stories-overlay-prompt i {
    font-size: 14px;
    animation: pulse 2s ease-in-out infinite;
}

/* ========== FEED LOGIN PROMPT (index.php style) ========== */
.feed-login-prompt {
    position: relative;
    margin: 24px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: slideInCard 0.5s ease;
}

.feed-login-content {
    position: relative;
    min-height: 380px;
}

.feed-login-blur {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(0, 0, 0, 0.7) 20%,
        var(--dark-bg) 100%
    );
    z-index: 1;
}

.feed-login-box {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 56px 44px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.feed-login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--secondary));
}

.feed-login-box .rocket-logo {
    width: 84px;
    height: 84px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(231, 79, 80, 0.4);
}

.feed-login-box .rocket-logo i {
    font-size: 38px;
    color: white;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.feed-login-box i:not(.rocket-logo i) {
    font-size: 48px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    display: block;
}

.feed-login-box h3 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.feed-login-box p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 28px;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
}

.feed-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 300px;
    margin: 0 auto;
}

.btn-feed-primary,
.btn-feed-secondary {
    display: block;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-feed-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 14px rgba(231, 79, 80, 0.3);
}

.btn-feed-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 79, 80, 0.4);
}

.btn-feed-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-feed-secondary:hover {
    background: var(--hover);
    border-color: var(--text-secondary);
}

/* ========== HIDE/BLUR ARTICLES FOR NON-LOGGED USERS (index.php) ========== */
.article-card.preview-card ~ .article-card:not(.feed-login-prompt ~ .article-card) {
    display: none;
}

.feed-login-prompt,
.feed-login-prompt ~ .article-card {
    display: block;
}

body:not(.logged-in) .feed-login-prompt ~ .article-card {
    position: relative;
}

body:not(.logged-in) .feed-login-prompt ~ .article-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, var(--dark-bg) 80%);
    pointer-events: none;
    z-index: 1;
}

body:not(.logged-in) .feed-login-prompt ~ .article-card:nth-child(n+5) {
    display: none;
}

body:not(.logged-in) .article-card .article-content a,
body:not(.logged-in) .article-card .article-image {
    cursor: pointer;
}

/* ========== ARTICLE BODY PREVIEW (article.php) ========== */
.article-body-preview {
    position: relative;
    max-height: 400px;
    overflow: hidden;
}

.article-body-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, transparent 0%, var(--dark-bg) 100%);
    pointer-events: none;
}

/* ========== ARTICLE LOGIN WALL (article.php) ========== */
.article-login-wall {
    position: relative;
    margin-top: -120px;
    padding-top: 120px;
    animation: fadeIn 0.5s ease;
}

.article-login-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(to bottom, transparent 0%, var(--dark-bg) 100%);
    pointer-events: none;
}

.article-login-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 52px 44px;
    text-align: center;
    margin: 0 var(--spacing-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-login-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--secondary));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

.article-login-content .rocket-logo {
    width: 84px;
    height: 84px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(231, 79, 80, 0.4);
}

.article-login-content .rocket-logo i {
    font-size: 38px;
    color: white;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.article-login-content i:not(.rocket-logo i) {
    font-size: 56px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    display: block;
    animation: iconFloat 3s ease-in-out infinite;
}

.article-login-content h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.article-login-content p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 28px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.article-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 320px;
    margin: 0 auto;
}

.btn-article-primary,
.btn-article-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-article-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 14px rgba(231, 79, 80, 0.3);
}

.btn-article-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 79, 80, 0.4);
}

.btn-article-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-article-secondary:hover {
    background: var(--hover);
    border-color: var(--text-secondary);
}

/* ========== RELATED ARTICLES BLUR (article.php - matches index.php) ========== */
.related-articles {
    margin-top: var(--spacing-xl);
    animation: fadeIn 0.5s ease;
}

.related-articles h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    padding: 0 4px;
}

/* Non-logged user blur on related articles */
body:not(.logged-in) .related-articles .article-card {
    position: relative;
}

body:not(.logged-in) .related-articles .article-card:nth-child(n+2)::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, var(--dark-bg) 80%);
    pointer-events: none;
    z-index: 1;
}

body:not(.logged-in) .related-articles .article-card:nth-child(n+3) {
    display: none;
}

/* Related articles login prompt */
.related-login-prompt {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 36px;
    text-align: center;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.related-login-prompt::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--secondary));
}

.related-login-prompt .rocket-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(231, 79, 80, 0.4);
}

.related-login-prompt .rocket-logo i {
    font-size: 32px;
    color: white;
}

.related-login-prompt h4 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.related-login-prompt p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.related-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 260px;
    margin: 0 auto;
}

/* ========== PROFILE PAGE STYLES ========== */

/* Profile login prompt (scroll-aware modal) */
.profile-login-prompt {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 52px 36px;
    text-align: center;
    margin: 24px 0;
    position: relative;
    overflow: hidden;
    animation: modalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.profile-login-prompt::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--secondary));
}

.profile-login-prompt .rocket-logo {
    width: 76px;
    height: 76px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(231, 79, 80, 0.4);
}

.profile-login-prompt .rocket-logo i {
    font-size: 34px;
    color: white;
}

.profile-login-prompt h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.profile-login-prompt p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 28px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.profile-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 280px;
    margin: 0 auto;
}

.btn-profile-primary,
.btn-profile-secondary {
    display: block;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-profile-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 14px rgba(231, 79, 80, 0.3);
}

.btn-profile-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 79, 80, 0.4);
}

.btn-profile-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-profile-secondary:hover {
    background: var(--hover);
    border-color: var(--text-secondary);
}

/* ========== PROFILE ARTICLES BLUR (matches index.php style) ========== */
/* ========== PROFILE ARTICLES BLUR (matches index.php style) - ONLY FOR NON-LOGGED USERS ========== */
/* These styles should ONLY apply when body does NOT have the logged-in class */

/* IMPORTANT: Only show blur/restrictions for non-logged users */
body:not(.logged-in) .profile-container .feed .article-card {
    position: relative;
}

/* Show only first 2 articles, blur the second one - ONLY for non-logged users */
body:not(.logged-in) .profile-container .feed .article-card:nth-child(2)::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, var(--dark-bg) 80%);
    pointer-events: none;
    z-index: 1;
}

/* Hide articles after the second one - ONLY for non-logged users */
body:not(.logged-in) .profile-container .feed .article-card:nth-child(n+3):not(.profile-login-prompt) {
    display: none;
}

/* Show the login prompt - ONLY for non-logged users */
body:not(.logged-in) .profile-container .feed .profile-login-prompt {
    display: block;
}

/* CRITICAL: Ensure logged-in users see everything normally */
body.logged-in .profile-container .feed .article-card {
    position: static !important;
}

body.logged-in .profile-container .feed .article-card::after {
    display: none !important;
}

body.logged-in .profile-container .feed .profile-login-prompt {
    display: none !important;
}

body.logged-in .profile-container .feed .article-card {
    display: block !important;
}

/* ========== SCROLL-AWARE MODAL (profile.php) ========== */
.scroll-login-modal {
    position: fixed;
    inset: 0;
    background: var(--modal-backdrop);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.scroll-login-modal.active {
    opacity: 1;
    visibility: visible;
}

.scroll-login-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    transform: scale(0.9) translateY(30px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.scroll-login-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--secondary));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

.scroll-login-modal.active .scroll-login-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.scroll-login-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 1;
}

.scroll-login-modal-close:hover {
    background: var(--hover);
    color: var(--text-primary);
    border-color: var(--border-light);
    transform: rotate(90deg);
}

.scroll-login-modal-header {
    margin-bottom: 32px;
}

.scroll-login-modal-header .rocket-logo {
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconFloat 3s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(231, 79, 80, 0.4);
}

.scroll-login-modal-header .rocket-logo i {
    font-size: 40px;
    color: white;
}

.scroll-login-modal-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.scroll-login-modal-header p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 280px;
    margin: 0 auto;
}

.scroll-login-modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.scroll-login-modal-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.scroll-login-modal-footer p {
    font-size: 12px;
    color: var(--text-secondary);
}

.scroll-login-modal-footer a {
    color: var(--text-primary);
    text-decoration: none;
}

.scroll-login-modal-footer a:hover {
    text-decoration: underline;
}

/* ========== STORY ITEM EMPTY STATE ========== */
.story-item-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.story-item-empty:hover {
    opacity: 0.7;
}

.story-ring-empty {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px dashed var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.story-ring-empty i {
    font-size: 24px;
    color: var(--text-secondary);
}

/* ========== ANIMATED STAT UPDATES ========== */
#article-count,
#followers-count,
#following-count {
    transition: all 0.3s ease;
    display: inline-block;
}

#article-count.updated,
#followers-count.updated,
#following-count.updated {
    animation: statBump 0.4s ease;
}

.stat-value {
    display: inline-block;
    min-width: 20px;
    text-align: center;
}

/* ========== NOTIFICATION BADGE ========== */
.notification-badge {
    animation: badgePulse 2s ease-in-out infinite;
}

/* ========== SKELETON LOADING ========== */
.skeleton {
    background: linear-gradient(90deg, var(--card-bg) 25%, var(--hover) 50%, var(--card-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 200px;
}

/* ========== LOADING SPINNER ========== */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-spinner i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: calc(100vw - 40px);
    pointer-events: none;
}

.toast {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    pointer-events: auto;
    animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.hiding {
    animation: slideOutRight 0.3s ease forwards;
}

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.toast-icon.success {
    background: rgba(46, 213, 115, 0.15);
    color: #2ed573;
}

.toast-icon.error {
    background: rgba(237, 73, 86, 0.15);
    color: #ed4956;
}

.toast-icon.info {
    background: rgba(74, 144, 226, 0.15);
    color: #4a90e2;
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-dismiss {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    line-height: 1;
    opacity: 0.5;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.toast-dismiss:hover {
    opacity: 1;
    background: var(--hover);
}

/* Live Notification Toast */
.live-notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    max-width: 380px;
    width: calc(100vw - 40px);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.live-notification-toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.live-notification-toast.toast-visible {
    transform: translateX(0);
}

.live-notification-toast.toast-hiding {
    transform: translateX(120%);
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toast-content:hover {
    background: var(--hover);
}

.toast-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-light);
}

.toast-text {
    flex: 1;
    min-width: 0;
}

.toast-text strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 3px;
    font-weight: 600;
}

.toast-text p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    opacity: 0.5;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.toast-close:hover {
    opacity: 1;
    background: var(--hover);
}

/* ========== BUTTON LOADING STATE ========== */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== PROGRESS BAR ========== */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (max-width: 768px) {
    .login-overlay-content {
        padding: 40px 28px;
        border-radius: 20px 20px 0 0;
        margin-top: auto;
        max-width: 100%;
        animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    
    .login-overlay.active .login-overlay-content {
        transform: none;
    }
    
    .login-overlay-header h2 {
        font-size: 24px;
    }
    
    .login-overlay-header .icon-wrapper,
    .login-overlay-header .rocket-logo {
        width: 72px;
        height: 72px;
    }
    
    .login-overlay-header .icon-wrapper i,
    .login-overlay-header .rocket-logo i {
        font-size: 32px;
    }
    
    .new-content-banner button {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .feed-login-box {
        padding: 44px 28px;
        margin: 16px;
    }
    
    .feed-login-box h3 {
        font-size: 22px;
    }
    
    .feed-login-box .rocket-logo {
        width: 72px;
        height: 72px;
    }
    
    .feed-login-box .rocket-logo i {
        font-size: 32px;
    }
    
    .article-login-content {
        padding: 40px 28px;
        margin: 0 var(--spacing-lg);
        border-radius: var(--radius-lg);
    }
    
    .article-login-content h3 {
        font-size: 24px;
    }
    
    .article-login-content i:not(.rocket-logo i) {
        font-size: 48px;
    }
    
    .article-login-content .rocket-logo {
        width: 72px;
        height: 72px;
    }
    
    .article-login-content .rocket-logo i {
        font-size: 32px;
    }
    
    .profile-login-prompt {
        padding: 40px 24px;
    }
    
    .profile-login-prompt h3 {
        font-size: 22px;
    }
    
    .profile-login-prompt .rocket-logo {
        width: 68px;
        height: 68px;
    }
    
    .profile-login-prompt .rocket-logo i {
        font-size: 30px;
    }
    
    .scroll-login-modal-content {
        padding: 40px 28px;
        border-radius: 20px 20px 0 0;
        margin-top: auto;
        max-width: 100%;
    }
    
    .scroll-login-modal.active .scroll-login-modal-content {
        transform: none;
        animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    
    .scroll-login-modal-header h2 {
        font-size: 24px;
    }
    
    .scroll-login-modal-header .rocket-logo {
        width: 72px;
        height: 72px;
    }
    
    .scroll-login-modal-header .rocket-logo i {
        font-size: 32px;
    }
    
    .related-login-prompt {
        padding: 40px 24px;
    }
    
    .related-login-prompt h4 {
        font-size: 20px;
    }
    
    .related-login-prompt .rocket-logo {
        width: 64px;
        height: 64px;
    }
    
    .related-login-prompt .rocket-logo i {
        font-size: 28px;
    }
    
    .toast-container {
        top: 70px;
        right: 12px;
        left: 12px;
        max-width: none;
        width: auto;
    }
    
    .live-notification-toast {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
        width: auto;
    }
}

@media (max-width: 480px) {
    .login-overlay-content {
        padding: 36px 24px;
    }
    
    .login-overlay-header h2 {
        font-size: 22px;
    }
    
    .login-overlay-header p {
        font-size: 14px;
    }
    
    .login-overlay-header .icon-wrapper,
    .login-overlay-header .rocket-logo {
        width: 64px;
        height: 64px;
    }
    
    .login-overlay-header .icon-wrapper i,
    .login-overlay-header .rocket-logo i {
        font-size: 28px;
    }
    
    .btn-overlay-primary,
    .btn-overlay-secondary {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .feed-login-box {
        padding: 36px 20px;
        margin: 12px;
    }
    
    .feed-login-box h3 {
        font-size: 20px;
    }
    
    .feed-login-box p {
        font-size: 14px;
    }
    
    .feed-login-box .rocket-logo {
        width: 64px;
        height: 64px;
    }
    
    .feed-login-box .rocket-logo i {
        font-size: 28px;
    }
    
    .feed-login-buttons {
        max-width: 100%;
    }
    
    .btn-feed-primary,
    .btn-feed-secondary {
        padding: 13px 20px;
        font-size: 14px;
    }
    
    .article-login-content {
        padding: 32px 20px;
        margin: 0 var(--spacing-md);
    }
    
    .article-login-content h3 {
        font-size: 20px;
    }
    
    .article-login-content i:not(.rocket-logo i) {
        font-size: 40px;
    }
    
    .article-login-content p {
        font-size: 14px;
    }
    
    .article-login-content .rocket-logo {
        width: 64px;
        height: 64px;
    }
    
    .article-login-content .rocket-logo i {
        font-size: 28px;
    }
    
    .article-login-buttons {
        max-width: 100%;
    }
    
    .btn-article-primary,
    .btn-article-secondary {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .profile-login-prompt {
        padding: 32px 20px;
    }
    
    .profile-login-prompt h3 {
        font-size: 20px;
    }
    
    .profile-login-prompt p {
        font-size: 14px;
    }
    
    .profile-login-prompt .rocket-logo {
        width: 64px;
        height: 64px;
    }
    
    .profile-login-prompt .rocket-logo i {
        font-size: 28px;
    }
    
    .profile-login-buttons {
        max-width: 100%;
    }
    
    .btn-profile-primary,
    .btn-profile-secondary {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .scroll-login-modal-content {
        padding: 36px 24px;
    }
    
    .scroll-login-modal-header h2 {
        font-size: 22px;
    }
    
    .scroll-login-modal-header p {
        font-size: 14px;
    }
    
    .scroll-login-modal-header .rocket-logo {
        width: 64px;
        height: 64px;
    }
    
    .scroll-login-modal-header .rocket-logo i {
        font-size: 28px;
    }
    
    .related-login-prompt {
        padding: 32px 20px;
    }
    
    .related-login-prompt h4 {
        font-size: 18px;
    }
    
    .related-login-prompt p {
        font-size: 14px;
    }
    
    .related-login-prompt .rocket-logo {
        width: 56px;
        height: 56px;
    }
    
    .related-login-prompt .rocket-logo i {
        font-size: 24px;
    }
    
    .related-login-buttons {
        max-width: 100%;
    }
    
    .toast {
        padding: 14px 16px;
    }
    
    .toast-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .toast-title {
        font-size: 13px;
    }
    
    .toast-message {
        font-size: 12px;
    }
    
    .story-ring-empty,
    .story-item-empty .story-ring-empty {
        width: 70px;
        height: 70px;
    }
    
    .story-ring-empty i {
        font-size: 20px;
    }
}

/* ========== HIGH CONTRAST MODE ========== */
@media (prefers-contrast: high) {
    .login-overlay-content,
    .feed-login-box,
    .article-login-content,
    .profile-login-prompt,
    .scroll-login-modal-content,
    .related-login-prompt {
        border-width: 2px;
    }
    
    .btn-overlay-primary,
    .btn-feed-primary,
    .btn-article-primary,
    .btn-profile-primary {
        border: 2px solid white;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    .login-overlay,
    .scroll-login-modal,
    .new-content-banner,
    .toast-container,
    .live-notification-toast,
    .feed-login-prompt,
    .article-login-wall,
    .profile-login-prompt,
    .related-login-prompt,
    .stories-blurred {
        display: none !important;
    }
}

/* ========== BLURRED CARD (2nd article for non-logged users) ========== */
/* ONLY apply to non-logged users */
body:not(.logged-in) .blurred-card {
    position: relative;
}

body:not(.logged-in) .blurred-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, transparent 40%, var(--dark-bg) 100%);
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

/* Ensure logged-in users don't see blur */
body.logged-in .blurred-card::after {
    display: none !important;
}

.blurred-card .article-actions {
    position: relative;
    z-index: 0;
}

/* Click through to trigger login overlay */
body:not(.logged-in) .blurred-card .article-content a,
body:not(.logged-in) .blurred-card .article-image {
    cursor: pointer;
}

body:not(.logged-in) .blurred-card:hover::after {
    background: linear-gradient(to bottom, transparent 0%, transparent 30%, var(--dark-bg) 100%);
}