/* Marxist Education Portal - Modern Sidebar Styles */
.marxist-sidebar-modern {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: sticky;
    top: 20px;
}

.sidebar-widget {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border-radius: 16px;
    padding: 0;
    margin-bottom: 24px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(229, 231, 235, 0.8);
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-widget:hover {
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.widget-header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.widget-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.widget-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

.widget-content {
    padding: 20px 24px;
}

/* Share Widget Styles */
.share-grid-modern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.share-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    background: white;
    position: relative;
    overflow: hidden;
}

.share-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transition: left 0.6s;
}

.share-card:hover::before {
    left: 100%;
}

.share-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.15);
}

.share-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 18px;
    transition: all 0.3s ease;
}

.share-platform {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Platform-specific styles */
.twitter-modern {
    color: #1da1f2;
}

.twitter-modern .share-icon-wrapper {
    background: #e8f4fd;
    border: 2px solid #1da1f2;
}

.twitter-modern:hover {
    border-color: #1da1f2;
}

.facebook-modern {
    color: #1877f2;
}

.facebook-modern .share-icon-wrapper {
    background: #e7f3ff;
    border: 2px solid #1877f2;
}

.facebook-modern:hover {
    border-color: #1877f2;
}

.instagram-modern {
    color: #e4405f;
}

.instagram-modern .share-icon-wrapper {
    background: #ffe4ec;
    border: 2px solid #e4405f;
}

.instagram-modern:hover {
    border-color: #e4405f;
}

.email-modern {
    color: #ea4335;
}

.email-modern .share-icon-wrapper {
    background: #fce8e6;
    border: 2px solid #ea4335;
}

.email-modern:hover {
    border-color: #ea4335;
}

/* Author Posts Styles */
.author-post-card {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.3s ease;
}

.author-post-card:hover {
    background-color: #f8f9fa;
    border-radius: 12px;
    margin: 0 -12px;
    padding: 16px 12px;
}

.author-post-card:last-child {
    border-bottom: none;
}

.post-thumbnail-modern {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.post-thumb-link {
    display: block;
    width: 100%;
    height: 100%;
}

.post-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.author-post-card:hover .post-thumb-img {
    transform: scale(1.1);
}

.post-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.placeholder-icon {
    font-size: 18px;
    opacity: 0.8;
}

.post-content-modern {
    flex: 1;
    min-width: 0;
}

.post-title-modern {
    margin: 0 0 6px 0;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
}

.post-title-modern a {
    color: #1f2937;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-title-modern a:hover {
    color: #dc2626;
}

.post-meta-modern {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #6b7280;
}

.post-reading-time {
    color: #dc2626;
    font-weight: 600;
}

.no-posts-message {
    text-align: center;
    padding: 30px 20px;
    color: #6b7280;
}

.no-posts-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-posts-message p {
    margin: 0;
    font-size: 14px;
}

/* Topics Widget */
.topics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.topic-tag {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.topic-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -6px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.topic-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 30px); /* Reserve space for count */
    flex: 1;
}

.topic-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

/* Topic Colors */
.topic-color-1 { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.topic-color-2 { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }
.topic-color-3 { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.topic-color-4 { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.topic-color-5 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: white; }
.topic-color-6 { background: linear-gradient(135deg, #6b7280, #4b5563); color: white; }

/* Actions Widget */
.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    border-radius: 12px;
    text-decoration: none;
    background: white;
    border: 2px solid #e5e7eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #374151;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.15);
}

.action-icon {
    font-size: 20px;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}

.action-card:hover .action-icon {
    transform: scale(1.2);
}

.action-text {
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Action Type Colors */
.search-action:hover { 
    border-color: #dc2626; 
    color: #dc2626;
}
.newsletter-action:hover { 
    border-color: #3b82f6; 
    color: #3b82f6;
}
.study-action:hover { 
    border-color: #8b5cf6; 
    color: #8b5cf6;
}
.contact-action:hover { 
    border-color: #10b981; 
    color: #10b981;
}

/* Newsletter Widget */
.newsletter-widget-modern .widget-content p {
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #6b7280;
    text-align: center;
}

.newsletter-form-modern {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.newsletter-input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.newsletter-submit {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -6px rgba(220, 38, 38, 0.4);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .marxist-sidebar-modern {
        position: static;
    }
}

@media (max-width: 768px) {
    .share-grid-modern,
    .topics-grid,
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .widget-header {
        padding: 16px 20px;
    }
    
    .widget-content {
        padding: 16px 20px;
    }
    
    .author-post-card {
        flex-direction: column;
        text-align: center;
    }
    
    .post-thumbnail-modern {
        width: 100%;
        height: 120px;
        margin-bottom: 8px;
    }
    
    .post-meta-modern {
        justify-content: center;
    }
    
    .sidebar-widget {
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .share-grid-modern,
    .topics-grid,
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar-widget {
    animation: fadeInUp 0.6s ease-out;
}

.sidebar-widget:nth-child(1) { animation-delay: 0.1s; }
.sidebar-widget:nth-child(2) { animation-delay: 0.2s; }
.sidebar-widget:nth-child(3) { animation-delay: 0.3s; }
.sidebar-widget:nth-child(4) { animation-delay: 0.4s; }
.sidebar-widget:nth-child(5) { animation-delay: 0.5s; }

/* Focus styles for accessibility */
.share-card:focus,
.topic-tag:focus,
.action-card:focus,
.author-post-card a:focus,
.newsletter-input:focus,
.newsletter-submit:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .sidebar-widget {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        border-color: #374151;
    }
    
    .share-card,
    .action-card {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    .post-title-modern a {
        color: #f3f4f6;
    }
    
    .author-post-card:hover {
        background-color: #374151;
    }
    
    .no-posts-message {
        color: #d1d5db;
    }
    
    .newsletter-input {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    .newsletter-input::placeholder {
        color: #9ca3af;
    }
    
    .topic-tag:hover {
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* Print styles */
@media print {
    .marxist-sidebar-modern {
        display: none;
    }
}

/* Popularity indicator styles */
.post-popularity {
    color: #dc2626;
    font-weight: 600;
    font-size: 10px;
}

/* Ensure proper spacing for the new meta layout */
.post-meta-modern {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #6b7280;
    flex-wrap: wrap;
}