body {
    font-family: Arial, sans-serif;
    margin: 10px 20px;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    background-color: #f9f7f4;
    animation: fadeIn 0.5s ease-in;
}
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}
 
header {
    background-color: #f1ede8;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0px auto 20px auto;
    box-sizing: border-box;
    position: sticky; /* Thêm để float header */
    top: 0; /* Cố định ở đầu trang */
    z-index: 1000; /* Đảm bảo header nằm trên nội dung khác */
}

/* Calendar */
.calendar {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 2px;
}
.calendar div {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.calendar .header_calendar {
    background-color: #f0f0f0;
    font-weight: bold;
    position: sticky;
    left: 0;
    z-index: 1;
    cursor: pointer;
}
.calendar .header_calendar:hover {
    background-color: #f0f0f03b;
    font-weight: bold;
    position: sticky;
    left: 0;
    z-index: 1;
    cursor: pointer;
}
.slot {
    cursor: pointer;
    background-color: #fff;
    transition: background-color 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
    touch-action: manipulation;
}
.slot.selected {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    filter: brightness(1.1);
}
.slot:active, .slot.active {
    transform: scale(1.2) rotate(5deg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    filter: brightness(1.2);
}
header h1 {
    margin: 0;
    font-size: 24px;
}
header h1 a {
    text-decoration: none;
    color: #333;
}
header h1 a:hover {
    color: #007bff;
}
header nav {
    display: flex;
    align-items: center;
}
header nav a, header nav span {
    margin-left: 15px;
    text-decoration: none;
    color: #007bff;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
}
header nav a:hover {
    color: #007bff;
}
header img.avatar{
    width:30px;
    height:30px;
}
.hamburger {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}
.nav-menu {
    display: flex;
    align-items: center;
}     


footer {
    background-color: #f8f9fa; /* Màu nền xám nhạt */
    color: #333;
    padding: 40px 20px;
    margin-top: 20px;
    font-family: Arial, sans-serif;
    border-top: 1px solid #ddd;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 3 cột trên desktop */
    gap: 30px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #007bff; /* Màu xanh đồng bộ với giao diện */
}

.footer-section p, .footer-section ul, .footer-section li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-section p {
    font-size: 14px;
    line-height: 1.6;
}

.footer-section a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #007bff; /* Hiệu ứng hover màu xanh */
}

.footer-section ul li {
    margin-bottom: 10px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    font-size: 20px;
    color: #666;
}

.social-links a:hover {
    color: #007bff;
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    font-size: 14px;
    color: #666;
}
.footer-logo {
    max-width: 120px;
    margin-bottom: 15px;
}
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #007bff;
    color: white;
    border: none;
    padding: 17px 20px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,1);
}

.scroll-to-top.visible {
    display: block;
}

.scroll-to-top:hover {
    background: #0056b3;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1001; /* Đảm bảo header nằm trên nội dung khác */
    box-shadow: 0 10px 15px rgba(0,0,0,1);


}
.modal.show {
    display: flex;
    opacity: 1;
}
.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    width: 400px;
    max-width: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.modal.show .modal-content {
    transform: scale(1);
}
.close {
    position: absolute;
    top: 10px;
    right: 15px; /* Tăng right để nằm sát mép phải */
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin: 20px 0px;
}
.tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    background-color: #f1f1f1;
}
.tab.active {
    background-color: #007bff;
    color: white;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}
.tab-content p {
    margin: 10px 0;
}
.tab-content input, .tab-content textarea {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}
.tab-content button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.tab-content button:hover {
    background-color: #0056b3;
}
.error {
    color: red;
    text-align: center;
}
.field-error {
    color: red;
    font-size: 0.9em;
    display: none;
}

h1, h2, h3 {
    color: #333;
}        

.logo {
    height: 70px; /* Khớp với font-size của h1 */
    width: auto; /* Giữ tỷ lệ ảnh */
    vertical-align: middle; /* Căn giữa với dòng */
}   
.form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.form-grid3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* Chia thành 3 cột */
    gap: 20px;
}
.user-list {
display: grid;
text-align: left;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 20px;
}

.user-card {
border: 1px solid #ddd;
padding: 15px;
text-align: left;
border-radius: 8px;
background: #fff;
box-shadow: 0 2px 5px rgba(0,0,0,0.4);
transition: transform 0.2s;


}

.user-card:hover {
transform: translateY(-5px);
}

.user-card img {
width: 100px;
height: 100px;
border-radius: 50%;
object-fit: cover;
border-top: 3px solid #ffffff;

margin-bottom: 10px;
}

.user-card h2 {
font-size: 1.2em;
margin: 10px 0;
}

.user-card p {
font-size: 0.9em;
color: #fff;
margin: 5px 0;
}

p.skill{
    border-top:#ddd 1px solid;
    padding-top:10px;
}
.user-card p.skill span{
    background-color: rgba(0, 0, 0, 0.13) !important;
    border-radius: 20px !important;
    padding: 5px 10px;
    margin: 3px;
    font-size: 12px;
    display: inline-block;
}    

.user-card a.button {
    background-color: rgb(255, 250, 3) !important;
    padding: 10px 15px;
    color:#007bff ;
    text-decoration: none;
    font-weight: bold;
    margin-top: auto !important;
    border-radius: 5px !important;
    display: inline-block;
  
    
}

.user-card a:hover {
    color:#00c4ff ;
}

.profile-section {
background: linear-gradient(135deg, #007bff, #00c4ff);
color: white;
padding: 20px;
border-radius: 10px;
text-align: center;
}
.profile-section img {
width: 150px;
height: 150px;
border-radius: 50%;
object-fit: cover;
border-left: 4px solid white;
border-right: 4px solid white;
}
.profile-section h1 {
font-size: 28px;
margin: 15px 0;
}
.profile-section p {
font-size: 16px;
margin: 5px 0;
}
.details-section {
background-color: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.details-section h2 {
font-size: 22px;
color: #333;
margin-bottom: 15px;
border-bottom: 2px solid #007bff;
padding-bottom: 5px;
}
.card-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 15px;
}
.card {
background-color: #f9f9f9;
padding: 15px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
transform: translateY(-5px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.card h3 {
font-size: 18px;
margin: 0 0 10px;
color: #007bff;
}
.card p {
font-size: 14px;
color: #666;
margin: 0;
}
.back-link {
display: block;
text-align: center;
margin: 20px 0;
color: #007bff;
text-decoration: none;
font-size: 16px;
}
.back-link:hover {
text-decoration: underline;
}

.profile-section p.masked:hover::after {
content: "Liên hệ để biết thêm";
position: absolute;
background: #333;
color: white;
padding: 5px;
border-radius: 3px;
}

/* Input Group for Floating Label */
.input-group {
position: relative;
margin-top:5px;
flex: 1 1 calc(50% - 10px); /* 50% trừ khoảng cách */
margin-bottom: 20px;
}
.input-group input,
.input-group textarea {
width: 100%;
padding: 5px;
font-size: 16px;
border: none;
border-bottom: 2px solid #ccc;
background: none;
outline: none;
box-sizing: border-box;
resize: none; /* Cho textarea */
}
.input-group textarea {
padding-top: 10px;
}
.input-group input[type="file"] {
    padding: 2px 3px 2px 3px;
}
.input-group label {
position: absolute;
top: 50%;
left: 5px;
font-size: 14px;
color: #666;
transform: translateY(-50%);
pointer-events: none;
transition: all 0.2s ease;
}
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label,
.input-group textarea:focus + label,
.input-group textarea:not(:placeholder-shown) + label {
top: -10px;
font-size: 12px;
color: #007bff;
}
.input-group input[type="file"]:focus + label,
.input-group input[type="file"]:not(:placeholder-shown) + label {
top: -14px; /* Điều chỉnh cho input file */
}

.custom-file-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.custom-file-btn:hover {
    background-color: #0056b3;
}

#fileName {
    font-size: 14px;
    color: #666;
}

.input-group input:focus,
.input-group textarea:focus {
border-bottom-color: #007bff;
}
.file-input {
position: relative;
}
.file-button {
position: absolute;
right: 5px;
top: 50%;
transform: translateY(-50%);
background: #007bff;
color: white;
padding: 5px 10px;
border-radius: 3px;
cursor: pointer;
}
.file-input input:focus + label + .file-button,
.file-input input:not(:placeholder-shown) + label + .file-button {
top: 15px;
}

/* CSS cho spinner */
#loading-spinner {
    position: fixed;
    display: flex;
    left:0;
    top:0;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);

}

.spinner {
    border: 10px solid rgba(0, 0, 0, 0.3);
    border-left-color: #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg);     border-left-color:rgb(219, 52, 213); }
    to { transform: rotate(360deg);     border-left-color:rgb(45, 162, 6); }
}


/* Ẩn caption mặc định (desktop) */
.caption {
    display: none;
    margin-left: 8px; /* Khoảng cách giữa icon và chữ */
}

.action-btn {
    position: relative;
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    margin:0px 5px;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease;
  }

  .action-btn:hover {
    transform: scale(1.1);
  }

  .action-btn i {
    font-size: 18px;
    color: #333;
  }

  .tooltip {
    position: absolute;
    top: -40px;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(10px);
  }

  .action-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* Màu sắc đặc trưng cho từng hành động */
  .register .tooltip {
    background-color: #28a745; /* Xanh lá cho Đăng ký */
  }

  .login .tooltip {
    background-color: #007bff; /* Xanh dương cho Đăng nhập */
  }

  .profile .tooltip {
    background-color: #6f42c1; /* Tím cho Hồ sơ */
  }

  .logout .tooltip {
    background-color: #dc3545; /* Đỏ cho Thoát ra */
  }

  /* Hình tam giác nhỏ dưới tooltip */
  .tooltip::after {
    content: '';
    position: absolute;
    bottom: -9px;
    color:#eee;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent;
    border-top-color: inherit;
  }

/* Hiển thị caption trên mobile (dưới 768px) */
@media screen and (max-width: 768px) {
    .form-grid3 {
        grid-template-columns: 1fr; /* Trên mobile vẫn là 1 cột */
        gap: 10px;
    }
    .tooltip {
        display: none; /* Ẩn tooltip trên mobile */
      }
      .action-btn {
        position:relative;
      }
      .action-btn::after {
        content: attr(data-caption); /* Lấy caption từ data-caption */
        position: absolute;
        bottom: -20px;
        font-size: 12px;
        color: #333;
        white-space: nowrap;
      }

    .caption {
        display: -ms-inline-grid;
        font-size: 14px; /* Kích thước chữ phù hợp mobile */
    }
    .logo {
    height: 50px; /* Khớp với font-size trên mobile */
}
.container {
    grid-template-columns: 1fr;
    padding: 10px;
}
.profile-section {
    padding: 15px;
}
.profile-section img {
    width: 120px;
    height: 120px;
}
.profile-section h1 {
    font-size: 24px;
}
.profile-section p {
    font-size: 14px;
}
.details-section {
    padding: 15px;
}
.details-section h2 {
    font-size: 20px;
}
.card-list {
    grid-template-columns: 1fr;
}
.card {
    padding: 10px;
}
.card h3 {
    font-size: 16px;
}
.card p {
    font-size: 12px;
}
header {
        padding: 10px;
}
header h1 {
    font-size: 20px;
}
.hamburger {
    display: block;
}
.nav-menu {
    display: none; /* Ẩn menu trên mobile */
    position: fixed;
    top: 0;
    right: 0;
    width: 250px;
    height: 100%;
    background-color: #f8f8f8;
    flex-direction: column;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    
}
.nav-menu.active {
    display: flex; /* Hiện menu khi active */
    transform: translateX(0);
}

/* Đảm bảo nav-menu hiển thị tốt trên mobile */
.nav-menu a {
    display: flex;
    align-items: left; /* Căn giữa icon và caption */
    padding: 10px; /* Tăng khoảng cách cho dễ chạm */
}

.nav-menu span {
    margin: 0px 10px;
    align-items: left; /* Căn giữa icon và caption */
    font-size: 18px;
    display: block;
}
.modal-content {
    width: 100%;
    margin: 0 10px;
    padding: 15px;
}
.close {
    font-size: 25px;
    top: 8px;
    color:#fff;
    right: 12px; /* Điều chỉnh cho mobile */
}
.tabs {
    margin-top: 20px;
}
.tab {
    padding: 8px;
    font-size: 14px;
}
.tab-content input, .tab-content textarea {
    padding: 6px;
    font-size: 14px;
}
.tab-content button {
    padding: 8px;
    font-size: 14px;
}

.input-group input,
.input-group textarea {
    font-size: 14px;
    padding: 8px 8px 8px 5px;
}
.input-group label {
    font-size: 14px;
}
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label,
.input-group textarea:focus + label,
.input-group textarea:not(:placeholder-shown) + label {
    font-size: 10px;
    top: -8px;
}
.input-group input[type="file"]:focus + label,
.input-group input[type="file"]:not(:placeholder-shown) + label {
    top: -12px;
}
.footer-container {
    grid-template-columns: 1fr; /* Xếp chồng trên mobile */
    text-align: center;
}

.social-links {
    justify-content: center;
}

.footer-section h3 {
    font-size: 16px;
}

.footer-section p, .footer-section a {
    font-size: 13px;
}
.footer-logo {
    margin: 0 auto 15px;
}

}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
