/* News Feed Styles - Newspaper Design */

/* Header Section */
.header-section {
    text-align: center;
    padding: 4rem 2rem 3rem;
    border-bottom: 3px solid var(--border-color);
    background: linear-gradient(
        135deg,
        rgba(155, 175, 135, 0.03),
        rgba(111, 138, 109, 0.02)
    );
    position: relative;
    overflow: hidden;
}

/* Header Particles */
.header-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.header-particle {
    position: absolute;
    background: rgba(155, 175, 135, 0.6);
    border-radius: 50%;
    animation: floatHeaderParticle 15s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(155, 175, 135, 0.8);
}

.header-particle-1 {
    width: 12px;
    height: 12px;
    top: 15%;
    left: 8%;
    animation-duration: 18s;
    animation-delay: -2s;
}
.header-particle-2 {
    width: 8px;
    height: 8px;
    top: 25%;
    left: 85%;
    animation-duration: 22s;
    animation-delay: -6s;
}
.header-particle-3 {
    width: 10px;
    height: 10px;
    top: 45%;
    left: 12%;
    animation-duration: 20s;
    animation-delay: -10s;
}
.header-particle-4 {
    width: 14px;
    height: 14px;
    top: 65%;
    left: 88%;
    animation-duration: 16s;
    animation-delay: -4s;
}
.header-particle-5 {
    width: 9px;
    height: 9px;
    top: 35%;
    left: 92%;
    animation-duration: 24s;
    animation-delay: -12s;
}
.header-particle-6 {
    width: 11px;
    height: 11px;
    top: 75%;
    left: 15%;
    animation-duration: 19s;
    animation-delay: -8s;
}
.header-particle-7 {
    width: 7px;
    height: 7px;
    top: 55%;
    left: 5%;
    animation-duration: 21s;
    animation-delay: -14s;
}
.header-particle-8 {
    width: 13px;
    height: 13px;
    top: 20%;
    left: 75%;
    animation-duration: 17s;
    animation-delay: -3s;
}
.header-particle-9 {
    width: 10px;
    height: 10px;
    top: 80%;
    left: 65%;
    animation-duration: 23s;
    animation-delay: -9s;
}
.header-particle-10 {
    width: 8px;
    height: 8px;
    top: 10%;
    left: 45%;
    animation-duration: 25s;
    animation-delay: -15s;
}
.header-particle-11 {
    width: 12px;
    height: 12px;
    top: 60%;
    left: 25%;
    animation-duration: 18s;
    animation-delay: -5s;
}
.header-particle-12 {
    width: 9px;
    height: 9px;
    top: 40%;
    left: 55%;
    animation-duration: 20s;
    animation-delay: -11s;
}
.header-particle-13 {
    width: 11px;
    height: 11px;
    top: 85%;
    left: 35%;
    animation-duration: 22s;
    animation-delay: -7s;
}
.header-particle-14 {
    width: 8px;
    height: 8px;
    top: 30%;
    left: 18%;
    animation-duration: 19s;
    animation-delay: -13s;
}
.header-particle-15 {
    width: 10px;
    height: 10px;
    top: 70%;
    left: 78%;
    animation-duration: 21s;
    animation-delay: -1s;
}

@keyframes floatHeaderParticle {
    0%,
    100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.6;
    }
    25% {
        transform: translate(30px, -40px) scale(1.3) rotate(90deg);
        opacity: 0.9;
    }
    50% {
        transform: translate(-20px, -80px) scale(0.8) rotate(180deg);
        opacity: 0.7;
    }
    75% {
        transform: translate(40px, -120px) scale(1.1) rotate(270deg);
        opacity: 1;
    }
}

.page-title {
    font-family: "Playfair Display", serif;
    font-size: 4.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.1em;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(
        135deg,
        var(--text-primary),
        var(--accent-primary)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    position: relative;
    z-index: 2;
}

.page-subtitle {
    font-family: "Inter", sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 1rem;
    font-style: italic;
    letter-spacing: 0.05em;
    max-width: 600px;
    margin: 1rem auto 0;
    position: relative;
    z-index: 2;
}

/* Floating Particles */
.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: rgba(155, 175, 135, 0.5);
    border-radius: 50%;
    animation: floatParticle 20s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(155, 175, 135, 0.6);
}

.particle-1 {
    width: 8px;
    height: 8px;
    top: 20%;
    left: 10%;
    animation-duration: 25s;
    animation-delay: -5s;
}
.particle-2 {
    width: 10px;
    height: 10px;
    top: 60%;
    left: 80%;
    animation-duration: 30s;
    animation-delay: -10s;
}
.particle-3 {
    width: 6px;
    height: 6px;
    top: 40%;
    left: 60%;
    animation-duration: 35s;
    animation-delay: -15s;
}
.particle-4 {
    width: 9px;
    height: 9px;
    top: 80%;
    left: 30%;
    animation-duration: 28s;
    animation-delay: -8s;
}
.particle-5 {
    width: 8px;
    height: 8px;
    top: 30%;
    left: 90%;
    animation-duration: 32s;
    animation-delay: -12s;
}

@keyframes floatParticle {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    25% {
        transform: translate(20px, -30px) scale(1.2);
        opacity: 0.8;
    }
    50% {
        transform: translate(-15px, -60px) scale(0.8);
        opacity: 0.6;
    }
    75% {
        transform: translate(30px, -90px) scale(1.1);
        opacity: 0.9;
    }
}

.news-section {
    background: var(--newspaper-light);
    color: var(--newspaper-dark);
    padding: 0;
}

.news-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 600px;
}

/* Search Header */
.search-header {
    background: var(--newspaper-light);
    border-bottom: 3px solid var(--newspaper-dark);
    padding: 2.5rem 2rem 2rem;
}

.search-title {
    font-family: "Playfair Display", serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--newspaper-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    border-bottom: 2px solid var(--newspaper-dark);
    padding-bottom: 0.5rem;
}

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border: 3px solid var(--newspaper-dark);
}

.bias-filter-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 1.2rem 1.5rem;
    font-size: 1.1rem;
    border: none;
    background: var(--newspaper-light);
    color: var(--newspaper-dark);
    font-family: "Inter", sans-serif;
    font-weight: 500;
}

.search-input::placeholder {
    color: rgba(13, 13, 13, 0.6);
    font-style: italic;
}

.search-input:focus {
    outline: none;
    background: rgba(155, 175, 135, 0.1);
}

.search-button {
    background: var(--newspaper-dark);
    color: var(--newspaper-light);
    border: none;
    padding: 1.2rem 2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-button:hover {
    background: var(--accent-primary);
}

.search-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.suggestion-tag {
    background: rgba(155, 175, 135, 0.2);
    border: 2px solid var(--newspaper-dark);
    color: var(--newspaper-dark);
    padding: 0.5rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-tag:hover {
    background: var(--accent-primary);
    color: var(--newspaper-light);
    border-color: var(--accent-primary);
}

/* News Content Area */
.news-content {
    min-height: 500px;
}

/* Main News Area */
.news-main {
    padding: 2rem;
    background: var(--newspaper-light);
}

/* News Results */
.news-results {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.welcome-message {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--newspaper-dark);
}

.welcome-message i {
    font-size: 4rem;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}

.welcome-message h3 {
    font-family: "Playfair Display", serif;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.welcome-message p {
    font-size: 1.1rem;
    color: var(--newspaper-dark);
    opacity: 0.8;
    font-weight: 500;
    max-width: 400px;
    margin: 0 auto;
}

/* Article Container with Image Outside */
.article-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding: 2rem 0;
    border-bottom: 2px solid rgba(13, 13, 13, 0.3);
    margin: 0 -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

.article-container:last-child {
    border-bottom: none;
}

/* News Article - Content Only */
.news-article {
    background: transparent;
    transition: all 0.3s ease;
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-article:hover {
    transform: translateY(-2px);
}

/* Article Image - Outside the box */
.article-image {
    width: 300px;
    height: auto;
    min-height: 200px;
    max-height: 300px;
    background: #333;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.8rem;
    text-align: center;
    padding: 0;
    flex-shrink: 0;
}

.article-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.article-source {
    font-weight: 700;
    color: var(--accent-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bias-indicator {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    flex-shrink: 0;
}

.bias-indicator.left {
    background: #3498db;
    color: white;
}

.bias-indicator.center {
    background: #7f8c8d;
    color: white;
}

.bias-indicator.right {
    background: #e74c3c;
    color: white;
}

.article-title {
    font-family: "Playfair Display", serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--newspaper-dark);
    margin-bottom: 0.75rem;
    line-height: 1.3;
    border-bottom: 1px solid var(--newspaper-dark);
    padding-bottom: 0.5rem;
}

.article-excerpt {
    color: var(--newspaper-dark);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    font-weight: 500;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--newspaper-dark);
    opacity: 0.7;
}

.article-time {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.read-more {
    color: var(--accent-primary);
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
    text-shadow: 0 0 1px var(--accent-primary);
}

.read-more:hover {
    color: var(--accent-secondary);
    text-shadow: 0 0 1px var(--accent-secondary);
}

/* Loading Panel */
.loading-panel {
    display: none;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--newspaper-light);
}

.loading-panel.show {
    display: block;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(13, 13, 13, 0.1);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--newspaper-dark);
    margin-bottom: 0.5rem;
}

.loading-subtext {
    font-size: 1rem;
    color: var(--newspaper-dark);
    opacity: 0.7;
    font-style: italic;
}

/* Error Panel */
.error-panel {
    display: none;
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(231, 76, 60, 0.1);
    border: 3px solid #e74c3c;
}

.error-panel.show {
    display: block;
}

.error-icon {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.error-title {
    font-family: "Playfair Display", serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.1rem;
    color: var(--newspaper-dark);
    margin-bottom: 1.5rem;
}

.retry-button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.retry-button:hover {
    background: #c0392b;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .search-input-wrapper {
        flex-direction: column;
    }

    .search-button {
        justify-content: center;
    }

    .search-suggestions {
        justify-content: flex-start;
    }

    .article-container {
        flex-direction: column;
        gap: 1rem;
    }

    .article-image {
        width: 100%;
        height: 200px;
        order: -1; /* Show image first on mobile */
    }

    .article-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 3.5rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header-section {
        padding: 2rem 1rem;
    }

    .page-title {
        font-size: 2.8rem;
    }

    .page-subtitle {
        font-size: 0.95rem;
    }

    .search-header,
    .news-main {
        padding: 1.5rem;
    }

    .search-title {
        font-size: 1.6rem;
    }

    .article-title {
        font-size: 1.2rem;
    }

    .suggestion-tag {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Bias Filtering Styles */
.bias-filter-button {
    background: var(--newspaper-light);
    color: var(--newspaper-dark);
    border: 2px solid var(--newspaper-dark);
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: "Inter", sans-serif;
    opacity: 0.6;
    position: relative;
    border-radius: 4px;
}

.bias-filter-button:hover {
    background: var(--newspaper-dark);
    color: var(--newspaper-light);
    opacity: 1;
}

.bias-filter-button:not([style*="opacity: 0.6"]):hover {
    opacity: 1;
}

.bias-filter-button.active {
    background: var(--accent-primary);
    color: var(--newspaper-light);
    border-color: var(--accent-primary);
}

.bias-filter-button.active:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

.bias-filter-button i {
    font-size: 1rem;
}

.bias-filter-text {
    font-weight: 600;
}

.bias-filter-status {
    background: var(--newspaper-light);
    border: 3px solid var(--newspaper-dark);
    padding: 1.5rem 2rem;
    margin: 2rem 0 1.5rem 0;
    animation: slideInFromTop 0.5s ease-out;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: var(--newspaper-dark);
}

.bias-filter-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
}

.bias-filter-indicator i {
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.bias-filter-message {
    flex: 1;
    font-weight: 600;
    color: var(--newspaper-dark);
    font-family: "Playfair Display", serif;
    font-size: 1.1rem;
    font-style: italic;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.bias-filter-message .filter-info {
    color: var(--newspaper-dark);
    font-weight: 700;
    background: rgba(155, 175, 135, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

.disable-bias-filter {
    background: var(--newspaper-light);
    color: var(--newspaper-dark);
    border: 1px solid var(--newspaper-dark);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: "Inter", sans-serif;
}

.disable-bias-filter:hover {
    background: var(--newspaper-dark);
    color: var(--newspaper-light);
}

/* Fallback Message Styles */
.fallback-message-container {
    margin-bottom: 1.5rem;
}

.fallback-message {
    background: var(--newspaper-light);
    border: 3px solid var(--newspaper-dark);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInFromTop 0.5s ease-out;
}

.fallback-icon {
    color: var(--accent-primary);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.fallback-content {
    flex: 1;
}

.fallback-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.fallback-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.4;
}

/* Animations */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive for Bias Filtering */
@media (max-width: 768px) {
    .bias-filter-container {
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    .bias-filter-button {
        width: 100%;
        justify-content: center;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
    
    .bias-filter-status {
        padding: 1rem;
        margin: 1.5rem 0 1rem 0;
    }
    
    .bias-filter-indicator {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .bias-filter-message {
        font-size: 1rem;
    }
    
    .fallback-message {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .fallback-icon {
        font-size: 1.2rem;
    }
}