/* Reset and general styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.8; /* Improved readability */
    word-spacing: 0.05rem; /* Added word spacing */
}

/* Header styles */
header {
    background-color: #007BFF;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Added shadow for depth */
}

header h1 {
    margin: 0;
    letter-spacing: 0.05rem; /* Added letter spacing for readability */
}

/*
header button {
    padding: 10px 15px;
    background-color: white;
    color: #007BFF;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

header button:hover {
    background-color: #e0e0e0;
}
*/
/* Main content styles */
main {
    padding: 20px;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}


.intro {
    text-align: center;  /* Center align the text */
    margin-bottom: 20px; /* Space between intro and search bar */
}

.intro p {
    font-size: 15px;
    font-weight: bold;                       /* Slightly larger font size */
    color: #525151;                           /* Darker text for readability */
    font-family: 'Arial', sans-serif;      /* Change font family for better typography */
    line-height: 1.5;                      /* Improve line spacing */
    letter-spacing: 0.4px;                 /* Add some letter spacing */
    transition: transform 0.3s ease, color 0.3s ease; /* Transition for hover effect */
    cursor: pointer;                       /* Change cursor to pointer */
}

.intro p:hover {
    transform: translateY(-2px);          /* Lift effect on hover */
    color: #007BFF;                       /* Change text color on hover */
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Add subtle shadow on hover */
}



.search-bar {
    text-align: center;
    margin-bottom: 20px;
}

.search-bar input {
    margin-top: 40px;
    margin-bottom: 20px;
    padding: 10px;
    width: 60%;
    font-size: 16px;
    border: 1px solid #ccc; /* Added border for better visibility */
    border-radius: 23px;
    transition: border-color 0.3s ease; /* Transition for focus effect */
}

.search-bar input:focus {
    border-color: #007BFF; /* Highlight border on focus */
}

.search-bar button {
    padding: 10px 15px;
    font-size: 16px;
    background-color: #28A745;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 23px;
    transition: background-color 0.3s ease; /* Smooth hover effect */
}

.search-bar button:hover {
    background-color: #218838; /* Darker green on hover */
}

/* Style for the loading message */
.loading-message {
    text-align: center;
    font-size: 18px;
    color: #FF4500; /* Alert color, adjust if needed */
    font-weight: bold;
    margin-top: 20px;
} 

.search-result {
    text-align: center; /* Center the text */
    font-weight: bold;  /* Make the text bold */
    font-size: 30px;    /* Adjust the font size if needed */
    margin-top: 20px;   /* Add space above the result */
}


hr {
    border: none;
    height: 2px; /* Adjust thickness */
    width: 50%; /* Adjust width as needed */
    background: linear-gradient(to right, #663399, #E6E6FA); /* Gradient color */
    margin: 50px auto; /* Center the hr by using auto on the sides */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    border-radius: 5px; /* Rounded edges */
}

.button-container {
    text-align: center;
    margin: 15px 0;
}

.content-button {
    padding: 10px 15px;
    font-size: 16px;
    margin: 0 10px;
    background-color: #007BFF;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 23px;
    transition: background-color 0.3s ease, transform 0.2s ease; /* Added transform for button effect */
}

.content-button:hover {
    background-color: #0056b3; /* Darker shade on hover */
    transform: translateY(-2px); /* Subtle lift effect on hover */
}

.content-button.active {
    background-color: #0056b3; /* Active button color */
}


.read-button {
    padding: 10px 15px;
    font-size: 16px;
    margin: 0 10px;
    background-color: #6A5ACD;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 23px;
    transition: background-color 0.3s ease, transform 0.2s ease; /* Added transform for button effect */
}

.read-button:hover {
    background-color: #0056b3; /* Darker shade on hover */
    transform: translateY(-2px); /* Subtle lift effect on hover */
}

.read-button.active {
    background-color: #0056b3; /* Active button color */
}



#article-content {
    padding: 20px;
    line-height: 1.9; /* Improved line spacing */
    word-spacing: 0.1rem; /* Increased word spacing */
    font-size: 1.1rem; /* Slightly larger font size for readability */
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

#download-pdf {
    display: block;
    margin: 20px auto;
    padding: 10px 15px;
    font-size: 16px;
    background-color: #DC3545;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease; /* Smooth hover effect */
}

#download-pdf:hover {
    background-color: #c82333; /* Darker red on hover */
}



/* Dark mode styles */
/*
.dark-mode {
    background-color: #121212;
    color: #E0E0E0;
}

.dark-mode header {
    background-color: #1F1F1F;
}

.dark-mode header button {
    background-color: #E0E0E0;
    color: #1F1F1F;
}

.dark-mode .search-bar button {
    background-color: #28A745;
}

.dark-mode #download-pdf {
    background-color: #DC3545;
}

.dark-mode a {
    color: #BB86FC;
}
*/
/* Dark mode styles */
.dark-mode {
    background-color: #181818; /* Darker background for the body */
    color: #E0E0E0; /* Light gray text for readability */
}

.dark-mode header {
    background-color: #202020; /* Darker header */
    color: #E0E0E0;
}

.dark-mode header button {
    background-color: #383838; /* Dark button background */
    color: #E0E0E0;
}

.dark-mode header button:hover {
    background-color: #4A4A4A; /* Lighter hover effect for buttons */
}

.dark-mode .search-bar input {
    background-color: #282828; /* Darker input background */
    border: 1px solid #444; /* Subtle border for input */
    color: #E0E0E0;
}

.dark-mode .search-bar input:focus {
    border-color: #1DB954; /* Highlight border on focus with a bright accent */
}

.dark-mode .search-bar button {
    background-color: #1DB954; /* Bright green for action buttons */
    color: white;
}

.dark-mode .search-bar button:hover {
    background-color: #17a747; /* Darker hover state for buttons */
}

.dark-mode hr {
    background: linear-gradient(to right, #4A4A4A, #808080); /* Darker gradient for HR */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); /* More prominent shadow */
}

/* Dark mode button styles */
.dark-mode .content-button {
    background-color: #282828; /* Dark button background */
    color: #E0E0E0;
    border: 1px solid #444; /* Subtle border for contrast */
}

.dark-mode .content-button:hover {
    background-color: #383838; /* Lighter hover state */
}

.dark-mode .content-button.active {
    background-color: #007BFF; /* Active button with accent color */
    color: white;
}

.dark-mode .read-button {
    background-color: #282828;
    color: #E0E0E0;
}

.dark-mode .read-button:hover {
    background-color: #383838;
}

.dark-mode .read-button.active {
    background-color: #1DB954;
    color: white;
}

/* Dark mode article content */
.dark-mode #article-content {
    color: #E0E0E0;
}

.dark-mode #article-content a {
    color: #007BFF; /* Accent color for links */
}

.dark-mode #article-content a:hover {
    text-decoration: underline;
}

.dark-mode #article-content img {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); /* Dark shadow for images */
}

.dark-mode #article-content th,
.dark-mode #article-content td {
    border: 1px solid #444; /* Darker borders for tables */
    background-color: #282828;
}

.dark-mode #article-content pre {
    background-color: #1e1e1e;
    color: #E0E0E0;
}

/* Download PDF button in dark mode */
.dark-mode #download-pdf {
    background-color: #DC3545; /* Keep a strong red for contrast */
}

.dark-mode #download-pdf:hover {
    background-color: #C82333;
}

/* Responsive styles in dark mode */
@media (max-width: 768px) {
    .dark-mode .search-bar input {
        background-color: #282828;
        border: 1px solid #444;
    }

    .dark-mode .search-bar button {
        background-color: #1DB954;
    }

    .dark-mode header {
        background-color: #202020;
    }
}





/* Article content styles */
#article-content h1,
#article-content h2,
#article-content h3,
#article-content h4,
#article-content h5,
#article-content h6 {
    color: inherit;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

#article-content a {
    color: #007BFF;
    text-decoration: none;
}

#article-content a:hover {
    text-decoration: underline;
}

#article-content img {
    max-width: calc(100% - 20px); /* Prevent touching the border */
    height: auto;
    margin: 1.5rem 0; /* Added margin for spacing */
    border-radius: 8px; /* Added border radius for a modern look */
}

#article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem; /* Added margin for spacing */
}

#article-content th,
#article-content td {
    border: 1px solid #ccc;
    padding: 10px; /* Increased padding for readability */
    text-align: left;
}

#article-content ul,
#article-content ol {
    margin-left: 20px;
    margin-bottom: 1.5rem; /* Added margin for spacing */
}

#article-content pre {
    background-color: #f8f9fa;
    padding: 10px;
    overflow-x: auto;
    border-radius: 5px; /* Added border radius for a modern look */
    margin-bottom: 1.5rem; /* Added margin for spacing */
}

.dark-mode #article-content pre {
    background-color: #1e1e1e;
}

/* Responsive styles */
@media (max-width: 768px) {
    .search-bar input {
        width: 90%; /* Adjusted for better spacing on mobile */
    }

    .search-bar {
        margin-bottom: 2px; /* Added margin for spacing */
    }

    .search-bar button {
        margin-left: 5px;
        margin-top: 0px;/* Added margin to separate button from the input */
    }

    #article-content {
        padding: 15px;
        font-size: 1rem; /* Adjusted font size for smaller screens */
    }

    header {
        flex-direction: column;
        text-align: center;
    }

    header button {
        margin-top: 10px;
    }

    .button-container {
        margin: 10px 0; /* Reduced margin for smaller screens */
    }

    .content-button {
        margin: 5px; /* Adjusted button spacing */
        width: auto; /* Ensure buttons are not full width */
    }

    #download-pdf {
        margin: 15px 0; /* Margin for button spacing */
    }
}
