/**
 * Sidebar Related Posts Styles
 * 
 * Styles for [tadochrelatedoutages] shortcode
 */

/* ============================================
   CONTAINER & TITLE
   ============================================ */

.tadoch-related-title {
    margin: 0 0 15px 0;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color, #333);
}

body.dark-mode .tadoch-related-title {
    color: var(--text-color-dark, #e0e0e0);
}

/* ============================================
   LIST CONTAINER
   ============================================ */

.tadoch-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tadoch-related-item {
    margin: 0 0 10px 0;
    padding: 0;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tadoch-related-item:last-child {
    margin-bottom: 0;
}

.tadoch-related-item:hover {
    transform: translateX(3px);
}

/* ============================================
   LINK (Flex container)
   ============================================ */

.tadoch-related-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    text-decoration: none;
    color: inherit;
    background: var(--content-bg, #fff);
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.tadoch-related-link:hover {
    background: var(--content-bg-hover, #f9f9f9);
    border-color: #ccc;
}

body.dark-mode .tadoch-related-link {
    background: var(--content-bg, #1a1a1a);
    border-color: #333;
}

body.dark-mode .tadoch-related-link:hover {
    background: var(--content-bg-hover, #252525);
    border-color: #444;
}

/* ============================================
   THUMBNAIL
   ============================================ */

.tadoch-related-thumb-wrap {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    background: #f0f0f0;
}

body.dark-mode .tadoch-related-thumb-wrap {
    background: #2a2a2a;
}

.tadoch-related-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tadoch-related-thumb-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
}

body.dark-mode .tadoch-related-thumb-placeholder {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
}

/* ============================================
   CONTENT (Title + Count)
   ============================================ */

.tadoch-related-content {
    flex: 1;
    min-width: 0; /* Allow text truncation */
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tadoch-related-post-title {
    font-weight: bold;
    color: var(--text-color, #333);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .tadoch-related-post-title {
    color: var(--text-color-dark, #e0e0e0);
}

.tadoch-related-link:hover .tadoch-related-post-title {
    color: var(--primary-color, #e74c3c);
}

body.dark-mode .tadoch-related-link:hover .tadoch-related-post-title {
    color: var(--primary-color-dark, #e74c3c);
}

.tadoch-related-outage-count {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-color);
    padding: 2px 6px;
    background: var(--outer-bg);
    border-radius: 3px;
    width: fit-content;
    min-width: 20px;
    text-align: center;
}

/* Loading state for count placeholder */
.tadoch-related-outage-count[data-count-placeholder] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: tadoch-shimmer 1.5s infinite;
    min-width: 30px;
    min-height: 18px;
}

@keyframes tadoch-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

body.dark-mode .tadoch-related-outage-count[data-count-placeholder] {
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
}


/* ============================================
   STATUS INDICATORS
   ============================================ */

/* Initial state before JS populates (no status class) */
.tadoch-related-item:not(.status-ok):not(.status-warning):not(.status-critical) .tadoch-related-link {
    border-left: 3px solid #ccc;
}

/* OK status - green accent */
.tadoch-related-item.status-ok .tadoch-related-link {
    border-left: 3px solid #57C84D;
}

/* Warning status - yellow accent */
.tadoch-related-item.status-warning .tadoch-related-link {
    border-left: 3px solid #ffc107;
}

.tadoch-related-item.status-warning .tadoch-related-outage-count {
    background: #ffc1073d;
    color: #7a5d00;
}

body.dark-mode .tadoch-related-item.status-warning .tadoch-related-outage-count {
    background: #ffc1073d;
    color: #ffc107;
}

/* Critical status - red accent */
.tadoch-related-item.status-critical .tadoch-related-link {
    border-left: 3px solid #ef3e4b;
}

.tadoch-related-item.status-critical .tadoch-related-outage-count {
    background: #ef3e4b3d;
    color: #a82830;
}

body.dark-mode .tadoch-related-item.status-critical .tadoch-related-outage-count {
    background: #ef3e4b3d;
    color: #ef3e4b;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media screen and (max-width: 480px) {
    .tadoch-related-thumb-wrap {
        flex: 0 0 50px;
        width: 50px;
        height: 50px;
    }
    
    .tadoch-related-post-title {
        font-size: 0.85rem;
    }
    
    .tadoch-related-link {
        gap: 10px;
        padding: 6px;
    }
}

/* Widget-specific adjustments */
.widget .tadoch-related-list {
    margin-top: 0;
}

.widget .tadoch-related-title {
    margin-bottom: 12px;
}