/* House Ads Styling */
.house-ad-container {
    display: block;
    margin: 20px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
}

.house-ad-container::before {
    content: "Ad";
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(108, 117, 125, 0.8);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.house-ad-container:hover {
    border-color: #1e3c72;
    box-shadow: 0 6px 20px rgba(30, 60, 114, 0.15);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.house-ad-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 20px;
}

.house-ad-link:hover {
    text-decoration: none;
    color: inherit;
}

.house-ad-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.house-ad-logo {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    border: 2px solid #e9ecef;
    background: white;
    padding: 4px;
}

.house-ad-text {
    flex: 1;
    min-width: 0;
}

.house-ad-title {
    font-weight: 700;
    font-size: 18px;
    color: #1e3c72;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.house-ad-domain {
    font-size: 14px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}

.house-ad-cta {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    border: none;
    cursor: pointer;
}

/* Compact variation */
.house-ad-container.compact {
    margin: 12px 0;
    border-radius: 8px;
}

.house-ad-container.compact .house-ad-link {
    padding: 12px;
}

.house-ad-container.compact .house-ad-logo {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
}

.house-ad-container.compact .house-ad-title {
    font-size: 15px;
}

.house-ad-container.compact .house-ad-domain {
    font-size: 12px;
}

.house-ad-container.compact .house-ad-cta {
    font-size: 11px;
    padding: 4px 8px;
}

/* Sidebar variation */
.house-ad-container.sidebar {
    margin: 15px 0;
    max-width: 300px;
}

.house-ad-container.sidebar .house-ad-content {
    flex-direction: column;
    text-align: center;
    gap: 12px;
}

.house-ad-container.sidebar .house-ad-logo {
    width: 80px;
    height: 80px;
    max-width: 80px;
    max-height: 80px;
    align-self: center;
}

.house-ad-container.sidebar .house-ad-text {
    text-align: center;
}

.house-ad-container.sidebar .house-ad-title {
    white-space: normal;
    text-align: center;
    line-height: 1.3;
}

.house-ad-container.sidebar .house-ad-domain {
    white-space: normal;
    text-align: center;
    margin-bottom: 12px;
}

/* Banner variation */
.house-ad-container.banner {
    margin: 20px 0;
    border-radius: 15px;
}

.house-ad-container.banner .house-ad-content {
    justify-content: center;
    text-align: center;
    gap: 20px;
}

.house-ad-container.banner .house-ad-logo {
    width: 100px;
    height: 100px;
    max-width: 100px;
    max-height: 100px;
}

.house-ad-container.banner .house-ad-title {
    font-size: 20px;
}

.house-ad-container.banner .house-ad-domain {
    font-size: 16px;
}

/* Small inline variation */
.house-ad-container.inline {
    margin: 8px 0;
    display: inline-block;
    max-width: 250px;
}

.house-ad-container.inline .house-ad-link {
    padding: 8px;
}

.house-ad-container.inline .house-ad-logo {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
}

.house-ad-container.inline .house-ad-title {
    font-size: 13px;
}

.house-ad-container.inline .house-ad-domain {
    font-size: 11px;
}

.house-ad-container.inline .house-ad-cta {
    font-size: 10px;
    padding: 3px 6px;
}

/* No logo fallback */
.house-ad-container .house-ad-logo-placeholder {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
    border: 2px solid #e9ecef;
}

.house-ad-container.compact .house-ad-logo-placeholder {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
    font-size: 18px;
}

.house-ad-container.sidebar .house-ad-logo-placeholder {
    width: 80px;
    height: 80px;
    max-width: 80px;
    max-height: 80px;
    font-size: 32px;
}

.house-ad-container.banner .house-ad-logo-placeholder {
    width: 100px;
    height: 100px;
    max-width: 100px;
    max-height: 100px;
    font-size: 40px;
}

.house-ad-container.inline .house-ad-logo-placeholder {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    font-size: 14px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .house-ad-container {
        margin: 15px 0;
    }
    
    .house-ad-link {
        padding: 15px;
    }
    
    .house-ad-logo {
        width: 56px;
        height: 56px;
        max-width: 56px;
        max-height: 56px;
    }
    
    .house-ad-title {
        font-size: 16px;
    }
    
    .house-ad-domain {
        font-size: 13px;
    }
    
    .house-ad-cta {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .house-ad-container.sidebar {
        max-width: 100%;
    }
    
    .house-ad-container.banner .house-ad-content {
        flex-direction: column;
    }
    
    .house-ad-container.banner .house-ad-logo {
        width: 80px;
        height: 80px;
        max-width: 80px;
        max-height: 80px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .house-ad-container {
        background: linear-gradient(135deg, #343a40 0%, #495057 100%);
        border-color: #495057;
    }
    
    .house-ad-container:hover {
        background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
        border-color: #2a5298;
    }
    
    .house-ad-title {
        color: #e9ecef;
    }
    
    .house-ad-domain {
        color: #adb5bd;
    }
    
    .house-ad-logo {
        border-color: #495057;
        background: #343a40;
    }
}

/* Video Overlay Ad - Small, wide, unobtrusive */
.house-ad-container.video-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    margin: 0;
    max-width: 220px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.house-ad-container.video-overlay::before {
    content: "Ad";
    top: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.8);
    color: #000;
    font-size: 8px;
    padding: 1px 4px;
}

.house-ad-container.video-overlay .house-ad-link {
    padding: 8px;
}

.house-ad-container.video-overlay .house-ad-content {
    gap: 8px;
}

.house-ad-container.video-overlay .house-ad-logo,
.house-ad-container.video-overlay .house-ad-logo-placeholder {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

.house-ad-container.video-overlay .house-ad-title {
    font-size: 11px;
    color: white;
    margin-bottom: 2px;
    font-weight: 600;
}

.house-ad-container.video-overlay .house-ad-domain {
    display: none; /* Hide domain to save space */
}

.house-ad-container.video-overlay .house-ad-cta {
    background: rgba(30, 60, 114, 0.9);
    color: white;
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 12px;
    margin-top: 2px;
}

.house-ad-container.video-overlay:hover {
    background: rgba(0, 0, 0, 0.95);
    border-color: rgba(30, 60, 114, 0.8);
    transform: none; /* No lift effect for video overlay */
}

/* Banner Ad - 728x90 style for between posts */
.house-ad-container.banner-728 {
    margin: 25px auto;
    max-width: 728px;
    height: 90px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.house-ad-container.banner-728::before {
    top: 6px;
    right: 6px;
}

.house-ad-container.banner-728 .house-ad-link {
    padding: 10px 20px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.house-ad-container.banner-728 .house-ad-content {
    width: 100%;
    justify-content: flex-start;
    gap: 20px;
}

.house-ad-container.banner-728 .house-ad-logo,
.house-ad-container.banner-728 .house-ad-logo-placeholder {
    width: 70px;
    height: 70px;
    max-width: 70px;
    max-height: 70px;
    border-radius: 8px;
    font-size: 28px;
}

.house-ad-container.banner-728 .house-ad-text {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.house-ad-container.banner-728 .house-ad-info {
    flex: 1;
}

.house-ad-container.banner-728 .house-ad-title {
    font-size: 18px;
    margin-bottom: 4px;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
}

.house-ad-container.banner-728 .house-ad-domain {
    font-size: 14px;
    margin-bottom: 0;
}

.house-ad-container.banner-728 .house-ad-cta {
    font-size: 14px;
    padding: 8px 20px;
    border-radius: 25px;
    margin-left: 20px;
    white-space: nowrap;
}

/* Interstitial Ad - Full width, attention-grabbing */
.house-ad-container.interstitial {
    margin: 40px auto;
    max-width: 600px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border: none;
    border-radius: 15px;
    color: white;
    box-shadow: 0 8px 32px rgba(30, 60, 114, 0.3);
}

.house-ad-container.interstitial::before {
    background: rgba(255, 255, 255, 0.9);
    color: #1e3c72;
    top: 12px;
    right: 12px;
    font-weight: 700;
}

.house-ad-container.interstitial .house-ad-link {
    padding: 30px;
}

.house-ad-container.interstitial .house-ad-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
}

.house-ad-container.interstitial .house-ad-logo,
.house-ad-container.interstitial .house-ad-logo-placeholder {
    width: 120px;
    height: 120px;
    max-width: 120px;
    max-height: 120px;
    border-radius: 15px;
    align-self: center;
    border: 3px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    font-size: 48px;
}

.house-ad-container.interstitial .house-ad-title {
    font-size: 28px;
    color: white;
    margin-bottom: 8px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.house-ad-container.interstitial .house-ad-domain {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

.house-ad-container.interstitial .house-ad-cta {
    background: white;
    color: #1e3c72;
    font-size: 16px;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.house-ad-container.interstitial:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(30, 60, 114, 0.4);
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
}

.house-ad-container.interstitial:hover .house-ad-cta {
    background: #f8f9fa;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Square Ad - Good for sidebars */
.house-ad-container.square {
    margin: 20px auto;
    max-width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
}

.house-ad-container.square .house-ad-link {
    padding: 20px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.house-ad-container.square .house-ad-content {
    flex-direction: column;
    text-align: center;
    gap: 15px;
    width: 100%;
}

.house-ad-container.square .house-ad-logo,
.house-ad-container.square .house-ad-logo-placeholder {
    width: 100px;
    height: 100px;
    max-width: 100px;
    max-height: 100px;
    border-radius: 12px;
    align-self: center;
    font-size: 40px;
}

.house-ad-container.square .house-ad-title {
    font-size: 18px;
    margin-bottom: 8px;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
}

.house-ad-container.square .house-ad-domain {
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
}

.house-ad-container.square .house-ad-cta {
    font-size: 14px;
    padding: 10px 20px;
    align-self: center;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .house-ad-container.banner-728 {
        max-width: 100%;
        height: auto;
        min-height: 80px;
    }
    
    .house-ad-container.banner-728 .house-ad-content {
        gap: 12px;
    }
    
    .house-ad-container.banner-728 .house-ad-logo,
    .house-ad-container.banner-728 .house-ad-logo-placeholder {
        width: 50px;
        height: 50px;
        max-width: 50px;
        max-height: 50px;
        font-size: 20px;
    }
    
    .house-ad-container.banner-728 .house-ad-title {
        font-size: 15px;
    }
    
    .house-ad-container.banner-728 .house-ad-domain {
        font-size: 12px;
    }
    
    .house-ad-container.banner-728 .house-ad-cta {
        font-size: 12px;
        padding: 6px 12px;
        margin-left: 10px;
    }
    
    .house-ad-container.interstitial {
        margin: 20px auto;
    }
    
    .house-ad-container.interstitial .house-ad-link {
        padding: 20px;
    }
    
    .house-ad-container.interstitial .house-ad-logo,
    .house-ad-container.interstitial .house-ad-logo-placeholder {
        width: 80px;
        height: 80px;
        max-width: 80px;
        max-height: 80px;
        font-size: 32px;
    }
    
    .house-ad-container.interstitial .house-ad-title {
        font-size: 20px;
    }
    
    .house-ad-container.interstitial .house-ad-domain {
        font-size: 14px;
    }
    
    .house-ad-container.interstitial .house-ad-cta {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .house-ad-container.square {
        max-width: 280px;
        height: 280px;
    }
    
    .house-ad-container.square .house-ad-logo,
    .house-ad-container.square .house-ad-logo-placeholder {
        width: 80px;
        height: 80px;
        max-width: 80px;
        max-height: 80px;
        font-size: 32px;
    }
    
    .house-ad-container.video-overlay {
        max-width: 180px;
    }
    
    .house-ad-container.video-overlay .house-ad-title {
        font-size: 10px;
    }
    
    .house-ad-container.video-overlay .house-ad-cta {
        font-size: 8px;
        padding: 2px 6px;
    }
}

/* Messages Sidebar Ad - Fits seamlessly in conversation list */
.house-ad-container.messages-sidebar {
    margin: 8px 0;
    background: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    transition: all 0.3s ease;
    max-width: 280px;
}

.house-ad-container.messages-sidebar::before {
    content: "Ad";
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(108, 117, 125, 0.8);
    color: white;
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.house-ad-container.messages-sidebar:hover {
    background: #e3e6f0;
    border-color: #1e3c72;
    transform: none; /* No lift effect to match message items */
}

.house-ad-container.messages-sidebar .house-ad-link {
    padding: 12px;
    display: flex;
    align-items: center;
    position: relative;
}

.house-ad-container.messages-sidebar .house-ad-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.house-ad-container.messages-sidebar .house-ad-logo,
.house-ad-container.messages-sidebar .house-ad-logo-placeholder {
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    border: 2px solid #e3e6f0;
    background: white;
    flex-shrink: 0;
    font-size: 16px;
}

.house-ad-container.messages-sidebar .house-ad-logo-placeholder {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.house-ad-container.messages-sidebar .house-ad-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.house-ad-container.messages-sidebar .house-ad-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.house-ad-container.messages-sidebar .house-ad-domain {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
}

.house-ad-container.messages-sidebar .house-ad-cta {
    display: none; /* Hide CTA to maintain clean message-like appearance */
}

/* Alternative version with CTA as small badge */
.house-ad-container.messages-sidebar.with-cta .house-ad-cta {
    display: inline-block;
    background: #1e3c72;
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Hover state for better interaction feedback */
.house-ad-container.messages-sidebar:hover .house-ad-title {
    color: #2a5298;
}

.house-ad-container.messages-sidebar:hover .house-ad-logo {
    border-color: #1e3c72;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .house-ad-container.messages-sidebar {
        max-width: 100%;
        margin: 6px 0;
    }
    
    .house-ad-container.messages-sidebar .house-ad-link {
        padding: 10px;
    }
    
    .house-ad-container.messages-sidebar .house-ad-logo,
    .house-ad-container.messages-sidebar .house-ad-logo-placeholder {
        width: 36px;
        height: 36px;
        max-width: 36px;
        max-height: 36px;
        font-size: 14px;
    }
    
    .house-ad-container.messages-sidebar .house-ad-title {
        font-size: 13px;
    }
    
    .house-ad-container.messages-sidebar .house-ad-domain {
        font-size: 11px;
    }
}

/* Dark mode support for messages sidebar */
@media (prefers-color-scheme: dark) {
    .house-ad-container.messages-sidebar {
        background: #343a40;
        border-color: #495057;
    }
    
    .house-ad-container.messages-sidebar:hover {
        background: #495057;
        border-color: #2a5298;
    }
    
    .house-ad-container.messages-sidebar .house-ad-title {
        color: #e9ecef;
    }
    
    .house-ad-container.messages-sidebar .house-ad-domain {
        color: #adb5bd;
    }
    
    .house-ad-container.messages-sidebar .house-ad-logo {
        border-color: #495057;
        background: #343a40;
    }
}