html {
    overflow-y: scroll;
}


body {
   font-family: Arial, sans-serif;
   margin: 0;
   padding: 0;
   background-color: #f4f4f4;
   color: #333;
   display: flex;
   flex-direction: column;
   min-height: 100vh;
}

.container {
   width: 80%;
   margin: 0 auto;
}

.site-header {
   background: #ecf0f1;
   padding: 20px 0;
   position: fixed;
   width: 100%;
   top: 0;
   z-index: 1000;
}

.header-container {
    display: flex;
    align-items: center;
    position: relative;
 justify-content: space-between;
    gap: 20px;
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo img {
   max-height: 50px;
}

.login-button {
margin-left: auto;

}

.profile-avatar {
    text-align: center;
    margin-bottom: 20px;
}

.profile-avatar img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.profile-avatar-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.avatar-form {
    margin-bottom: 20px;
}


.profile-form-container {
    margin-top: 30px;
}

.password-section {
    text-align: center;
    margin-bottom: 20px;
}

.logout-section {
    text-align: center;
    margin-top: 20px;
}

.logout-button {
    background: #e74c3c;
}

.login-button a {
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.login-button a:not(.user-profile) {
    background: #27ae60;
    padding: 10px 20px;
    border-radius: 5px;
}

.login-button a:not(.user-profile):hover {
    background: #219a52;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}


.hamburger-menu {
    flex: 1;
    display: flex;
    justify-content: flex-end;
order: -1;
}

.menu-button {
   background: none;
   border: none;
   cursor: pointer;
   padding: 10px;
   width: 40px;
   height: 40px;
   display: flex;
   align-items: center;
   justify-content: center;
}

.menu-icon {
   display: block;
   width: 25px;
   height: 3px;
   background: #333;
   position: relative;
   transition: background 0.3s ease;
}

.menu-icon::before,
.menu-icon::after {
   content: '';
   position: absolute;
   width: 100%;
   height: 3px;
   background: #333;
   transition: transform 0.3s ease;
}

.menu-icon::before {
   top: -8px;
}

.menu-icon::after {
   bottom: -8px;
}



.dropdown-menu {
   display: none;
   position: absolute;
   right: 0;
   top: 30px;
   right: -20px;
   background: #ecf0f1;
   box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
   border-radius: 10px;
   min-width: 300px;
   z-index: 1000;
   overflow: hidden;
}

.dropdown-menu ul {
   list-style: none;
   padding: 10px 0;
   margin: 0;
}
.dropdown-menu ul li {
   padding: 0;
   margin: 0;
}
.dropdown-menu ul li a {
   display: block;
   padding: 18px 25px;
   color: #333;
   text-decoration: none;
   transition: background 0.3s ease, color 0.3s ease;
   font-size: 16px;
}
.dropdown-menu ul li a:hover {
   background: #d5dbdb;
   color: #2c3e50;
}



.hamburger-menu:hover .dropdown-menu,
.hamburger-menu.active .dropdown-menu {
   display: block;
}

.hamburger-menu:hover .menu-icon,
.hamburger-menu.active .menu-icon {
   background: transparent;
}

.hamburger-menu:hover .menu-icon::before,
.hamburger-menu.active .menu-icon::before {
   transform: translateY(8px) rotate(45deg);
}

.hamburger-menu:hover .menu-icon::after,
.hamburger-menu.active .menu-icon::after {
   transform: translateY(-8px) rotate(-45deg);
}

.hero-banner {
   background: url('../img/hero.jpg') center/cover no-repeat;
   text-align: center;
   padding: 100px 0;
   color: #fff;
   margin-top: 90px;
}

.hero-banner h1 {
   font-size: 4.5em;
   color: #fff;
   text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.site-footer {
   background: #34495e;
   padding: 20px 0;
   text-align: center;
   color: #fff;
   margin-top: auto;
}

.site-footer a {
   color: #f1c40f;
   text-decoration: none;
}

.section-content {
   margin-top: 20px;
}

.section-content .container {
   display: flex;
   justify-content: center;
   gap: 30px;
}

.content-block {
   display: block;
   text-decoration: none;
   color: inherit;
   width: 300px;
   background: #fff;
   box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
   text-align: center;
   border-radius: 5px;
   overflow: hidden;
   transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.content-text span {
   display: block;
   padding: 10px;
   font-weight: bold;
   text-decoration: none;
}

.content-description {
    text-align: center;
    margin: 30px 0;
    color: #333;
    font-weight: bold;
    font-family: Arial, sans-serif;
    font-size: 1.1em;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.content-image {
   width: 100%;
   height: 200px;
   overflow: hidden;
}

.content-block:hover {
   box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.2);
   transform: translateY(-5px);
}

.content-block img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   border-bottom: 2px solid #f4f4f4;
}

.content-block h3 {
   font-size: 1.2em;
   color: #333;
   margin: 10px 0;
   padding: 0 10px;
}

.content-text a {
   text-decoration: none;
   color: #333;
   font-weight: bold;
   display: block;
   padding: 10px;
}

.about-section {
    padding-top: 100px;
    padding-bottom: 40px;
}

.about-section h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
}

.about-intro, .about-target {
    margin-bottom: 40px;
}

.about-intro p, .about-target p {
    font-size: 1.2em;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.about-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin: 20px 0;
}

.features {
    margin: 40px 0;
}

.features h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 30px 0;
}

.feature-item {
    text-align: center;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    text-decoration: none;
    display: block;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
}

.feature-item h3 {
    color: #333;
    font-size: 1.2em;
    margin: 10px 0;
}

.join-us {
    text-align: center;
    margin: 40px 0;
    padding: 30px;
    background: #f4f4f4;
    border-radius: 10px;
}

.join-us p {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
}

.auth-container {
    padding: 100px 0 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-form {
    background: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-form h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

.submit-button {
    width: 100%;
    padding: 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-button:hover {
    background: #219a52;
}

.auth-links {
    text-align: center;
    margin-top: 15px;
}

.auth-links a {
    color: #27ae60;
    text-decoration: none;
    font-weight: bold;
}

.auth-links a:hover {
    text-decoration: underline;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

.greeting-container {
    position: absolute;
    top: 10%;
    left: 25%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
     box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: bold;
    text-align: center;
    opacity: 0;
    transition: opacity 2.5s ease;
}

.greeting-container.show {
    opacity: 1;
}

    .action-button {
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.3s ease;
        border: none;
        color: white;
        text-decoration: none;
    }
    .add-button {
        background: linear-gradient(45deg, #2ecc71, #27ae60);
    }
    .action-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }

.user-profile {
    display: block;
    position: relative;
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
}

.user-profile:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.1));
}

.avatar-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #27ae60;
    transition: border-color 0.3s ease;
}
.user-profile:hover .avatar-img {
    border-color: #219a52;
}


.role-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
}


.topic-item:hover {
    background-color: #f5f5f5;
}

.topic-info {
    flex-grow: 1;
    margin-right: 15px;
}

.topic-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.topic-meta {
    color: #666;
    display: flex;
    gap: 15px;
}

.topic-meta span {
    white-space: nowrap;
}

.topic-replies {
    padding: 5px 15px;
    background: #e8e8e8;
    border-radius: 15px;
    white-space: nowrap;
}

.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

.pagination a {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: inherit;
    min-width: 35px;
    text-align: center;
}

.pagination a.active {
    background: #27ae60;
    color: white;
    border-color: #27ae60;
}

#newTopicForm {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

#newTopicForm input[type="text"],
#newTopicForm textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
}

#newTopicForm textarea {
    min-height: 100px;
    resize: vertical;
}

.new-topic-button {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    cursor: pointer;
}

.modal-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90vh;
}

.avatar-wrap {
    position: relative;
    width: 40px;
    height: 40px;
}

.message-image {
    max-width: 200px;
    cursor: pointer;
    border-radius: 5px;
}

.admin-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
}

.message-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.message-actions .action-button {
    background: #3498db;
}

.message-actions .action-button:last-child {
    background: #e74c3c;
}

@media screen and (max-width: 768px) {
   .header-container {
       display: flex;
       align-items: center;
       justify-content: space-between;
       padding: 10px;
   }

.user-profile {
    width: 35px;
    height: 35px;
}

    .admin-badge {
        width: 14px;
        height: 14px;
    }

.avatar-img {
    width: 30px;
    height: 30px;
}

.user-button {
    padding: 5px 10px;
    font-size: 14px;
}

.role-badge {
    width: 14px;
    height: 14px;
}
   .logo {
       order: 1;
       margin: 0 auto;
   }

   .logo img {
       max-height: 40px;
       width: auto;
   }

   .hamburger-menu {
       order: 2;
       margin-left: 10px;
   }

   .section-content .container {
       flex-direction: column;
       align-items: center;
   }

   .content-block {
       width: 100%;
       max-width: 300px;
       margin-bottom: 20px;
   }

   .content-image {
       height: 250px;
   }

   .section-content .container > .container {
       display: flex;
       flex-direction: column;
       align-items: center;
       gap: 20px;
   }

   .hero-banner h1 {
       font-size: 2.5em;
   }

    .features-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .feature-item {
        width: 100%;
        max-width: 300px;
    }

    .greeting-container {
        top: 100%;
        left: 50%;
        border-radius:5px;
        background: linear-gradient(135deg, #27ae60, #2ecc71);
    }


.greeting-container.show {
    opacity: 1;

}

   .login-button {
       order: 0;
       margin-right: 20px; 
       transform: translateX(-10px); 
}

   .login-button a:not(.user-profile) {
       padding: 6px 12px; 
       font-size: 14px; 
}

    .admin-table {
        width: 100%;
        table-layout: fixed;
        font-size: 12px;
    }
    .admin-table td, .admin-table th {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .admin-table th:nth-child(1), .admin-table td:nth-child(1),
    .admin-table th:nth-child(4), .admin-table td:nth-child(4),
    .admin-table th:nth-child(5), .admin-table td:nth-child(5) {
        display: none;
    }

    .topic-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .topic-info {
        margin-right: 0;
        width: 100%;
    }

    .topic-meta {
        flex-direction: column;
        gap: 5px;
        font-size: 0.9em;
    }

    .topic-replies {
        align-self: flex-end;
        font-size: 0.9em;
    }

    .pagination a {
        padding: 6px 10px;
        min-width: 30px;
        font-size: 0.9em;
    }

    #newTopicForm {
        padding: 10px;
    }

    .new-topic-button {
        padding: 6px 12px;
        font-size: 13px;
    }

    .modal-image {
        max-width: 95%;
        max-height: 80vh;
    }
}
