/* Critical CSS for immediate rendering */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 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);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background-color: #fff;
    color: #f5576c;
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.cover-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* Chapters Section */
.chapters-section {
    padding: 4rem 0;
    background-color: #f8f9fa;
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.chapter-card {
    background-color: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.chapter-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.chapter-info {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.chapter-preview {
    width: 100%;
    height: 150px;
    background-color: #f0f0f0;
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.chapter-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-text h2 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav ul {
        gap: 1rem;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
    }
}

/* E-E-A-T Enhanced Styles */
.author-platform-section {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.author-expertise {
    margin-bottom: 2rem;
}

.author-profile {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.author-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.badge-icon {
    font-size: 1.2rem;
}

.author-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-item strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.2rem;
}

.stat-item span {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.author-credentials h5 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.credentials-list {
    display: grid;
    gap: 1rem;
}

.credential-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border-left: 4px solid #667eea;
}

.credential-icon {
    font-size: 1.5rem;
    color: #667eea;
    flex-shrink: 0;
}

.credential-item strong {
    display: block;
    color: #333;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.credential-item p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.platform-authority {
    margin-top: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.platform-authority h5 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

.platform-credentials {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.platform-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.2);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
}

.platform-stats {
    display: flex;
    gap: 2rem;
}

.platform-item {
    text-align: center;
}

.platform-item strong {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.platform-item span {
    font-size: 0.85rem;
    opacity: 0.9;
}

.trust-indicators h6 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.trust-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.trust-icon {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    color: #667eea;
}

.trust-badge span {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.trust-badge small {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.4;
}

.expertise-signals {
    margin-top: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.expertise-signals h5 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

.expertise-list {
    display: grid;
    gap: 1.5rem;
}

.expertise-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.expertise-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.expertise-icon {
    font-size: 2rem;
    color: #667eea;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.expertise-item strong {
    display: block;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.expertise-item p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* Responsive Design for E-E-A-T Section */
@media (max-width: 768px) {
    .author-profile {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .author-stats {
        justify-content: center;
        gap: 1rem;
    }
    
    .platform-credentials {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .platform-stats {
        justify-content: center;
        gap: 1rem;
    }
    
    .trust-grid {
        grid-template-columns: 1fr;
    }
    
    .expertise-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

/* Enhanced Footer Styles */
.trust-security-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-radius: 20px;
}

.trust-security-section h4 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.trust-item:hover {
    transform: translateY(-5px);
}

.trust-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.trust-info strong {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.trust-info p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.certifications {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.cert-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.contact-info, .legal-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.contact-info p, .legal-info p {
    margin: 0.3rem 0;
    font-size: 0.85rem;
    color: #666;
}

.data-sources {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.data-sources h6 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
}

.source-item {
    background: white;
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    border-left: 3px solid #667eea;
}

.footer-bottom {
    border-top: 2px solid #eee;
    padding-top: 2rem;
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-legal p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
}

.footer-legal a {
    color: #667eea;
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-legal a:hover {
    text-decoration: underline;
}

.verification-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    background: #28a745;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .trust-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    
    .certifications {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .verification-badges {
        justify-content: center;
    }
    
    .sources-grid {
        grid-template-columns: 1fr;
    }
}

/* Community Engagement Section */
.community-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 4rem 0;
    margin: 3rem 0;
}

.community-section h3 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
    font-weight: 700;
}

.community-description {
    text-align: center;
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.community-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.community-stats .stat-item {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.community-stats .stat-item:hover {
    transform: translateY(-5px);
}

.community-stats .stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.community-stats .stat-label {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.community-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.community-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.community-card h4 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

.review-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-left: 4px solid #667eea;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.review-header strong {
    color: #333;
    font-weight: 600;
}

.review-rating {
    color: #ffc107;
}

.review-item p {
    color: #555;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.review-item small {
    color: #888;
    font-size: 0.8rem;
}

.share-buttons {
    display: grid;
    gap: 1rem;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.share-btn.twitter {
    background: #1da1f2;
    color: white;
}

.share-btn.facebook {
    background: #1877f2;
    color: white;
}

.share-btn.reddit {
    background: #ff4500;
    color: white;
}

.share-btn.discord {
    background: #7289da;
    color: white;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.share-icon {
    font-size: 1.2rem;
}

/* Performance Optimizations */
.slow-connection img {
    image-rendering: auto;
    filter: blur(0.5px) brightness(0.95);
}

.loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Critical CSS Optimization */
.critical-path {
    contain: layout style paint;
}

/* Resource Hints Feedback */
.prefetching::after {
    content: "⚡ Preloading...";
    position: fixed;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    z-index: 9999;
    animation: fadeOut 2s forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* Enhanced Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Image Optimization Classes */
.image-optimized {
    object-fit: cover;
    object-position: center;
    image-rendering: optimizeQuality;
    image-rendering: -webkit-optimize-contrast;
}

/* Progressive Enhancement */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Connection-aware optimizations */
@media (prefers-reduced-data: reduce) {
    img {
        loading: lazy;
    }
    
    .community-stats .stat-item {
        padding: 1rem;
    }
    
    .community-card {
        padding: 1.5rem;
    }
}

.share-stats {
    margin-top: 1rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.discussion-topics {
    display: grid;
    gap: 1rem;
}

.topic-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.topic-item:hover {
    background: #e9ecef;
}

.topic-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.topic-item strong {
    display: block;
    color: #333;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.topic-item p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.newsletter-signup p {
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.signup-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.email-input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.email-input:focus {
    outline: none;
    border-color: #667eea;
}

.signup-btn {
    padding: 0.8rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.signup-btn:hover {
    background: #5a6fd8;
}

.newsletter-benefits {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #555;
}

.benefit-icon {
    font-size: 1rem;
    color: #28a745;
}

.community-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: transform 0.3s ease;
    margin-top: 1rem;
    width: 100%;
}

.community-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Responsive Community Section */
@media (max-width: 768px) {
    .community-section h3 {
        font-size: 2rem;
    }
    
    .community-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .community-grid {
        grid-template-columns: 1fr;
    }
    
    .signup-form {
        flex-direction: column;
    }
}