/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Montserrat", serif;
    scrollbar-width: thin;
}

button {
    outline: non;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f4f4f4;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 300px;
    text-align: center;
}

h2 {
    color: #333;
    font-size: 18px;
    font-weight: 700;
}

.login-container h2 {
    margin-bottom: 1.5rem;
}

.input-group {
    margin-bottom: 1rem;
    text-align: left;
}

label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 0.5rem;
    color: #333;
}

input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.login-button {
    width: 100%;
    padding: 10px;
    background-color: #06c;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.login-button:hover {
    background-color: #005bb5;
}

.dashboard-wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    height: 60px;
    background-color: white;
    box-shadow: rgba(0, 0, 0, 0.02) 0 10px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
}

.logo {
    height: 90%;
}

h1 {
    color: #222;
    font-weight: 600;
    font-size: 18px;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

aside {
    width: 100%;
    max-width: 250px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

aside .inner {
    width: 100%;
    height: 100%;
    background-color: white;
    border-radius: 5px;
    padding: 10px;
    overflow-y: auto;
}

aside ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

aside ul li {
    position: relative;
    border-radius: 4px;
    user-select: none;
    cursor: pointer;
    overflow: hidden;
    background-color: #f9f9f9;
}

aside ul li.active{
    background-color: #e5e5e5;
}

aside ul li a {
    text-decoration: none;
    display: flex;
    height: 40px;
    padding: 0 10px;
}

aside ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background-color: #06c;
}

aside ul li div,
aside ul li button {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #222;
    font-weight: 500;
}

aside ul li button{
    background-color: transparent;
    border: none;
    outline: none;
    color: white;
    width: 100%;
    height: 100%;
}

aside ul li img {
    width: 16px;
    height: 16px;
}

aside .logout {
    margin-top: 40px;
    background-color: rgb(254, 25, 25);
    padding: 0;
    height: 35px;
}

aside .logout button{
    height: 35px;
    padding-left: 10px;
}

aside .logout div {
    color: white;
}

aside .logout::before {
    background-color: rgb(255, 176, 176);
}

.main-section {
    flex: 1;
    height: 100%;
    padding: 30px;
    overflow: hidden;
}

.main-section .inner {
    width: 100%;
    height: 100%;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.main-section header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

button.primary {
    padding: 6px 10px;
    background-color: #06c;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
}

button.cancel {
    padding: 6px 10px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
}

.blogs-grid {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    list-style: none;
    overflow-y: auto;
    margin-top: 20px;
    padding-right: 20px;
}

.blog-card {
    flex: 1 0 200px;
    max-width: 25%;
    min-width: 200px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: white;
}

.blog-card img {
    width: 100%;
    height: 130px;
    border-radius: 5px;
    object-fit: cover;
}

.blog-card .label {
    color: white;
    background-color: #06c;
    font-size: 10px;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 5px;
}

.blog-card .datetime {
    font-size: 10px;
    color: #777;
    margin-top: 10px;
    margin-bottom: 10px;
}

.blog-card h3 {
    color: #222;
    font-size: 14px;
    margin-bottom: 10px;
}

.blog-card p {
    color: #777;
    line-height: 1.5;
    font-size: 11px;
}

.blog-card .row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-card button {
    padding: 0;
    width: 30px;
    height: 30px;
}

.blog-card button img {
    width: 16px;
    height: 16px;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    place-items: center;
    overflow-y: auto;
}

.popup-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 800px;
    max-width: 90%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#delete-popup .popup-content {
    width: 400px;
}

.popup-content h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.popup-content .input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popup-content label {
    font-size: 14px;
    color: #333;
}

.popup-content input,
.popup-content textarea {
    padding: 10px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.popup-content textarea {
    resize: vertical;
    min-height: 120px;
}

.popup-content .close-btn {
    background-color: #f44336;
    color: white;
    font-size: 14px;
    padding: 6px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    align-self: flex-start;
    font-weight: 500;
}

.popup-content .close-btn:hover {
    background-color: #d32f2f;
}

.popup-content .row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: end;
}

.confirmation-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.table-container{
    overflow-y: auto;
    height: 100%;
    margin-top: 20px;
}

#users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#users-table .row{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#users-table th,
#users-table td {
    padding: 12px 15px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #ddd;
}

#users-table th {
    background-color: #f4f4f4;
    font-weight: bold;
    color: #333;
}

#users-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

#users-table tr:hover {
    background-color: #f1f1f1;
}

#blog-text-hidden,
#update-text-hidden{
    display: none;
}

@media (max-width: 1024px) {
    .top-bar {
        justify-content: center;
    }

    main {
        flex-direction: column;
    }

    aside {
        max-width: 100%;
        margin: 0 auto;
        width: 100%;
        height: auto;
        background-color: white;
    }

    aside .inner {
        max-width: 70%;
    }

    .main-section {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .popup-content {
        width: 100%;
        padding: 20px;
    }

    main {
        flex-direction: column;
    }

    .main-section {
        padding: 10px;
    }

    .blogs-grid {
        gap: 10px;
        padding-right: 10px;
    }

    .blog-card {
        flex: 1 0 100%;
        max-width: 45%;
        min-width: auto;
    }

    #users-table{
        width: auto;
        min-width: 100%;
    }
}

@media (max-width: 550px) {
    .blog-card {
        flex: 1 0 100%;
        max-width: 100%;
        min-width: auto;
    }
}

/* Chatbox ========================================================= */
.chat-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #06c;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.chat-icon svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 100%;
    max-width: 320px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 9999;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: #06c;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.chat-header div {
    font-size: 16px;
}

.chat-header span {
    font-size: 12px;
    font-weight: 500;
}

.chat-header button {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

.chat-body {
    height: 300px;
    padding: 10px;
    overflow-y: auto;
    background: #f4f4f4;
}

.msg-user,
.msg-admin {
    padding: 10px;
    margin: 10px 5px;
    border-radius: 10px;
    max-width: 70%;
    font-size: 14px;
    overflow-y: auto;
}

.msg-user {
    background: #06c;
    color: white;
    align-self: flex-end;
}

.msg-admin {
    background: #ddd;
    color: black;
    align-self: flex-start;
    margin-left: auto;
}

.chat-footer {
    display: flex;
    align-items: center;
    padding: 10px;
    border-top: 1px solid #ddd;
    background: white;
}

.chat-footer input {
    flex: 1;
    border: none;
    padding: 5px;
    resize: none;
    height: 40px;
    font-size: 14px;
    outline: none;
}

.chat-footer button {
    background: none;
    border: none;
    cursor: pointer;
}

.chat-footer svg {
    width: 24px;
    height: 24px;
    fill: #06c;
}

@media (max-width: 400px) {
    .chat-window {
        max-width: 90%;
    }
}

#open-chat-window{
    display: none;
}

/* Chatbox End ===================================================== */