/* Blog Page Specific Styles */

/* Blog Hero */
.blog-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
                url('https://images.pexels.com/photos/261662/pexels-photo-261662.jpeg?auto=compress&cs=tinysrgb&w=1920&h=1080&fit=crop') center/cover no-repeat;
    color: white;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(1px);
}

.blog-hero .container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    text-align: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(168, 85, 247, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.hero-badge i {
    color: #a855f7;
}

.hero-title {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    display: block;
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    display: block;
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.7;
    opacity: 0.9;
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.blog-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fbbf24;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* Writing Animation */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.writing-animation {
    position: relative;
    width: 350px;
    height: 300px;
}

.typewriter {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.typewriter-text {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    line-height: 1.8;
}

.typing-line {
    display: block;
    opacity: 0;
    animation: typeIn 4s ease-in-out infinite;
}

.typing-line:nth-child(1) { animation-delay: 0s; }
.typing-line:nth-child(2) { animation-delay: 1.5s; }
.typing-line:nth-child(3) { animation-delay: 3s; }

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2rem;
    background: #fbbf24;
    animation: blink 1s infinite;
    margin-left: 2px;
}

.floating-words {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.word {
    position: absolute;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    animation: float 6s ease-in-out infinite;
}

.word:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.word:nth-child(2) {
    top: 20%;
    right: 15%;
    animation-delay: 1.2s;
}

.word:nth-child(3) {
    bottom: 30%;
    left: 20%;
    animation-delay: 2.4s;
}

.word:nth-child(4) {
    bottom: 15%;
    right: 10%;
    animation-delay: 3.6s;
}

.word:nth-child(5) {
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 4.8s;
}

/* Blog Controls */
.blog-controls {
    padding: 2rem 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.controls-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #64748b;
}

.filter-tab:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.filter-tab.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

/* Featured Posts */
.featured-posts {
    padding: 80px 0;
    background: white;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: #1e293b;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.featured-post {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.featured-post:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.post-image {
    height: 200px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="post-pattern" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23post-pattern)"/></svg>');
}

.post-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: #6366f1;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.post-date {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 2;
}

.post-content {
    padding: 2rem;
}

.post-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
    line-height: 1.4;
}

.post-content p {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.read-more {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.read-more:hover {
    gap: 1rem;
    color: #4f46e5;
}

/* All Posts */
.all-posts {
    padding: 80px 0;
    background: #f8fafc;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.blog-post {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    opacity: 1;
    transform: translateY(0);
}

.blog-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.blog-post.hidden {
    display: none;
}

.post-header {
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.blog-post .post-category {
    background: #6366f1;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.blog-post .post-date {
    color: #64748b;
    font-size: 0.8rem;
}

.blog-post h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.post-excerpt p {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: #f1f5f9;
    color: #64748b;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Load More Section */
.load-more-section {
    text-align: center;
    margin-top: 3rem;
}

#loadMoreBtn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* Newsletter */
.newsletter {
    padding: 80px 0;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
}

.newsletter-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.newsletter-text h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.newsletter-text p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
}

.newsletter-form .form-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-form input:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.newsletter-note {
    font-size: 0.8rem;
    opacity: 0.7;
    margin: 0;
}

/* Contact Section Enhancements */
.contact .contact-highlights {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.contact .highlight-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #64748b;
}

.contact .highlight-item i {
    color: #6366f1;
    font-size: 1.1rem;
}

/* Animations */
@keyframes typeIn {
    0%, 20% {
        opacity: 0;
        transform: translateY(10px);
    }
    25%, 75% {
        opacity: 1;
        transform: translateY(0);
    }
    80%, 100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-15px);
        opacity: 1;
    }
}

/* Filter Animation */
.blog-post.fade-out {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.blog-post.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

/* Search Highlight */
.search-highlight {
    background: #fef3c7;
    color: #92400e;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .blog-hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .writing-animation {
        width: 280px;
        height: 250px;
    }
    
    .blog-stats {
        justify-content: center;
        gap: 1rem;
    }
    
    .controls-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: none;
    }
    
    .filter-tabs {
        justify-content: center;
    }
    
    .featured-grid,
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .newsletter-form .form-group {
        flex-direction: column;
    }
    
    .post-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .typewriter {
        padding: 1rem;
    }
    
    .typewriter-text {
        font-size: 0.9rem;
    }
    
    .blog-post,
    .featured-post .post-content {
        padding: 1.5rem;
    }
    
    .filter-tab {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .newsletter-text h2 {
        font-size: 1.8rem;
    }
}

/* Print Styles */
@media print {
    .blog-hero,
    .newsletter {
        background: white !important;
        color: black !important;
    }
    
    .hero-visual,
    .blog-controls,
    .newsletter-form {
        display: none;
    }
    
    .blog-post,
    .featured-post {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* Accessibility Enhancements */
.filter-tab:focus,
.search-box input:focus,
.read-more:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .blog-controls {
        background: #1e293b;
    }
    
    .search-box input {
        background: #334155;
        border-color: #475569;
        color: white;
    }
    
    .filter-tab {
        background: #334155;
        border-color: #475569;
        color: #e2e8f0;
    }
    
    .filter-tab.active {
        background: #6366f1;
        border-color: #6366f1;
    }
}
