/**
 * Linksshow Ads 前端样式
 * 
 * @package Linksshow_Ads
 * @since 1.0.0
 */

/* 广告容器 */
.lsa-ad-container {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.lsa-ad-container.lsa-ad-top {
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.lsa-ad-container.lsa-ad-bottom {
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* 广告标题 */
.lsa-ad-title {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.lsa-ad-title h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

/* 广告列表 */
.lsa-ad-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* 广告项 */
.lsa-ad-item {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lsa-ad-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.lsa-ad-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* 广告图片 */
.lsa-ad-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.lsa-ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.lsa-ad-item:hover .lsa-ad-image img {
    transform: scale(1.05);
}

/* 广告内容 */
.lsa-ad-content {
    padding: 15px;
}

.lsa-ad-title-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lsa-ad-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lsa-ad-location {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

/* 横幅广告 */
.lsa-banner-ad {
    margin: 20px 0;
    text-align: center;
}

.lsa-banner-link {
    display: inline-block;
    max-width: 100%;
}

.lsa-banner-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 侧边栏广告 */
.lsa-sidebar-ad-widget {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.lsa-widget-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.lsa-sidebar-ad-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lsa-sidebar-ad-item {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.lsa-sidebar-ad-item:hover {
    background: #f5f5f5;
}

.lsa-sidebar-ad-thumb {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #f0f0f0;
}

.lsa-sidebar-ad-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lsa-sidebar-ad-info {
    flex: 1;
    display: flex;
    align-items: center;
}

.lsa-sidebar-ad-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 内容中插入的广告 */
.lsa-content-ad {
    margin: 20px 0;
    text-align: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.lsa-content-ad img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .lsa-ad-list {
        grid-template-columns: 1fr;
    }
    
    .lsa-ad-container {
        padding: 15px;
    }
    
    .lsa-ad-image {
        height: 150px;
    }
}

/* 广告标识 */
.lsa-ad-label {
    display: inline-block;
    padding: 2px 8px;
    background: #ff9800;
    color: #fff;
    font-size: 11px;
    border-radius: 3px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 加载状态 */
.lsa-ad-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.lsa-ad-loading::before {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #e0e0e0;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* 无广告提示 */
.lsa-no-ads {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}
