/* Reset and base 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: #1F2937;
    background-color: #E5E7EB;
}

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

/* Tail slider section */
.tail-slider-section {
    width: 100%;
    overflow: hidden;
    background: #f8f9fa;
    padding: 2rem 0;
    margin-top: 3rem;
}

.tail-slider-track {
    display: flex;
    gap: 0.2rem;
    will-change: transform;
}

.tail-slider-track img {
    height: 80px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.tail-slider-track img.flag-image {
    height: 56px;
    padding: 0 0.5rem;
    align-self: flex-end;
    margin-bottom: 8px;
}

/* Navigation */
.filter-nav {
    background: linear-gradient(135deg, #2C5F8D 0%, #1a3a52 100%);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.5rem 0;
}

.filter-nav .container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.site-title {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.filter-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: white;
    border-color: white;
    color: #2C5F8D;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Airline filter bar */
.airline-filter-bar {
    background: #f8f9fa;
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.airline-filter-item {
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: white;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.airline-filter-item:hover {
    border-color: #2C5F8D;
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.airline-filter-item.active {
    border-color: #2C5F8D;
    background: #e7f1f8;
}

.airline-filter-item img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* Scrollbar styling for airline filter bar */
.airline-filter-bar::-webkit-scrollbar {
    height: 6px;
}

.airline-filter-bar::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 3px;
}

.airline-filter-bar::-webkit-scrollbar-thumb {
    background: #2C5F8D;
    border-radius: 3px;
}

.airline-filter-bar::-webkit-scrollbar-thumb:hover {
    background: #1a3a52;
}

/* Trip banner */
.trip-banner {
    background: #FEF3C7;
    color: #92400E;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 4px solid #F59E0B;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Main content */
main {
    padding: 2rem 0 4rem;
    min-height: 60vh;
}

/* Posts grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Post card */
.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.post-card.hidden {
    display: none;
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #2C5F8D 0%, #1a3a52 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    overflow: hidden;
}

.post-thumbnail .cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-category {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.8rem;
    width: fit-content;
}

.post-category.flight {
    background: #DBEAFE;
    color: #1E40AF;
}

.post-category.trip {
    background: #FEE2E2;
    color: #DC2626;
}

.post-card h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #212529;
    line-height: 1.3;
}

.post-date {
    color: #868e96;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.post-excerpt {
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1;
}

.flight-details {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 8px;
    margin: 0.8rem 0;
    font-size: 0.85rem;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
}

.flight-info {
    flex: 1;
    min-width: 0;
}

.flight-details .detail-item {
    margin-bottom: 0.3rem;
    color: #495057;
}

.flight-details .detail-item:last-child {
    margin-bottom: 0;
}

.flight-details strong {
    color: #2C5F8D;
    font-weight: 600;
}

.flight-tail {
    flex-shrink: 0;
    width: 100px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tail-thumbnail {
    max-width: 85px;
    max-height: 63.75px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-top: -12px;
}

.tail-thumbnail.flag-thumbnail {
    margin-top: 16px;
}

.read-more {
    color: #2C5F8D;
    font-weight: 600;
    margin-top: 1rem;
    display: inline-block;
}

/* Post view */
#post-view {
    max-width: 800px;
    margin: 0 auto;
}

.back-btn {
    background: #f1f3f5;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 2rem;
    transition: all 0.2s ease;
    color: #495057;
}

.back-btn:hover {
    background: #e9ecef;
    transform: translateX(-2px);
}

#post-content {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#post-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #212529;
    line-height: 1.2;
}

#post-content h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: #343a40;
}

#post-content h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.8rem;
    color: #495057;
}

#post-content p {
    margin-bottom: 1.2rem;
    color: #495057;
    line-height: 1.7;
}

#post-content ul, #post-content ol {
    margin-bottom: 1.2rem;
    padding-left: 2rem;
    color: #495057;
}

#post-content li {
    margin-bottom: 0.5rem;
}

#post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* Flight details info box */
#post-content hr + p strong:first-child,
#post-content hr + p + p strong:first-child,
#post-content hr + p + p + p strong:first-child,
#post-content hr + p + p + p + p strong:first-child,
#post-content hr + p + p + p + p + p strong:first-child,
#post-content hr + p + p + p + p + p + p strong:first-child {
    color: #2C5F8D;
    font-weight: 600;
    min-width: 140px;
    display: inline-block;
}

#post-content hr + p,
#post-content hr + p + p,
#post-content hr + p + p + p,
#post-content hr + p + p + p + p,
#post-content hr + p + p + p + p + p,
#post-content hr + p + p + p + p + p + p {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    margin: 0;
    border-left: 3px solid #2C5F8D;
    font-size: 0.95rem;
}

#post-content hr + p {
    border-radius: 8px 8px 0 0;
    padding-top: 0.75rem;
}

#post-content hr + p + p + p + p + p + p {
    border-radius: 0 0 8px 8px;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

#post-content blockquote {
    border-left: 4px solid #2C5F8D;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #6c757d;
    font-style: italic;
}

#post-content code {
    background: #f1f3f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

#post-content pre {
    background: #f1f3f5;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

#post-content pre code {
    background: none;
    padding: 0;
}

/* Post metadata section */
.post-metadata {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid #2C5F8D;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.post-metadata-content {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.post-metadata-item {
    font-size: 0.95rem;
    color: #495057;
}

.post-metadata-item strong {
    color: #1F2937;
    font-weight: 600;
}

.post-metadata-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-metadata-icon img {
    max-width: 120px;
    max-height: 90px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 3rem;
    color: #868e96;
    font-size: 1.1rem;
}

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

footer p {
    color: rgba(255,255,255,0.7);
}

/* Responsive design */
@media (max-width: 768px) {
    .site-title {
        font-size: 1.5rem;
    }

    .tail-slider-track img {
        height: 60px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    #post-content {
        padding: 2rem 1.5rem;
    }

    #post-content h1 {
        font-size: 2rem;
    }

    .post-metadata {
        flex-direction: column;
        gap: 1rem;
    }

    .post-metadata-content {
        grid-template-columns: 1fr;
    }

    .post-metadata-icon img {
        max-width: 100px;
        max-height: 75px;
    }
}
