/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: bold;
}

.logo a {
    color: white;
    text-decoration: none;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav a:hover {
    opacity: 0.8;
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Hero Ad Section */
.hero-ad-section {
    margin-bottom: 2rem;
}

.hero-ad {
    width: 100%;
    max-width: 728px;
    height: 130px;
    margin: 0 auto;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

/* Content Layout */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-top: 2rem;
}

/* Blog Section */
.blog-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
}

.blog-grid {
    display: grid;
    gap: 1.5rem;
}

.blog-card {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.blog-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

.blog-card:hover .blog-image img {
    transform: scale(1.05);
}

.blog-content {
    padding: 1.5rem;
}

.blog-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.blog-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
}

.blog-title a:hover {
    color: #667eea;
}

.blog-excerpt {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.read-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.sidebar-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.2rem;
}

.sidebar-ad {
    width: 100%;
    height: 250px;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Enhanced Ad Slot Styles for Prebid Integration */
.prebid-ad {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.bid-source-indicator {
    font-family: monospace;
    font-weight: bold;
    text-transform: uppercase;
    cursor: help;
    user-select: none;
}

.ad-price {
    font-size: 0.7rem;
    color: #666;
    margin-top: 0.3rem;
    text-align: center;
    font-style: italic;
}

.ad-advertiser {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.2rem;
    text-align: center;
    font-style: italic;
}

.display-ad {
    position: relative;
    transition: all 0.3s ease;
}

.display-ad:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.native-ad {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.native-ad .ad-image {
    flex: 1;
}

.native-ad .ad-title {
    font-size: 0.9rem;
    font-weight: bold;
    margin: 0.5rem 0 0.2rem;
    line-height: 1.2;
}

.native-ad .ad-text {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* RTB vs House Ad Styling */
.ad-slot[data-source="prebid"] {
    border: 2px solid #4CAF50;
}

.ad-slot[data-source="house"] {
    border: 2px solid #FF9800;
}

/* Loading states */
.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, transparent 63%, #f0f0f0 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

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

/* Ad Slot Styles */
.ad-slot {
    position: relative;
    overflow: hidden;
}

.ad-placeholder {
    color: #999;
    font-size: 0.9rem;
    text-align: center;
}

.ad-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    transition: transform 0.3s;
}

.ad-content:hover {
    transform: scale(1.02);
}

.ad-image {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.ad-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.3rem;
    text-align: center;
}

.ad-text {
    font-size: 0.8rem;
    text-align: center;
    color: #666;
    padding: 0 0.5rem;
}

/* Blog Detail Styles */
.blog-detail {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

.blog-header {
    text-align: center;
    margin-bottom: 2rem;
}

.blog-detail .blog-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.blog-detail .blog-meta {
    justify-content: center;
    gap: 2rem;
    font-size: 1rem;
    color: #666;
}

.blog-detail .blog-image {
    margin: 2rem 0;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
}

.blog-detail .blog-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.blog-detail .blog-content h2 {
    margin: 2rem 0 1rem;
    color: #2c3e50;
}

.blog-detail .blog-content h3 {
    margin: 1.5rem 0 0.8rem;
    color: #34495e;
}

.blog-detail .blog-content p {
    margin-bottom: 1.2rem;
}

.blog-detail .blog-content ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.blog-detail .blog-content li {
    margin-bottom: 0.5rem;
}

.blog-detail .blog-content pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    border-left: 4px solid #667eea;
}

.blog-detail .blog-content code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.blog-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e1e8ed;
}

.back-button {
    display: inline-block;
    background: #6c757d;
    color: white;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    border-radius: 25px;
    transition: background 0.3s, transform 0.3s;
}

.back-button:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.share-buttons {
    display: flex;
    gap: 1rem;
}

.share-btn, .like-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.share-btn {
    background: #3498db;
    color: white;
}

.like-btn {
    background: #e74c3c;
    color: white;
}

.share-btn:hover, .like-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav ul {
        gap: 1rem;
    }
    
    .content-layout {
        grid-template-columns: 1fr;
    }
    
    .hero-ad {
        height: 70px;
    }
    
    .blog-detail .blog-title {
        font-size: 2rem;
    }
    
    .blog-detail .blog-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .blog-actions {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .blog-section, .sidebar-section, .blog-detail {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .blog-title {
        font-size: 1.1rem;
    }
}
