/* Reset mặc định */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: #0d0d0d;
  color: #fff;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Thanh menu trượt */
.sidebar {
  position: fixed;
  top: 0;
  left: -260px;
  width: 240px;
  height: 100%;
  background: #111;
  transition: 0.4s;
  padding: 20px;
  z-index: 999;
  box-shadow: 2px 0 10px rgba(0,0,0,0.5);
}

.sidebar.active {
  left: 0;
}

.sidebar ul {
  list-style: none;
  margin-top: 50px;
}

.sidebar ul li {
  margin: 20px 0;
}

.sidebar ul li a {
  color: #ccc;
  text-decoration: none;
  font-size: 18px;
  transition: 0.3s;
}

.sidebar ul li a:hover {
  color: #00aaff;
}

.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.menu-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  background: #333; /* Màu nền dark */
  border: none;
  color: white; /* Màu chữ trắng */
  padding: 10px 15px;
  font-size: 22px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 1000;
  transition: background 0.3s, transform 0.1s; /* Thêm transition */
}

/* HIỆU ỨNG NÚT MENU MỚI */
.menu-btn:hover {
    background: #444; /* Màu tối hơn khi hover */
}
.menu-btn:active {
    transform: scale(0.95); /* Hiệu ứng nhấn */
}

/* Phần đầu */
.hero-section {
  text-align: center;
  padding: 120px 20px 80px;
  background: radial-gradient(circle at top, #111, #000);
}

.hero-section h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.hero-section p {
  color: #ccc;
  font-size: 1.1rem;
  margin-bottom: 30px; /* Thêm khoảng cách cho nút CTA */
}


/* ĐỊNH DẠNG NÚT CALL TO ACTION MỚI */
.cta-group {
    margin-top: 20px;
}

.cta-button {
    display: inline-block;
    background: #00aaff;
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.3s, transform 0.1s;
}

.cta-button:hover {
    background: #0099e6;
    transform: translateY(-2px);
}

/* API section và About Section */
.api-section, .about-section {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 60px 10%;
  gap: 30px;
  text-align: left;
}

.api-image {
  width: 100%;
  max-width: 300px;
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(0, 170, 255, 0.3);
}

.api-content {
  max-width: 500px;
  overflow-wrap: break-word; 
  word-wrap: break-word;
}

.api-content h2 {
  color: #00aaff;
  margin-bottom: 15px;
}

.api-content p {
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 10px;
}

code {
  display: block;
  background: #111;
  padding: 10px;
  border-radius: 6px;
  color: #00ffcc;
  font-family: monospace;
  overflow-wrap: break-word; 
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* Hiệu ứng reveal */
.reveal, .reveal-left, .reveal-right {
  opacity: 0;
  transform: translateY(50px);
  transition: 0.8s ease;
}

.reveal-left {
  transform: translateX(-100px);
}

.reveal-right {
  transform: translateX(100px);
}

.reveal.active, .reveal-left.active, .reveal-right.active {
  opacity: 1;
  transform: translate(0);
}

/* Responsive cho màn hình nhỏ */
@media (max-width: 768px) {
    .api-section {
        flex-direction: column;
        padding: 40px 5%;
        text-align: center;
    }

    .api-content {
        text-align: center;
        max-width: 90%;
    }
    
    .api-section:nth-child(3) { 
        flex-direction: column-reverse;
    }
}


/* Footer */
footer {
  text-align: center;
  padding: 30px;
  color: #888;
  border-top: 1px solid #222;
}
.sidebar ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  text-decoration: none;
  color: #fff;
}

.sidebar i {
  width: 20px;
  height: 20px;
}

#getkey.html
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #e2e8f0, #f5f6fa);
  display: flex;
  justify-content: center;
  padding-top: 50px;
  color: #1e293b;
}

.main {
  flex: 1;
  padding: 20px;
  max-width: 800px;
}

h1 {
  margin-top: 0;
  font-size: 28px;
  color: #0f172a;
  text-align: center;
}

p {
  color: #475569;
  text-align: center;
}

.key-box {
  background: #ffffff;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  width: 100%;
  transition: transform 0.3s ease;
}

.key-box:hover {
  transform: translateY(-3px);
}

button {
  position: relative;
  overflow: hidden;
  padding: 12px 24px;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  margin-bottom: 20px;
  transition: background 0.3s ease, transform 0.2s ease;
}

button:hover {
  background: linear-gradient(90deg, #1e40af, #2563eb);
  transform: translateY(-2px);
}

button:active::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  height: 120%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  animation: ripple 0.6s linear;
}

@keyframes ripple {
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

.key-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.key-item:hover {
  background: #f1f5f9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.key-item span {
  word-break: break-all;
  font-family: monospace;
  font-size: 14px;
  color: #1e293b;
}

.copy-btn {
  background: #10b981;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-btn:hover {
  background: #059669;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.7);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #ffffff;
  padding: 25px;
  border-radius: 14px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  background: #f8fafc;
  color: #1e293b;
}

/* Toast notification */
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  min-width: 250px;
  background: #1e293b;
  color: #fff;
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 2000;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}
/* Hiệu ứng mờ dần khi chuyển trang */
    body.fade-out {
      opacity: 0;
      transition: opacity 0.6s ease;
    }
    body.fade-in {
      opacity: 1;
      transition: opacity 0.6s ease;
    }

    footer {
      text-align: center;
      padding: 20px;
      color: #aaa;
      font-size: 14px;
    }

    .visit-counter {
      margin-top: 10px;
      color: #00aaff;
      font-weight: bold;
    }
    /* Bộ đếm lượt truy cập */
    .visit-counter {
      text-align: center;
      color: #fff;
      font-weight: bold;
      font-size: 20px;
      margin-top: 20px;
    }

    #visitCount {
      display: inline-block;
      font-size: 36px;
      color: #ffffff;
      font-weight: 900;
      perspective: 1000px;
      transform-style: preserve-3d;
      margin-top: 5px;
    }

    .roll {
      animation: rollDown 2s ease-in-out forwards;
    }

    @keyframes rollDown {
      0% { transform: rotateX(90deg); opacity: 0; }
      50% { transform: rotateX(0deg); opacity: 1; }
      100% { transform: rotateX(0); }
    }

    footer {
      text-align: center;
      padding: 20px;
      color: #aaa;
      font-size: 14px;
    }
    /* Thêm hoặc cập nhật trong file style.css hiện có */

/* Cài đặt trang Setting */
body.fade-in {
    opacity: 1;
    transition: opacity 0.6s ease;
}

.settings-container {
    background: #1e1e1e;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 500px;
    text-align: center;
    margin: 50px auto; /* Canh giữa và tạo khoảng cách trên dưới */
    color: #fff;
}

.settings-container h1 {
    font-size: 2.2rem;
    margin-bottom: 25px;
    color: #00aaff;
}

.profile-card {
    background: #282828;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Khu vực Avatar và nút chỉnh sửa */
.avatar-upload-area {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 20px; /* Thêm khoảng cách dưới avatar */
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #00aaff;
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.6);
}

.edit-avatar-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #00aaff;
    color: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.edit-avatar-btn:hover {
    background: #0099e6;
}

.edit-avatar-btn i {
    width: 18px;
    height: 18px;
}

.profile-info {
    text-align: left;
    width: 100%;
    max-width: 300px; /* Giới hạn chiều rộng thông tin */
}

.profile-info p {
    font-size: 1.1rem;
    margin: 12px 0; /* Khoảng cách giữa các dòng thông tin */
    color: #ccc;
    display: flex; /* Dùng flex để căn chỉnh */
    align-items: center;
    justify-content: space-between; /* Đẩy mạnh tên và giá trị sang 2 bên */
}

.profile-info strong {
    color: #fff;
    flex-shrink: 0; /* Không co lại */
    margin-right: 10px; /* Khoảng cách giữa nhãn và giá trị */
}

.profile-info span {
    word-break: break-all; /* Ngắt chữ dài */
    text-align: right;
    flex-grow: 1; /* Cho phép giá trị chiếm hết không gian còn lại */
}

.settings-actions {
    display: flex;
    flex-wrap: wrap; /* Cho phép xuống dòng trên màn hình nhỏ */
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* Các nút chung */
.btn-primary, .btn-secondary {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    display: flex; /* Để căn chỉnh icon */
    align-items: center;
    gap: 8px; /* Khoảng cách giữa icon và text */
}

.btn-primary {
    background: #00aaff;
    color: #fff;
}

.btn-primary:hover {
    background: #0099e6;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #444;
    color: #fff;
}

.btn-secondary:hover {
    background: #555;
    transform: translateY(-2px);
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #282828;
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: fadeInModal 0.3s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-content h2 {
    color: #00aaff;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.modal-content label {
    display: block;
    text-align: left;
    margin-bottom: 8px;
    color: #ccc;
    font-weight: 500;
}

.modal-content input[type="text"] {
    width: calc(100% - 20px); /* Kích thước trừ padding */
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #333;
    color: #fff;
    font-size: 1rem;
    outline: none;
}

.modal-content input[type="text"]:focus {
    border-color: #00aaff;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 600px) {
    .settings-container {
        padding: 25px;
        margin: 20px auto;
    }

    .settings-container h1 {
        font-size: 1.8rem;
    }

    .profile-card {
        padding: 20px;
        gap: 15px;
    }

    .avatar-upload-area {
        width: 100px;
        height: 100px;
    }

    .edit-avatar-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .profile-info p {
        font-size: 1rem;
    }

    .settings-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        padding: 10px 15px;
    }
}
 /* Thêm vào file style.css của bạn */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
}
.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
/* === CSS CHO TRANG SOCIAL.HTML === */

.post-card { 
    background: #fff; 
    border-radius: 8px; 
    padding: 20px; 
    margin-bottom: 20px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    color: #333; /* Thêm màu chữ để dễ đọc trên nền trắng */
}

.post-header { 
    display: flex; 
    align-items: center; 
    margin-bottom: 15px; 
}

.post-header img { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    margin-right: 15px; 
}

.post-actions { 
    display: flex; 
    gap: 20px; 
    margin-top: 15px; 
    border-top: 1px solid #eee; 
    padding-top: 10px; 
}

.action-btn { 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    color: #555; /* Thêm màu mặc định cho icon */
}

.action-btn:hover {
    color: #007bff; /* Thêm hiệu ứng hover */
}

.action-btn.liked { 
    color: #007bff; 
}

#post-form textarea,
#comment-text {
    width: 100%; 
    padding: 10px; 
    border-radius: 5px; 
    border: 1px solid #ccc; 
    margin-bottom: 10px;
    box-sizing: border-box; /* Thêm để padding không làm vỡ layout */
}

/* CSS cho phần đăng bài nâng cao */
#post-form .upload-options { 
    display: flex; 
    gap: 15px; 
    margin-bottom: 10px; 
}

#post-form .upload-options .option-btn { 
    cursor: pointer; 
    color: #555; 
}

#post-form .upload-options .option-btn:hover {
    color: #000;
}

#post-form #file-preview { 
    margin-top: 10px; 
    text-align: left; /* Căn lề trái cho preview */
}

#post-form #file-preview img { 
    max-width: 100px; 
    max-height: 100px; 
    border-radius: 5px; 
}

#post-form #file-preview video { 
    max-width: 200px; 
    max-height: 150px; 
    border-radius: 5px; 
}

/* CSS cho phần nội dung bài đăng */
.post-content img, .post-content video { 
    max-width: 100%; 
    border-radius: 8px; 
    margin-top: 10px; 
}

.post-content .file-attachment a { 
    text-decoration: none; 
    background: #f0f2f5; 
    padding: 10px; 
    border-radius: 6px; 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    color: #111; 
    margin-top: 10px;
    transition: background-color 0.3s;
}

.post-content .file-attachment a:hover {
    background-color: #e4e6eb;
}

/* CSS cho bình luận */
.comment {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    text-align: left; /* Căn lề trái cho text */
}

.comment img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}
/* CSS cho Loading Spinner */
.loader {
  border: 4px solid #f3f3f3; /* Light grey */
  border-top: 4px solid #3498db; /* Blue */
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 10px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* Thêm vào cuối file style.css của bạn */

/* === CSS CHO TÍNH NĂNG MỚI (CHỈNH SỬA/XÓA) === */

/* Cập nhật post-header để chứa menu tùy chọn */
.post-header { 
    display: flex; 
    justify-content: space-between; /* Đẩy author info và options ra 2 bên */
    align-items: center; 
    margin-bottom: 15px; 
}

.author-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Kiểu cho menu tùy chọn (3 chấm) */
.post-options {
    position: relative;
}

.post-options > i {
    cursor: pointer;
    color: #555;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.post-options > i:hover {
    background-color: #f0f0f0;
}

/* Menu con xổ xuống (Chỉnh sửa, Xóa) */
.options-menu {
    display: none; /* Mặc định ẩn */
    position: absolute;
    right: 0;
    top: 35px; /* Vị trí bên dưới icon 3 chấm */
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
    overflow: hidden; /* Bo góc các item bên trong */
    width: 160px;
    border: 1px solid #eee;
}

.options-menu.active {
    display: block; /* Hiển thị khi active */
}

.options-menu a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.options-menu a:hover {
    background-color: #f5f5f5;
}

/* Textarea trong modal chỉnh sửa */
#edit-post-content {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-bottom: 15px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical; /* Cho phép kéo dãn theo chiều dọc */
    min-height: 120px;
}

    