/* Blog Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #3498db;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Blog Hero */
.blog-hero {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.blog-title {
    font-size: 3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.blog-subtitle {
    font-size: 1.25rem;
    color: #7f8c8d;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Blog Card */
.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.blog-card-image {
    width: 100%;
    height: auto;
    background: #f0f0f0;
}

.blog-card-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

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

.blog-card-content {
    padding: 2rem;
}

.blog-card-date {
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.blog-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.blog-card-description {
    font-size: 1rem;
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.blog-card-read-more {
    color: #3498db;
    font-weight: 600;
    display: inline-block;
}

/* Blog Post Page */
.blog-post-container {
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.blog-post-header {
    margin-bottom: 2rem;
}

.back-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 1rem;
}

.back-link:hover {
    text-decoration: underline;
}

.blog-post-meta {
    margin-bottom: 1rem;
}

.blog-post-date {
    font-size: 0.875rem;
    color: #7f8c8d;
}

.blog-post-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.blog-post-image {
    width: 100%;
    max-height: 600px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.blog-post-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.blog-post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #333;
}

/* Affiliate Disclosure */
.affiliate-disclosure {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    color: #856404;
}

.affiliate-disclosure strong {
    font-weight: 700;
}

.blog-post-description {
    margin-bottom: 2rem;
}

/* Amazon Links Section */
.amazon-links-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
}

.amazon-links-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.amazon-link-item {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.amazon-link-item:last-child {
    margin-bottom: 0;
}

.amazon-product-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.amazon-link-button {
    display: inline-block;
    background: #ff9900;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s;
    margin-top: 0.5rem;
}

.amazon-link-button:hover {
    background: #e68a00;
}

.amazon-disclosure-small {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Admin Dashboard - Amazon Links Container */
.amazon-links-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.amazon-link-row {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 1rem;
    align-items: start;
}

.amazon-link-field {
    display: flex;
    flex-direction: column;
}

.amazon-link-field label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #495057;
}

.amazon-link-field input {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.remove-link-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    transition: background 0.3s;
}

.remove-link-btn:hover {
    background: #c82333;
}

/* Loading, Empty, and Error States */
.loading-state,
.empty-state,
.error-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 2rem;
    margin-top: 4rem;
    text-align: center;
}

.footer-link {
    color: #666;
    text-decoration: none;
    margin: 0 1rem;
    font-size: 0.9rem;
}

.footer-link:hover {
    color: #3498db;
}

/* Responsive Design */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-title {
        font-size: 2rem;
    }
    
    .blog-post-container {
        padding: 1.5rem;
    }
    
    .blog-post-title {
        font-size: 1.75rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .amazon-link-row {
        grid-template-columns: 1fr;
    }
    
    .remove-link-btn {
        margin-top: 0.5rem;
        width: 100%;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Admin Dashboard Overrides */
.dashboard-body .blog-post-container {
    max-width: 100%;
}

