* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Newsreader', serif;
    background-color: #f8f9fa;
    color: #333;
    text-align: center;
}

header {
    position: absolute;
    top: 0px;
    left: 0;
    width: 100%;
    height: 50px;
    background: #012A4A;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.menu-icon {
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.menu-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 100px;
    padding: 0px;
    transition: all 0.3s ease-in-out;
    width: 150px;
    overflow: hidden
}

.search-bar {
    border: none;
    outline: none;
    font-size: 16px;
    font-family: 'Newsreader', serif;
    padding: 5px;
    width: 100px;
    transition: width 0.3s ease-in-out;
    border-radius: 250px;
}

.search-icon {
    width: 32px;
    height: 32px;
    top: 0px;
    cursor: pointer;
    position: absolute;
    right: 10px;
    transition: transform 0.3s ease-in-out;
    outline: none;
    border: none;
}

.search-btn {
    outline: none;
    border: none;
}

.search-container.active {
    width: 200px;
}

.search-container.active .search-bar {
    width: 160px;
}

.search-container.active {
    width: 200px;
}

.search-container.active .search-bar {
    width: 160px;
}

.search-container.active .search-icon {
    transform: translateX(6px);
}

.user-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.user-icon img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid #ccc;
    margin-right: 10px;
    transition: transform 0.3s ease-in-out;
}

.user-icon img:hover {
    transform: scale(1.1);
}

.popup {
    display: none;
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Newsreader', serif;
    white-space: nowrap;
    animation: fadeIn 0.3s ease-in-out;
    z-index: 10001;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.search-container input {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}



.sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 180px;
    height: 100%;
    background: #012A4A;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transition: left 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    padding-top: 60px;
    z-index: 999;
}

.sidebar.active {
    left: 0;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.sidebar ul li a {
    text-decoration: none;
    color: white;
    font-family: 'Newsreader', serif;
    font-size: 14px;
    display: block;
}

.sidebar ul li:hover {
    background: rgba(0, 0, 0, 0.1);
}

.menu-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.article-content {
    max-width: 90%;
    margin: 10px;
}

.container {
    position: relative;
    font-size: 0.6rem;
    top: 60px;
    width: 95%;
    max-width: 900px;
    margin: 0 auto;
    background-color: #012A4A;
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.article-content h2, 
.article-content h3 {
    margin-top: 30px;
    font-size: 24px;
    text-align: center;
}

.article-content {
    line-height: 1.8;
    font-size: 18px;
    max-width: 100%;
    margin-top: 60px;
    text-align: center;
    padding: 30px 0;
    background-color: #fff;
}

.content {
    flex: 1;
    line-height: 1.8;
    font-size: 18px;
    max-width: 95%;
    margin: 0 auto;
    margin-top: 20px;
    text-align: center;
}

.article-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    height: auto;
    margin-bottom: 20px;
    border-radius: 10px;
}

footer {
    background: #012A4A;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    position: relative;
    width: 100%;
    bottom: 0;
    color: white;
    font-family: 'Newsreader', serif;
    box-sizing: border-box;
    max-width: 100vw;
    overflow: hidden;
}

.go-back {
    display: inline-block;
    text-decoration: none;
    background: #012A4A;
    color: white;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 5px;
    font-weight: bold;
    margin: 20px auto;
    display: block;
    text-align: center;
    width: fit-content;
    transition: 0.3s ease;
    border: none;
    cursor: pointer;
}

.go-back:hover {
    background: #0056b3;
}

#related-articles-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 20px 0;
    scroll-snap-type: x mandatory;
}

.post-preview {
    flex: 0 0 auto;
    width: 300px;
    border: 1px solid #ddd;
    border-radius: 8px;
    user-select: none;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    scroll-snap-align: start;
}

.post-preview:hover {
    transform: translateY(-5px);
}

.post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #ddd;
}

.post-content {
    padding: 15px;
    text-align: center;
}

.post-content h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
}

.post-content p {
    font-size: 1em;
    color: #555;
    margin-bottom: 15px;
}

.read-more {
    font-size: 0.9em;
    color: #007bff;
    cursor: pointer;
    font-weight: bold;
}

.read-more:hover {
    text-decoration: underline;
}

.code-box {
    background-color: #f4f4f4;
    border-left: 5px solid #007bff;
    padding: 10px;
    margin: 10px 0;
    overflow-x: auto;
    position: relative;
    border-radius: 5px;
}

.code-box code {
    font-family: monospace;
    display: block;
    white-space: pre;
}

.copy-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #007bff;
    color: white;
    border: none;
    padding: 5px 8px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
}

.copy-btn:hover {
    background: #0056b3;
}

.mode-container {
    position: fixed;
    top: 53px;
    right: 4px;
    z-index: 100;
}

#modeToggleBtn {
    background-color: #012A4A;
    color: white;
    font-size: 24px;
    padding: 12px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    width: 50px;
    height: 50px;
    text-align: center;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    transition: background 0.3s ease, transform 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modeToggleBtn:active {
    transform: rotate(180deg);
}

#modeList {
    list-style: none;
    padding: 5px;
    margin: 0;
    position: absolute;
    top: 50px;
    right: 0;
    z-index: 1000;
    border: none;
    border-radius: 10px;
    box-shadow: none;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out;
    background: transparent;
}

#modeList.open {
    max-height: 120px;
    opacity: 1;
}

#modeList li {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: #B0C4DE;
    margin: 5px auto;
    cursor: pointer;
    font-size: 22px;
    transition: background 0.3s ease, transform 0.2s ease;
}

#modeList li:hover {
    background: #012A4A;
    color: white;
    transform: scale(1.1);
}

/* ===== 🌙 THEME TRANSITIONS ===== */
body, header, footer, .article, #searchBar, #categoryBtn, 
#sortBtn, #modeToggleBtn {
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* ===== ☀️ DAY MODE ===== */
body.day-mode {
    background-color: #EAFDF8;
    color: #333;
}

.day-mode header, .day-mode footer {
    background-color: #A9D6E5;
    color: #012A4A;
}

.day-mode .article, 
.day-mode #searchBar {
    background-color: white;
    color: black;
    border: 1px solid #ddd;
}

.day-mode #categoryBar, 
.day-mode #sortBtn, 
.day-mode #modeToggleBtn {
    background-color: #A9D6E5;
    color: black;
}

/* ===== 🌙 NIGHT MODE ===== */
body.night-mode {
    background-color: #2F4F4F;
    color: white;
}

.night-mode header, 
.night-mode footer {
    background-color: #2C3E50;
    color: white;
}

.night-mode .article, {
    background-color: #2C3E50;
    color: white;
    border: 1px solid #444;
}

.night-mode #modeToggleBtn,
.night-mode .post-preview,
.night-mode .sidebar,
.night-mode #sortList,
.night-mode .post-content,
.night-mode .post-preview,
.night-mode .posts-wrapper {
    background-color: #2C3E50;
    color: white;
}

.night-mode .search-container,
.night-mode .search-bar,
.night-mode .article-content,
.night-mode .container,
.night-mode .content {
     background-color: #2F4F4F;
}

/* ===== 📖 READING MODE ===== */
body.reading-mode,
.reading-mode .article-content {
    background-color: #EDEDED;
    color: #2C2C2C;
}

.reading-mode header, 
.reading-mode footer,
.reading-mode .container {
    background-color: #B0AFAF;
    color: #2C2C2C;
}

.reading-mode .article {
    background-color: #B0AFAF;
    color: 2C2C2C;
    border: 1px solid #B0AFAF;
}

.reading-mode #modeToggleBtn,
.reading-mode .post-preview,
.reading-mode .sidebar,
.reading-mode #sortList,
.reading-mode #categoryList,
.reading-mode .post-content,
.reading-mode .post-preview,
.reading-mode .posts-wrapper {
    background-color: #B0AFAF;
    color: black;
}

.reading-mode .search-container,
.reading-mode .search-bar {
    background-color: #EDEDED;
    color: 2C2C2C;
    border: 1px solid #EDEDED;
}

.mode-icon {
    width: 30px;
    height: 30px;
    display: block;
    margin: 0 auto;
    vertical-align: middle;
}

.table-container {
  margin: 20px 0;
}

.table-container h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

thead {
  background-color: ;
}

th, td {
  border: 1px solid #ccc;
  padding: 10px 15px;
  text-align: left;
}

th {
  font-weight: bold;
}

tbody tr:nth-child(even) {
  background-color: ;
}

tbody tr:hover {
  background-color: ;
}