/* NutroCloud Blog Custom Styles */

:root {
    --primary-color: #1877f2;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --light-gray: #6c757d;
    --border-color: #e9ecef;
    --hover-color: #0d6efd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 25px rgba(0,0,0,0.15);
}

/* Global Styles */
body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 0;
    color: white;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Header Fixed */
.rts-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999 !important;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.rts-header__wrapper {
    z-index: 10000 !important;
}

/* Body padding to compensate for fixed header */
body {
    padding-top: 80px;
}

.featured-post {
    background: #fefefe;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin: -60px auto 80px;
    max-width: 1100px;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.featured-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.featured-post-layout {
    display: flex;
    align-items: center;
    min-height: 400px;
    gap: 0;
}

.featured-post-image {
    flex: 0 0 50%;
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.featured-post-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    transition: all 0.5s ease;
}

.featured-post:hover .featured-post-image img {
    transform: scale(1.03);
}

.featured-post-content {
    flex: 1;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fefefe;
}

.featured-badge {
    background: #4a90e2;
    color: white;
    padding: 8px 20px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
}

.featured-post h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    color: #2c3e50;
}

.featured-post h2 a {
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
}

.featured-post h2 a:hover {
    color: #4a90e2;
    transform: translateX(3px);
}

.featured-post p {
    color: #5a6c7d;
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    font-size: 13px;
    color: #94a3b8;
    padding-top: 18px;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
}

.post-meta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #4f46e5, #06b6d4);
    transition: width 0.4s ease;
}

.post-card:hover .post-meta::before {
    width: 100%;
}

.post-meta time,
.post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.8);
    transition: all 0.3s ease;
}

.post-card:hover .post-meta time,
.post-card:hover .post-meta span {
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
}

.post-meta i {
    color: #4f46e5;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.post-card:hover .post-meta i {
    transform: scale(1.1);
}

/* Category Sections */
.category-section {
    margin-bottom: 60px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.category-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-color);
}

.view-all-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.view-all-btn:hover {
    color: var(--hover-color);
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    justify-items: center;
}

.post-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
    width: 100%;
    max-width: 380px;
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(10px);
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #06b6d4, #10b981);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-card:hover::before {
    opacity: 1;
}

.post-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.08);
    border-color: rgba(79, 70, 229, 0.2);
}

.post-card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.post-card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-card:hover .post-card-image::after {
    opacity: 1;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(1) saturate(1);
}

.post-card:hover .post-card-image img {
    transform: scale(1.08) rotate(1deg);
    filter: brightness(1.1) saturate(1.2);
}

.post-card-content {
    padding: 25px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
}

.post-card-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25px;
    right: 25px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.2), transparent);
}

.post-category {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    position: relative;
    overflow: hidden;
}

.post-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.post-card:hover .post-category::before {
    left: 100%;
}

.post-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 14px;
    line-height: 1.3;
    color: #1e293b;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #1e293b 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.post-card:hover h3 {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.post-excerpt {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.7;
    font-weight: 400;
    transition: color 0.3s ease;
}

.post-card:hover .post-excerpt {
    color: #475569;
}

/* All Posts Section */
.all-posts-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 80px 0;
    margin-top: 80px;
    position: relative;
}

.all-posts-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
}

.all-posts-list {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.all-posts-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.all-posts-item:hover {
    background-color: rgba(24, 119, 242, 0.05);
}

.all-posts-item:last-child {
    border-bottom: none;
}

.all-posts-item .post-number {
    font-weight: 600;
    color: var(--light-gray);
    margin-right: 20px;
    min-width: 30px;
}

.all-posts-item .post-info {
    flex: 1;
}

.all-posts-item .post-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.all-posts-item .post-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.all-posts-item .post-title a:hover {
    color: var(--primary-color);
}

.all-posts-item .post-date {
    font-size: 14px;
    color: var(--light-gray);
}

/* Navigation Arrows */
.category-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-arrow {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.nav-arrow:hover {
    background: var(--hover-color);
}

.nav-arrow:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

/* Secondary Header */
.secondary-header {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    padding: 20px 0;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    z-index: 9998;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
}

/* Additional body padding for secondary header */
body {
    padding-top: 160px;
}

.secondary-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

/* Top Categories */
.top-categories {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.categories-label {
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

.categories-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-tag {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s ease;
    cursor: pointer;
    border: 1px solid rgba(102, 126, 234, 0.2);
    text-transform: capitalize;
}

.category-tag:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Search Container */
.search-container {
    position: relative;
    min-width: 300px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

#search-input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 30px;
    font-size: 14px;
    outline: none;
    transition: all 0.4s ease;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

#search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.search-btn {
    position: absolute;
    right: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 8px;
    backdrop-filter: blur(10px);
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-result-item:hover {
    background: var(--secondary-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 5px;
    font-size: 14px;
}

.search-result-excerpt {
    color: var(--light-gray);
    font-size: 12px;
    line-height: 1.4;
}

.search-result-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    margin-top: 5px;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: var(--light-gray);
    font-size: 14px;
}

/* Loading Spinners */
.loading-categories {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-card {
        height: auto;
    }
    
    .post-card-layout {
        flex-direction: column;
    }
    
    .post-card-image {
        flex: none;
        height: 150px;
        width: 100%;
    }
    
    .post-card-content {
        padding: 20px;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .all-posts-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .secondary-header {
        top: 60px;
    }
    
    .secondary-header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .top-categories {
        width: 100%;
        justify-content: center;
    }
    
    .search-container {
        width: 100%;
        min-width: auto;
    }
    
    .categories-list {
        justify-content: center;
    }
    
    .featured-post-layout {
        flex-direction: column;
    }
    
    .featured-post-image {
        flex: none;
        height: 280px;
        padding: 15px;
    }
    
    .featured-post-content {
        padding: 30px 25px;
    }
    
    .featured-post h2 {
        font-size: 1.8rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .post-meta span {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .post-card h3 {
        font-size: 0.95rem;
    }
    
    .post-excerpt {
        font-size: 12px;
    }
}