/**
 * Bento Content Styles
 * Path: /assets/css/bento-content.css
 * 
 * Functionality:
 * - Styles for all Bento Grid content components
 * - Widget styling (newsletter, jobs, events, premium)
 * - Article card variations
 * - Ad integration styles
 * - Responsive breakpoints
 */

/* ==========================================================================
   Load More Section
   ========================================================================== */

.load-more-container {
    display: flex;
    justify-content: center;
    margin: var(--spacing-3xl) 0;
    padding: var(--spacing-xl) 0;
}

.load-more-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.load-more-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--accent-blue);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.load-more-button:hover {
    border-color: var(--accent-blue);
    color: white;
    transform: translateY(-2px);
}

.load-more-button:hover::before {
    width: 400px;
    height: 400px;
}

.load-more-button span,
.load-more-button svg {
    position: relative;
    z-index: 1;
}

.load-more-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.load-more-button.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Shimmer Effect for Loading States
   ========================================================================== */

.shimmer-wrapper {
    position: relative;
    overflow: hidden;
}

.shimmer-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    animation: shimmerSlide 2s infinite;
}

@keyframes shimmerSlide {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ==========================================================================
   Content Animation Classes
   ========================================================================== */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
}

.fade-in.visible {
    animation: fadeInUp 0.6s ease forwards;
}

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

.scale-in {
    opacity: 0;
    transform: scale(0.9);
}

.scale-in.visible {
    animation: scaleIn 0.5s ease forwards;
}

@keyframes scaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================================================
   Utility Classes for Content
   ========================================================================== */

/* Aspect Ratios */
.aspect-16-9 {
    aspect-ratio: 16 / 9;
}

.aspect-4-3 {
    aspect-ratio: 4 / 3;
}

.aspect-1-1 {
    aspect-ratio: 1 / 1;
}

/* Text Truncation */
.truncate-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Badge Styles
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-premium {
    background: var(--accent-orange);
    color: white;
}

.badge-new {
    background: var(--accent-green);
    color: white;
}

.badge-sponsored {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
}

/* ==========================================================================
   Content Meta Styles
   ========================================================================== */

.content-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.content-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.content-meta-divider {
    opacity: 0.3;
}

/* ==========================================================================
   Interactive Elements
   ========================================================================== */

.interactive-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.interactive-card:hover {
    transform: translateY(-4px);
}

.interactive-card:active {
    transform: translateY(-2px);
}

/* Touch feedback for mobile */
@media (hover: none) and (pointer: coarse) {
    .interactive-card:active {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* ==========================================================================
   Skeleton Loading
   ========================================================================== */

.skeleton {
    background: var(--bg-secondary);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    animation: skeletonLoading 1.5s infinite;
}

@keyframes skeletonLoading {
    0% { left: -100%; }
    100% { left: 100%; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 80%;
    margin-bottom: 12px;
}

.skeleton-image {
    height: 200px;
    width: 100%;
    margin-bottom: 16px;
}

/* ==========================================================================
   Tooltip Styles
   ========================================================================== */

.tooltip {
    position: relative;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bg-tertiary);
}

.tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* ==========================================================================
   Content State Classes
   ========================================================================== */

.content-loading {
    opacity: 0.6;
    pointer-events: none;
}

.content-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.content-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.content-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ==========================================================================
   Responsive Content Adjustments
   ========================================================================== */

@media (max-width: 1200px) {
    /* Adjust widget layouts */
    .widget-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Mobile content adjustments */
    .content-meta {
        font-size: 12px;
        gap: 8px;
    }
    
    .badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .load-more-button {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    /* Small mobile adjustments */
    .content-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .content-meta-divider {
        display: none;
    }
}

/* ==========================================================================
   Print Styles for Content
   ========================================================================== */

@media print {
    .load-more-container,
    .floating-ad,
    .inline-banner,
    .native-ad {
        display: none !important;
    }
    
    .article-card {
        page-break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 20px;
    }
    
    .article-card a {
        color: black;
        text-decoration: none;
    }
    
    .article-card a::after {
        content: " (" attr(href) ")";
        font-size: 12px;
        color: #666;
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Focus styles for interactive elements */
.interactive-card:focus,
.load-more-button:focus,
.newsletter-input:focus,
.job-item:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 3px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .badge {
        border: 1px solid currentColor;
    }
    
    .skeleton {
        border: 1px solid var(--border-color);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Dark Mode Adjustments
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .content-error {
        background: rgba(239, 68, 68, 0.05);
    }
    
    .tooltip-content {
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
    }
    
    .tooltip-content::after {
        border-top-color: var(--bg-primary);
    }
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */

/* For Webkit browsers */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

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

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-primary);
}