/**
 * Trending Insight Widget Styles
 * 
 * @package Impact_Evaluator
 */

/* Trending Insight Container */
.trending-insight-container {
    position: relative;
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    padding: 20px;
}

.trending-insight-container.has-top-border {
    border-top-width: 5px;
    border-top-color: #020244;
}

/* Trending Insight Header */
.trending-insight-header {
    padding: 10px 0 0 0;
    margin-bottom: 20px;
}

.trending-insight-title {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #020244;
    margin: 0 0 20px 0;
    text-align: center;
    border-bottom: 2px solid #020244;
    padding-bottom: 10px;
    box-shadow: 0 5px 10px -5px rgba(0, 0, 0, 0.5);
}

/* Trending Insight Content */
.trending-insight-content {
    position: relative;
}

/* Post Type Groups */
.post-type-group {
    margin-bottom: 25px;
}

.post-type-group:last-child {
    margin-bottom: 0;
}

/* Post Type More Title */
.post-type-more-title {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #020244;
    margin-top: 15px;
    margin-bottom: 0;
    padding: 8px 16px;
    background-color: #f8f9fa;
    border-radius: 6px;
    position: relative;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    width: auto;
    min-width: 120px;
}

.post-type-more-title--left {
    text-align: left;
}

.post-type-more-title--center {
    text-align: center;
}

.post-type-more-title--right {
    text-align: right;
}

/* Typography Variations */
.post-type-more-title--small {
    font-size: 12px;
    padding: 6px 12px;
    min-width: 100px;
}

.post-type-more-title--medium {
    font-size: 18px;
    padding: 10px 20px;
    min-width: 140px;
}

.post-type-more-title--large {
    font-size: 20px;
    padding: 12px 24px;
    min-width: 160px;
}

/* Hover Effects */
.post-type-more-title:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.post-type-more-title a {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
}

.post-type-more-title a:hover {
    text-decoration: none;
}

/* Trending Post Compact */
.trending-post-compact {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.trending-post-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: #ffffff;
}

.trending-post-compact:last-child {
    margin-bottom: 0;
}

.trending-post-compact a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.trending-post-compact a:hover {
    text-decoration: none;
    color: inherit;
}

/* Post Category */
.trending-post-compact .post-category {
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: #590000;
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

/* Post Date */
.trending-post-compact .post-date {
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    color: #666666;
    margin-bottom: 8px;
    font-weight: 400;
}

/* Post Title */
.trending-post-compact .post-title {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #020244;
    line-height: 1.3;
    margin: 0;
}

/* No Posts Found */
.no-posts-found {
    text-align: center;
    padding: 20px;
    color: #666666;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-style: italic;
}

/* Loading State */
.trending-post-compact.loading {
    opacity: 0.7;
    pointer-events: none;
}

.trending-post-compact.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #020244;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Focus States for Accessibility */
.trending-post-compact:focus,
.trending-post-compact a:focus {
    outline: 2px solid #020244;
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .trending-insight-container {
        padding: 15px;
        border-radius: 8px;
    }

    .trending-insight-title {
        font-size: 18px;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }

    .post-type-group {
        margin-bottom: 20px;
    }

    .post-type-more-title {
        font-size: 14px;
        margin-top: 12px;
        padding: 6px 12px;
        min-width: 100px;
    }

    .post-type-more-title--small {
        font-size: 11px;
        padding: 5px 10px;
        min-width: 90px;
    }

    .post-type-more-title--medium {
        font-size: 16px;
        padding: 8px 16px;
        min-width: 120px;
    }

    .post-type-more-title--large {
        font-size: 18px;
        padding: 10px 20px;
        min-width: 140px;
    }

    .trending-post-compact {
        padding: 12px;
        margin-bottom: 12px;
    }

    .trending-post-compact .post-category {
        font-size: 9px;
        margin-bottom: 4px;
    }

    .trending-post-compact .post-date {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .trending-post-compact .post-title {
        font-size: 13px;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .trending-insight-container {
        padding: 12px;
    }

    .trending-insight-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .post-type-group {
        margin-bottom: 15px;
    }

    .post-type-more-title {
        font-size: 13px;
        margin-top: 10px;
        padding: 5px 10px;
        min-width: 90px;
    }

    .post-type-more-title--small {
        font-size: 10px;
        padding: 4px 8px;
        min-width: 80px;
    }

    .post-type-more-title--medium {
        font-size: 15px;
        padding: 6px 12px;
        min-width: 100px;
    }

    .post-type-more-title--large {
        font-size: 16px;
        padding: 8px 16px;
        min-width: 120px;
    }

    .trending-post-compact {
        padding: 10px;
        margin-bottom: 10px;
    }

    .trending-post-compact .post-title {
        font-size: 12px;
    }
}

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

.trending-insight-container {
    animation: fadeInUp 0.6s ease-out forwards;
}

.trending-post-compact {
    animation: fadeInUp 0.4s ease-out forwards;
}

.trending-post-compact:nth-child(1) {
    animation-delay: 0.1s;
}

.trending-post-compact:nth-child(2) {
    animation-delay: 0.2s;
}

.trending-post-compact:nth-child(3) {
    animation-delay: 0.3s;
}

.trending-post-compact:nth-child(4) {
    animation-delay: 0.4s;
}

.trending-post-compact:nth-child(5) {
    animation-delay: 0.5s;
}

/* Elementor Editor Specific Styles */
.elementor-editor-active .trending-insight-container,
.elementor-editor-active .trending-post-compact {
    animation: none;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .trending-insight-container {
        border-width: 2px;
    }
    
    .trending-insight-container.has-top-border {
        border-top-width: 6px;
    }
    
    .trending-insight-title {
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
        border-bottom-width: 3px;
    }
    
    .trending-post-compact {
        border: 1px solid #e9ecef;
    }
    
    .trending-post-compact:hover {
        border-color: #020244;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .trending-insight-container,
    .trending-post-compact {
        animation: none;
    }
    
    .trending-post-compact {
        transition: none;
    }
    
    .trending-post-compact:hover {
        transform: none;
    }
    
    .trending-post-compact.loading::after {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .trending-insight-container {
        background: #ffffff !important;
        border: 1px solid #000000 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .trending-insight-title {
        color: #000000 !important;
        border-bottom-color: #000000 !important;
        box-shadow: none !important;
    }
    
    .trending-post-compact {
        background: #f8f8f8 !important;
        border: 1px solid #cccccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 10px !important;
    }
    
    .trending-post-compact .post-category {
        color: #000000 !important;
    }
    
    .trending-post-compact .post-date {
        color: #333333 !important;
    }
    
    .trending-post-compact .post-title {
        color: #000000 !important;
    }
    
    .trending-post-compact:hover {
        transform: none !important;
        background: #f8f8f8 !important;
    }
}

/* Widget Variations */
.trending-insight-container.compact-mode {
    padding: 15px;
}

.trending-insight-container.compact-mode .trending-post-compact {
    padding: 10px;
    margin-bottom: 10px;
}

.trending-insight-container.compact-mode .trending-insight-title {
    font-size: 18px;
    margin-bottom: 15px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .trending-insight-container {
        background: #1a1a1a;
        border-color: #333333;
        color: #ffffff;
    }

    .trending-insight-title {
        color: #ffffff;
        border-bottom-color: #ffffff;
    }

    .post-type-more-title {
        color: #ffffff;
        background-color: #333333;
    }

    .post-type-more-title a {
        color: #ffffff;
    }

    .post-type-more-title a:hover {
        color: #ff6b6b;
    }

    .post-type-more-title::after {
        background: #ff6b6b;
    }

    .trending-post-compact {
        background: #2a2a2a;
    }

    .trending-post-compact:hover {
        background: #333333;
    }

    .trending-post-compact .post-title {
        color: #ffffff;
    }

    .trending-post-compact .post-date {
        color: #cccccc;
    }

    .no-posts-found {
        color: #cccccc;
    }
}
