* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #005792;
    --secondary-color: #00bbf0;
    --accent-color: #fdb44b;
    --dark-color: #333;
    --light-color: #f4f9ff;
    --text-color: #444;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body {
    background-color: #f0f5ff;
    color: var(--text-color);
    position: relative;
}

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 0rem 1.3rem;  
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    position: fixed;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 40px;
}

.logo a {
  color: white;            
  text-decoration: none;  
}

.logo a:visited {
  color: white;           
}

.logo a:hover {
  color: #e0e0e0;       
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100%;
    width: 280px;
    background-color: white;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
    transition: left 0.3s ease;
    z-index: 990;
    box-shadow: var(--shadow);
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    color: var(--primary-color);
    font-size: 24px;
    margin: 15px 0;
    text-align: center;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
}

.sidebar a {
    color: var(--dark-color);
    text-decoration: none;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.sidebar a:hover, .sidebar a.active {
    background-color: rgba(0, 87, 146, 0.1);
    border-left: 4px solid var(--primary-color);
    color: var(--primary-color);
}

.sidebar a i {
    width: 24px;
    text-align: center;
}

.toggle-btn {
    background-color: transparent;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 10px;
    margin-right: 10px;
}

.main-content {
    padding: 90px 20px 40px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}
 
@media (min-width: 993px) {
    .sidebar.active ~ .main-content {
        margin-left: 280px;
    }
}

h1 {
    text-align: center;
    color: #005792;
    margin: 20px 0;
    font-size: 2rem;
}
.header, .logo h1{
    color: white;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}
 
.chairman {
    margin-bottom: 30px;
}
 
.officials-wrapper {
    display: flex;
    justify-content: space-between; 
    align-items: flex-start;
    width: 100%;
    flex-wrap: wrap;
    gap: 40px;
}
 
.kagawads {
    flex: 1;
    max-width: 550px;
    background: #ffffff; 
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.sk-personnel {
    flex: 1;
    max-width: 550px; 
    background: #ffffff; 
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.kagawads h2, .sk-personnel h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}
 
.kagawad-row, .sk-row {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 15px;
}

 
.official {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 200px;
    text-align: center;
    transition: transform 0.3s;
}

.official img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
}
 
.official:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.name {
    font-weight: 600;
    color: var(--dark-color);
    margin: 10px 0 5px;
}

.title {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.chat-head {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1002; /* Higher than the chat box */
}

.chat-head:hover {
    transform: scale(1.05);
}

.chat-head::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 15px;
    height: 15px;
    background-color: #4CAF50;
    border-radius: 50%;
    border: 2px solid white;
}

.chat-head-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 450px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1001; /* Make sure it's above other elements */
}

.chat-box.active {
    transform: scale(1);
    opacity: 1;
}

.chat-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-weight: 600;
    font-size: 16px;
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    line-height: 1.5;
    font-size: 14px;
}

.message.user {
    align-self: flex-end;
    background-color: var(--secondary-color);
    color: white;
    border-bottom-right-radius: 5px;
}

.message.bot {
    align-self: flex-start;
    background-color: #f1f1f1;
    color: var(--dark-color);
    border-bottom-left-radius: 5px;
}

.message-content {
    margin-bottom: 5px;
}

.message-time {
    font-size: 10px;
    opacity: 0.7;
    text-align: right;
}

.chat-input-container {
    padding: 15px;
    display: flex;
    gap: 10px;
    background-color: #f8f8f8;
    border-top: 1px solid #eee;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    transition: border 0.3s;
}

.chat-input:focus {
    border-color: var(--secondary-color);
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.send-btn:hover {
    background-color: var(--secondary-color);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: messageAppear 0.3s ease;
}

@media (max-width: 992px) {
    .sidebar.active ~ .main-content {
        margin-left: 0;
    }
    
    .sidebar.active {
        left: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.8rem 1rem;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .officials-wrapper {
        flex-direction: column;
    }

    .kagawads, .sk-personnel {
        width: 90%;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 70px 15px 30px;
    }
    
    .kagawad-row, .sk-row {
        flex-direction: column;
    }
    
    .chat-box {
        width: calc(100vw - 60px);
        right: 0;
        bottom: 80px;
        height: 400px;
    }
    
    .chat-head {
        width: 50px;
        height: 50px;
    }
}
