/* Base body styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;  /* Ensures the footer is at the bottom */
}

/* Header Styling */
header {
    background-color: #333;
    color: white;
    padding: 1rem;
    text-align: center;
}

/* Main Content Styling */
main {
    flex: 1;  /* Ensures the content area takes up available space */
    padding: 20px;
}

/* Category Section */
#category-section {
    margin-bottom: 20px;
    text-align: center;
}

/* Input and Button Styling */
#category, #custom-category, #filter-button {
    padding: 10px;
    font-size: 16px;
    border-radius: 4px;
    margin: 5px;
    width: 250px;
}

/* Button Styling */
#filter-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

#filter-button:hover {
    background-color: #45a049;
}

/* Loading Indicator */
#loading {
    text-align: center;
    font-size: 18px;
    color: #333;
    display: none;
}

/* News Section Grid */
#news-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

/* Article Styling */
.article {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 300px;
    margin-bottom: 20px;
}

/* Article Titles and Content */
.article h3 {
    font-size: 18px;
    color: #333;
}

.article p {
    font-size: 14px;
    color: #666;
}

.article a {
    color: #4CAF50;
    text-decoration: none;
}

.article a:hover {
    text-decoration: underline;
}

/* Sentiment Analysis Styling */
.sentiment {
    font-weight: bold;
    margin-top: 10px;
    font-size: 14px;
}

/* Footer Styling */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 10px;
    position: relative;
    width: 100%;
    bottom: 0;
    margin-top: auto;  /* Keeps footer at the bottom */
}

/* Responsive design for mobile devices */
@media only screen and (max-width: 600px) {
    #category-section {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #category, #custom-category, #filter-button {
        width: 80%;
        margin-bottom: 10px;
    }

    #news-section {
        font-size: 14px;
    }

    footer {
        font-size: 12px;
    }
}

/* Responsive design for tablets */
@media only screen and (max-width: 900px) {
    #category-section {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #category, #custom-category, #filter-button {
        width: 70%;
        margin-bottom: 10px;
    }
}