:root {
    --fb-blue: #1877f2;
    --fb-hover-blue: #166fe5;
    --fb-green: #42b72a;
    --fb-hover-green: #36a420;
    --fb-gray: #f0f2f5;
    --fb-text: #1c1e21;
    --fb-border: #dddfe2;
}

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

.site-header * {
    font-family: "Roboto", sans-serif !important;
}

.site-header i[class*="fa-"] {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
    font-style: normal !important;
}

input,
textarea {
    font-size: 16px;
}

body {
    background-color: #ffffff;
    overflow-y: auto;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.site-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 10px;
    position: relative;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-container a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.logo-container img {
    width: 25%;
    height: auto;
    border-radius: 15px;
}

.menu-toggle {
    background-color: rgba(255, 255, 255, 0.38);
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    color: var(--fb-blue);
    font-size: 30px;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s, transform 0.3s ease;
    user-select: none;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background-color: transparent;
}

.menu-resizer {
    position: absolute;
    right: 0; /* Changed to right for left menu */
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: ew-resize;
    background: transparent;
}

.menu-resizer:hover,
.menu-resizer.active {
    background: rgba(0, 0, 0, 0.1);
}

.sliding-menu {
    position: absolute;
    top: 100%;
    max-height: 0;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: max-height 0.5s ease-out;
    border-radius: 0 0 5px 5px;
    z-index: 10;
    width: 20%;
    min-width: 200px;
    max-width: 800px;
    margin-top: -10px;
}

.sliding-menu.active {
    max-height: 80vh;
    overflow-y: auto;
}

.sliding-menu ul {
    list-style: none;
}

.sliding-menu li {
    border-bottom: 1px solid var(--fb-border);
}

.sliding-menu li:last-child {
    border-bottom: none;
}

.sliding-menu a {
    display: block;
    padding: 10px 15px;
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
    color: var(--fb-text);
    background-color: var(--fb-gray);
    text-decoration: none;
    border-radius: 6px;
    margin: 5px 10px;
    text-align: center;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.sliding-menu a:hover {
    background-color: var(--fb-hover-blue);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#left-menu {
    left: 0; /* Moved to left */
    width: 300px;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--fb-border);
}

.menu-header h3,
.menu-header h4 {
    width: 100%;
    text-align: center;
    margin: 0;
    color: var(--fb-text);
    font-size: 20px;
    font-weight: bold;
}

.user-profile {
    padding: 20px;
    border-bottom: 1px solid var(--fb-border);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info h3 {
    margin: 0;
    font-size: 13px !important;
    color: var(--fb-text);
    font-weight: bold !important;
}

.user-info p {
    margin: 0;
    font-size: 10px !important;
    color: #65676b;
}

.profile-actions {
    display: flex;
    gap: 8px;
}

.manage-button,
.logout-button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.manage-button {
    background-color: var(--fb-gray);
    color: var(--fb-text);
}

.logout-button {
    background-color: #dc3545;
    color: white;
}

/* Notification */
.register-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    padding: 10px 20px;
    border: 1px solid #007bff;
    border-radius: 5px;
    z-index: 1000;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #007bff;
}

.register-notification.show {
    opacity: 1;
}

.register-notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background-color: currentColor;
    animation: progress 5s linear forwards;
}

.register-notification.info {
    border-color: #007bff;
    color: #007bff;
}

.register-notification.error {
    border-color: #dc3545;
    color: #dc3545;
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Back to Top */
.back-to-top-family {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #1877f2;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 99;
}

.back-to-top-family i {
    font-size: 15px;
}

.back-to-top-family.visible-family {
    opacity: 1;
    visibility: visible;
}

.back-to-top-family:hover {
    background: #0056b3;
    transform: translateY(-3px);
}

/* Hiệu ứng loading */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    font-size: 14px;
    color: var(--fb-blue);
}

.loading-spinner::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--fb-blue);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    padding: 10px 20px;
    border: 1px solid #007bff;
    border-radius: 5px;
    z-index: 1000;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #007bff;
}

.notification.show {
    opacity: 1;
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background-color: currentColor;
    animation: progress 5s linear forwards;
}

.notification .undo-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: background-color 0.3s ease;
}

.notification .undo-button:hover {
    background-color: #c82333;
}

.notification.info {
    border-color: #007bff;
    color: #007bff;
}

.notification.warning {
    border-color: #8e5f00;
    color: #8e5f00;
}

.notification.error {
    border-color: #dc3545;
    color: #dc3545;
}

@media (max-width: 768px) {
    .menu-toggle {
        margin: 5px 0;
    }

    .sliding-menu {
        width: 90% !important;
        min-width: auto;
        max-width: none;
    }

    .sliding-menu.active {
        max-height: 70vh;
    }

    .logo-container img {
        width: 60%;
    }

    .menu-resizer {
        display: none;
    }

    .register-modal-box {
        margin: 10% auto;
        padding: 15px;
    }

    .register-modal-input {
        font-size: 13px;
        padding: 8px;
    }

    .register-modal-submit {
        font-size: 13px;
        padding: 8px 16px;
    }
}
/* CSS for family stats in menu */
.stats-section {
    margin: 8px;
    padding: 12px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e4e6eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stats-section h4 {
    font-size: 13px;
    font-weight: 700;
    color: #1d1f23;
    margin: 0 0 12px;
    padding: 0 0 8px;
    border-bottom: 1px solid #e4e6eb;
    display: flex;
    align-items: center;
    letter-spacing: 0.3px;
}

.stats-section h4 i {
    margin-right: 8px;
    color: #1877f2;
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.stats-item {
    display: flex;
    align-items: center;
    padding: 8px 6px;
    font-size: 13px;
    color: #4b4f56;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    width: 100%;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.stats-item:last-child {
    margin-bottom: 0;
}

.stats-item:hover {
    background-color: #f5f6f8;
}

.stats-item .icon {
    font-size: 14px;
    margin-right: 10px;
    min-width: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    color: #495057;
}

.stats-item .label {
    font-weight: 500;
    color: #65676b;
    white-space: nowrap;
    margin-right: 8px;
}

.stats-item .value {
    font-weight: 600;
    color: #1d1f23;
    text-align: left;
    flex-grow: 1;
    padding-left: 8px;
}

/* Đặc biệt cho giới tính */
.gender-stats {
    display: flex;
    gap: 20px;
    margin-top: 4px;
}
.gender-male-label {
    color: #635163;
    margin-right: 5px;
}
.gender-female-label {
    color: #635163;
    margin-right: 5px;
}
.gender-group {
    display: flex;
    align-items: center;
}

.gender-icon {
    font-size: 13px;
    margin-right: 4px;
}

.gender-text {
    font-weight: 500;
    color: #65676b;
    margin-right: 4px;
}

.gender-number {
    font-weight: 600;
    color: #1d1f23;
}

/* Phần danh sách người cao tuổi */
.longevity-column {
    grid-column: 1 / -1;
    margin-top: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e9ecef;
}

.longesty-label {
    font-size: 11px;
    font-weight: 600;
    color: #65676b;
    text-align: center;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.longesty-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.longesty-list .person {
    font-size: 12px;
    background: white;
    padding: 6px 10px;
    border-radius: 4px;
    border-left: 3px solid #1877f2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.longesty-list .name {
    font-weight: 500;
    color: #1d1f23;
}

.longesty-list .age {
    font-weight: 600;
    color: #1877f2;
    background: #e7f3ff;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.decorative-element {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 16px;
    color: #bcc0c4;
    margin: 8px 0 0;
    padding-top: 8px;
    border-top: 1px solid #e4e6eb;
}

.decorative-element i {
    margin: 0 3px;
    transition: transform 0.3s ease;
}

.decorative-element i:hover {
    color: #1877f2;
    transform: scale(1.2);
}

/* Màu sắc cho các icon */
.stats-item .fa-mars { color: #1877f2; }
.stats-item .fa-venus { color: #ff6b6b; }
.stats-item .fa-users { color: #f7b801; }
.stats-item .fa-tint { color: #00b894; }
.stats-item .fa-user-plus { color: #6c5ce7; }
.stats-item .fa-crown { color: #fdcb6e; }
.stats-item .fa-hourglass-half { color: #a29bfe; }

@media (min-width: 1024px) {
    .sliding-menu {
        width: 300px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-item {
        padding: 6px 6px;
        font-size: 12px;
    }
    
    .stats-item .icon {
        font-size: 13px;
        width: 22px;
        height: 22px;
    }
    
    .stats-item .label {
        font-size: 11px;
    }
    
    .stats-item .value {
        font-size: 11px;
    }
    
    .longesty-label {
        font-size: 11px;
    }
    
    /* Điều chỉnh phần giới tính */
    .stats-item.gender-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .stats-item.gender-item .label {
        margin-bottom: 4px;
    }
    
    .gender-stats {
        width: 100%;
        align-items: center;
        margin-bottom: 5px;
    }
}

@media (max-width: 1023px) {
    .stats-section {
        margin: 6px 4px;
        padding: 10px;
    }

    .stats-section h4 {
        font-size: 14px !important;
        padding: 0 0 8px;
        margin-bottom: 10px;
    }

    .stats-item {
        padding: 8px 6px;
        font-size: 13px !important;
        margin-bottom: 6px;
    }

    .stats-item .icon {
        font-size: 14px !important;
        min-width: 14px;
        margin-right: 8px;
    }
    
    .longesty-label {
        font-size: 12px;
    }

    .longevity-list {
        padding: 6px;
    }
    .longevity-list .highlight {
        font-size: 18px !important;
    }
}

      /* Style cho phần chỉnh sửa trưởng tộc */
#clan-leader-edit {
    display: flex;
    flex-wrap: wrap; /* Cho phép các phần tử xuống dòng nếu cần */
    align-items: center;
    gap: 8px;
    margin-top: 8px; /* Thêm khoảng cách phía trên để tách biệt */
}

#clan-leader-input {
    width: 150px;
    padding: 4px 6px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

#clan-leader-ok, #clan-leader-cancel {
    padding: 4px 8px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 8px;
}

#clan-leader-ok {
    background: #007cba;
    color: white;
}

#clan-leader-ok:hover {
    background: #005a87;
}

#clan-leader-cancel {
    background: #d3d3d3;
    color: #333;
}

#clan-leader-cancel:hover {
    background: #b0b0b0;
}

/* Style cho thống kê thành viên */
.stats-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.stats-item i[class*="fa-"] {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
    font-style: normal !important;
}
.ui-autocomplete {
    max-height: 150px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.ui-autocomplete li {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.ui-autocomplete li.ui-state-focus {
    background: #f0f0f0;
    color: #007cba;
}
.login-btn {
  background-color: #1877f2; /* Màu Facebook */
  color: #fff;
  border: none;
  margin: 10px 20px;
  border-radius: 4px;
  padding: 10px 20px;
  font-size: 15px;
  cursor: pointer;
  font-weight: bold;
  width: 90%;
  text-align: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.login-btn:hover {
  background-color: #166fe5; /* Tông đậm hơn */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.login-btn:active {
  background-color: #145dbf; /* Tông đậm hơn khi click */
}

.login-btn:focus {
  outline: none;
}