/* General styles */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5; /* Light background */
    color: #333; /* Dark text color */
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url(''); /* Set the background image dynamically with JavaScript */
    background-size: cover;
    backdrop-filter: blur(10px); /* Adjust blur intensity as needed */
    z-index: -1; /* Push the pseudo-element behind other content */
}

header {
    text-align: center;
    background: #ffffff; /* Light background */
    padding: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Lighter shadow */
    margin-bottom: 20px;
}

header h1 {
    color: #333; /* Dark text color */
    font-size: 20px;
}

#searchBar {
    width: 80%;
    padding: 10px;
    border: 1px solid #ccc; /* Light gray border */
    border-radius: 4px;
    background: #ffffff; /* Light background */
    color: #333; /* Dark text color */
    margin-top: 10px;
}

main {
    padding: 20px;
}

#articlesContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.articleCard {
    background: #ffffff; /* Light background */
    padding: 2px;
    width: 400px;
    cursor: pointer;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Lighter shadow */
}

.articleCard img {
    max-width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.articleCard h3 {
    margin: 10px 0;
    color: #333; /* Dark text color */
}

/* Loading skeleton styles */
.skeleton-card {
    background: #eee; /* Light gray background */
    padding: 10px;
    width: 200px;
    height: 260px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-image,
.skeleton-title {
    background: #ddd; /* Medium gray background */
    border-radius: 4px;
}

.skeleton-image {
    width: 100%;
    height: 150px;
}

.skeleton-title {
    width: 80%;
    height: 20px;
}

@keyframes pulse {
    0% {
        background-color: #ddd; /* Medium gray */
    }
    50% {
        background-color: #ccc; /* Slightly darker gray */
    }
    100% {
        background-color: #ddd; /* Medium gray */
    }
}

/* Media query for mobile devices */
@media (max-width: 768px) {
    .articleCard {
        width: 90%;
    }
}

.social-icons a {
    color: rgba(57, 100, 20); /* Neon green color with transparency for social icons */
    margin: 0 5px;
}

.social-icons a:hover {
    color: rgba(0, 150, 0); /* Brighter neon green with transparency on hover */
}

.highlight {
    background-color: yellow;
    cursor: pointer;
}

/* Article page specific styles */
.article-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px auto;
    max-width: 800px;
    padding: 20px;
    background: #ffffff; /* Light background for articles */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Lighter shadow */
    border-radius: 8px;
}

.article-image {
    width: 100%;
}

.article-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Lighter shadow */
}

.article-details {
    width: 100%;
    margin-top: 20px;
}

.article-details h1 {
    color: #333; /* Dark text color */
    font-size: 28px; /* Larger font size */
    margin-bottom: 20px;
    text-align: center;
}

.article-details #articleContent {
    color: #333; /* Dark text color */
    font-size: 18px; /* Medium's typical font size */
    line-height: 1.6; /* Increased line spacing for better readability */
    text-align: left;
    margin-top: 20px;
}

/* Responsive design for mobile devices */
@media (max-width: 768px) {
    .articleCard {
        width: 90%;
    }

    .article-container {
        margin: 20px 10px;
    }

    #searchBar {
        width: 90%;
    }
}

/* Text-to-Speech button styles */
.tts-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #ff6c00; /* Neon orange */
    color: #fff;
    border: none;
    border-radius: 50%;
    padding: 15px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.tts-button:hover {
    background-color: #e65a00; /* Darker neon orange on hover */
}

#articleTitle {
    font-family: sans-serif;
    font-size: 30px;
}

iframe {
    width: 100%;
}

/* Edit and Delete Button Styles */
.chat-message {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px;
    border-radius: 5px;
    background-color: #f1f1f1; /* Light background */
}

.chat-message-text {
    flex-grow: 1;
}

.chat-message-actions {
    display: flex;
    gap: 5px;
}

.chat-edit-btn,
.chat-delete-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: #007bff;
}

.chat-edit-btn:hover,
.chat-delete-btn:hover {
    text-decoration: underline;
}

/* Floating Button Styles */
.floating-button {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #007bff; /* Blue background */
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    box-shadow: 2px 2px 5px #000;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.floating-button:hover {
    background-color: #0056b3;
}

.floating-button i {
    font-size: 24px;
}

/* Context menu styles */
.context-menu {
    display: none;
    position: absolute;
    z-index: 1000;
    width: 150px;
    background-color: #ffffff; /* Light background */
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1); /* Lighter shadow */
    border-radius: 8px;
    padding: 10px;
}

.context-menu ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.context-menu li {
    padding: 8px 12px;
    cursor: pointer;
    color: red;
}

.context-menu li:hover {
    background-color: #eee; /* Light gray */
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #ffffff; /* Light background */
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #ccc;
    width: 80%;
    max-width: 300px;
    text-align: center;
    border-radius: 10px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.google-button {
    background-color: #4285F4;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.google-button i {
    margin-right: 10px;
}

.google-button:hover {
    background-color: #357AE8;
}

.profile-container {
    background: #ffffff; /* Light background */
    padding: 20px 30px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: center;
    max-width: 90vw;
    margin: 50px auto;
}

.articleCard {
    display: inline-block;
    width: 250px;
    margin: 10px;
    padding: 3px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.articleCard:hover {
    transform: scale(1.05);
}

.articleCard img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.articleCard h3 {
    margin: 0;
    font-size: 1.1em;
    color: #333;
}

.skeleton-card {
    display: inline-block;
    width: 200px;
    height: 250px;
    margin: 10px;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: #eee;
}

.skeleton-image {
    width: 100%;
    height: 150px;
    background: #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
}

.skeleton-title {
    width: 80%;
    height: 20px;
    background: #ddd;
    margin: 0 auto;
    border-radius: 8px;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #ffffff; /* Light background */
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1;
    border-radius: 4px;
}

.dropdown-content a, .dropdown-content input, .dropdown-content p {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover, .dropdown-content input:hover, .dropdown-content p:hover {
    background-color: #eee; /* Light gray */
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropbtn {
    cursor: pointer;
}

/* Responsive styles */
@media (max-width: 600px) {
    .profile-container {
        padding: 10px;
    }

    .articleCard {
        width: 100%;
    }
}

.article-container {
    padding: 10px;
    margin: 0 auto;
    max-width: 800px; /* Adjust this value as needed */
    overflow: hidden; /* Ensures that no content overflows the container */
}

#articleContent img, #articleContent table {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto; /* Center the images if necessary */
}

#articleContent table {
    width: 100%;
    border-collapse: collapse;
}

#articleContent th, #articleContent td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
}

#articleContent th {
    background-color: #ddd;
}

.open-chat-button {
    padding: 10px 20px;
    margin: 20px 0;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.open-chat-button:hover {
    background-color: #0056b3;
}

#numOfLikes {
    color: #999;
    font-family: sans-serif;
}

.comments-section {
    margin-top: 30px;
}

.comments-section h3 {
    margin-bottom: 15px;
}

.comments-section #commentsList {
    margin-bottom: 20px;
}

.comments-section .comment {
    border-bottom: 1px solid #ccc;
    padding: 10px 0;
}

.comments-section .comment p {
    margin: 0;
}

.comments-section .comment a {
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}

.comments-section .comment a:hover {
    text-decoration: underline;
}

#commentForm textarea {
    width: 100%;
    height: 80px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #ffffff;
    color: #333;
}

#commentForm button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

#loginPrompt {
    color: #999;
    font-family: sans-serif;
}

#loginPrompt a {
    color: #007bff;
    text-decoration: none;
}

#loginPrompt a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .comments-section {
        padding: 10px;
    }

    #commentForm textarea {
        height: 60px;
    }

    #commentForm button {
        width: 100%;
    }

    .comment {
        padding: 5px 0;
    }

    .controls input[type="range"] {
        width: 70%;
    }
}

/* User Profile Section */
.user-profile {
    display: flex;
    align-items: center;
    margin-top: 20px;
    padding: 10px;
}

.profile-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.profile-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.profile-name {
    font-size: 1.2em;
    font-weight: bold;
}

.profile-link:hover .profile-name {
    text-decoration: underline;
}

/* Comment Section Styles */
.comment {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #f5f5f5;
}

.comment-author {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.comment-profile-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.comment p {
    margin: 0;
    color: #242722;
    font-size: 18px;
    line-height: 1.6;
    text-align: left;
    padding: 30px;
}

/* Chat Modal Styles */
.chat-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.chat-modal-content {
    background-color: #ffffff; /* Light background */
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #ccc;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.close-chat {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-chat:hover,
.close-chat:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.chat-messages {
    flex-grow: 1;
    margin-bottom: 20px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 8px;
    background-color: #f5f5f5;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.chat-message .profile-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.chat-bubble {
    max-width: 70%;
    padding: 10px;
    border-radius: 10px;
    background-color: #ddd;
    position: relative;
    word-wrap: break-word;
}

.chat-bubble .sender-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.chat-bubble[data-sender="me"] {
    background-color: #ccc;
    align-self: flex-end;
}

.chat-bubble[data-sender="me"] .sender-name {
    display: none;
}

.chat-bubble[data-sender="other"] {
    background-color: #ddd;
}

.chat-message-actions {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.chat-edit-btn,
.chat-delete-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: #007bff;
}

.chat-edit-btn:hover,
.chat-delete-btn:hover {
    text-decoration: underline;
}

.chat-input-container {
    display: flex;
    margin-top: 10px;
}

#chatInput {
    flex-grow: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #ffffff;
    color: #333;
}

#sendChatButton {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
}

#sendChatButton:hover {
    background-color: #0056b3;
}

.floating-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 1000;
}

.like-button-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.like-button {
    background-color: #007bff; /* Blue background */
    color: white;
    border: none;
    border-radius: 100%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.like-button:hover {
    background-color: #0056b3;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.like-button.liked {
    background-color: #ff6c00; /* Change to a different color when liked */
}

.like-button i {
    font-size: 24px;
}

.num-of-likes {
    margin-right: 10px;
    font-size: 18px;
    color: #999;
    font-family: sans-serif;
}

.num-of-views {
    font-size: 18px;
    color: #999;
    font-family: sans-serif;
    margin-left: 10px;
    display: flex;
    align-items: center;
}

.num-of-views i {
    margin-right: 5px;
}

.follow-button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px 0;
}

.follow-button:hover {
    background-color: #0056b3;
}

.follow-button.following {
    background-color: #ff6c00; /* Change to a different color when following */
}

/* Modal for full-size image */
#myModal .modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    position: relative;
}

#myModal .modal-content img {
    width: 100%;
    height: auto;
}

#myModal .controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
}

#myModal .controls input[type="range"] {
    width: 80%;
    margin: 0 10px;
}

#myModal .controls a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
}

#myModal .controls a:hover {
    text-decoration: underline;
}

footer {
    background-color: #f5f5f5;
    color: #333;
    padding: 20px;
    text-align: center;
    font-family: sans-serif;
}

.footer-content p {
    font-size: 20px;
    margin-bottom: 10px;
}

.footer-content ul {
    list-style-type: none;
    padding: 0;
}

.footer-content ul li {
    margin-bottom: 5px;
}

.footer-content ul li a {
    color: #333;
    text-decoration: none;
}

.footer-content ul li a:hover {
    text-decoration: underline;
}

.comments-section {
    padding: 10px;
}

#commentForm textarea {
    height: 60px;
}

#commentForm button {
    width: 100%;
}

.comment {
    padding: 5px 0;
}

.controls input[type="range"] {
    width: 70%;
}

/* Views Display Styles */
.num-of-views {
    font-size: 18px;
    color: #999;
    font-family: sans-serif;
    margin-left: 10px;
    display: flex;
    align-items: center;
}

.num-of-views i {
    margin-right: 5px;
}

.profile-container {
    width: 99vw;
}

/* Chat bubble styles */
.chat-bubble {
    max-width: 70%;
    padding: 10px;
    border-radius: 10px;
    background-color: #ddd;
    position: relative;
    word-wrap: break-word;
    margin-bottom: 10px;
}

.chat-bubble .sender-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.chat-bubble[data-sender="me"] {
    background-color: #ccc;
    align-self: flex-end;
    text-align: right; /* Align text to the right */
}

.chat-bubble[data-sender="me"] .sender-name {
    display: none;
}

.chat-bubble[data-sender="other"] {
    background-color: #ddd;
    align-self: flex-start;
    text-align: left; /* Align text to the left */
}
