/* Background */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #fff;
  overflow-x: hidden;
}
#bg {
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  z-index:-1;
}

/* Card */
.card {
  background: rgba(255,255,255,0.15);
  padding: 20px;
  border-radius: 16px;
  margin: 20px auto;
  max-width: 650px;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
}
.card:hover { transform: translateY(-2px); }

/* Input */
input[type="text"], input[type="password"], textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  margin: 8px 0;
  font-size: 14px;
  outline: none;
}
textarea { min-height: 100px; }

/* Button */
.btn {
  background: #1E90FF;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}
.btn:hover { background:#187bcd; }
.btn-del {
  background:#e74c3c;
  color:#fff;
  border:none;
  padding:6px 10px;
  border-radius:6px;
  cursor:pointer;
}
.btn-del:hover { background:#c0392b; }

/* Post list */
.post-card {
  display:flex;
  align-items:flex-start;
  background: rgba(255,255,255,0.1);
  padding: 12px;
  border-radius: 10px;
  margin: 10px 0;
  cursor:pointer;
}
.post-card:hover { background: rgba(255,255,255,0.2); }
.thumb {
  width: 100px;
  height: 70px;
  object-fit: cover;
  margin-right: 12px;
  border-radius: 8px;
}
.post-card h3 {
  margin: 0;
  font-size: 18px;
  color: #fff;
}
.post-card p.date {
  font-size: 12px;
  color: #ccc;
  margin: 2px 0 5px;
}

/* Modal */
#post-modal {
  display:none;
  position:fixed;
  top:0; left:0;
  width:100%; height:100%;
  background:rgba(0,0,0,0.6);
  align-items:center;
  justify-content:center;
  z-index:1000;
}
.modal-box {
  background:#fff;
  color:#000;
  padding:20px;
  border-radius:12px;
  max-width:700px;
  width:90%;
  max-height:80vh;
  overflow-y:auto;
  position:relative;
}
.close-btn {
  position:absolute;
  top:10px; right:15px;
  font-size:20px;
  cursor:pointer;
  color:#333;
}
.close-btn:hover { color:#e74c3c; }
#modal-date { font-size:13px; color:#555; font-style:italic; }

/* Thêm style cho hiệu ứng chữ */
.typewriter {
  font-size: 16px;
  font-style: italic;
  color: hsl(0, 0%, 100%);
  margin: 10px 0;
  min-height: 20px;
  white-space: nowrap;
  overflow: hidden;
}

#admin-posts li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

#admin-posts li:last-child {
  border-bottom: none;
}

#admin-posts li div {
  display: flex;
}

/* Style cho form mới */
#current-image {
  background: rgba(255,255,255,0.1);
  padding: 10px;
  border-radius: 8px;
  margin: 10px 0;
}

#current-image p {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #ccc;
}

#cancel-edit {
  background: #6c757d;
}

#cancel-edit:hover {
  background: #5a6268;
}

/* Thêm vào cuối file style.css */
.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.social-link i {
  font-size: 18px;
}

/* Facebook màu xanh */
.social-link:nth-child(1):hover {
  background: rgba(59, 89, 152, 0.3);
}

/* YouTube màu đỏ */
.social-link:nth-child(2):hover {
  background: rgba(255, 0, 0, 0.3);
}

/* Trang thống kê truy cập */

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.stat-card {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 10px;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-size: 20px;
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
}

.stat-label {
  font-size: 14px;
  color: #ccc;
}

/* Stats Lists */
.stats-list {
  max-height: 300px;
  overflow-y: auto;
}

.stats-list div {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-list div:last-child {
  border-bottom: none;
}

/* Visits List */
.visits-list {
  max-height: 400px;
  overflow-y: auto;
}

.visit-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
  border-radius: 8px;
}

.visit-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.visit-info {
  flex: 1;
}

.visit-ip {
  font-weight: bold;
  margin-bottom: 5px;
}


/* Responsive */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .stat-card {
    flex-direction: column;
    text-align: center;
  }
  
  .stat-icon {
    margin-right: 0;
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Thêm vào cuối file style.css */

/* Animation cho loading */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Nút active state */
.btn.active {
  background: #187bcd;
  box-shadow: 0 0 10px rgba(30, 144, 255, 0.5);
}

/* Responsive cho trang thống kê */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .stat-card {
    flex-direction: column;
    text-align: center;
  }
  
  .stat-icon {
    margin-right: 0;
    margin-bottom: 10px;
  }
  

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .visit-item {
    flex-direction: column;
  }
}

.visit-details {
  font-size: 12px;
  color: #ccc;
  display: flex;
  flex-wrap: wrap; /* Cho phép các phần tử xuống dòng nếu cần */
  gap: 10px;
  align-items: center; /* Căn giữa các items theo chiều dọc */
}

.visit-details span {
  display: flex;
  align-items: center; /* Căn giữa icon và text trong span */
  gap: 4px; /* Tạo khoảng cách giữa icon và text */
  white-space: nowrap; /* Ngăn text trong mỗi span bị ngắt dòng */
}

/* Đảm bảo hiển thị emoji flag trên mọi thiết bị */
.visit-details span, .visit-ip {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", sans-serif !important;
}