/* style.css */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background-color: #f5f6fa;
  color: #333;
}

header {
  background-color: #0a3d62;
  color: white;
  padding: 10px 0;
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.navbar .logo {
  font-weight: bold;
  font-size: 20px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-links li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

.search-box input {
  padding: 6px;
  border-radius: 5px;
  border: none;
  width: 200px;
}

.section-title {
  text-align: center;
  padding: 30px 20px;
}

.post-card {
  background-color: white;
  padding: 15px;
  margin: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  width: 300px;
  display: inline-block;
  vertical-align: top;
}

.post-card img {
  width: 100%;
  border-radius: 10px;
}

.post-card h3 {
  margin-top: 10px;
  font-size: 18px;
}

.post-card .summary {
  font-size: 14px;
  color: #555;
}

.meta {
  font-size: 13px;
  color: gray;
  margin-top: 10px;
}

.btn {
  display: inline-block;
  margin-top: 10px;
  background-color: #0a3d62;
  color: white;
  padding: 8px 16px;
  border-radius: 5px;
  text-decoration: none;
}

.label-hot {
  background-color: orange;
  color: white;
  padding: 3px 6px;
  font-size: 12px;
  border-radius: 5px;
  position: absolute;
  margin-top: -10px;
  margin-left: -10px;
}

footer {
  background-color: #0a3d62;
  color: white;
  text-align: center;
  padding: 10px 0;
  margin-top: 40px;
}

.detail-container {
  max-width: 800px;
  margin: 20px auto;
  padding: 0 20px;
}

.breadcrumb {
  margin-bottom: 20px;
  font-size: 14px;
}

.breadcrumb a {
  color: #0a3d62;
  text-decoration: none;
}

.post-header {
  margin-bottom: 30px;
}

.category-tag {
  background: #0a3d62;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 10px;
}

.post-header h1 {
  font-size: 2.2em;
  margin: 15px 0 10px 0;
  line-height: 1.3;
}

.post-subtitle {
  font-size: 1.1em;
  color: #666;
  margin-bottom: 20px;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.author-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.author-details strong {
  display: block;
}

.post-date {
  color: #888;
  font-size: 14px;
}

.share-btn {
  margin-left: auto;
  background: #0a3d62;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
}

.post-image {
  text-align: center;
  margin: 30px 0;
}

.post-image img {
  width: 100%;
  max-width: 400px;
  border-radius: 10px;
}

.image-caption {
  font-size: 14px;
  color: #666;
  margin-top: 10px;
}

.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  margin: 20px 0;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
}

.post-content {
  line-height: 1.8;
  font-size: 16px;
}

.post-content h2 {
  color: #0a3d62;
  margin: 30px 0 15px 0;
  font-size: 1.5em;
}

.post-content ul {
  margin: 15px 0;
  padding-left: 20px;
}

.rating {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin: 30px 0;
}

.rating-item {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
}

.stars {
  color: #ffd700;
  font-size: 18px;
}

.buy-section {
  background: #e8f4fd;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  margin: 30px 0;
}

.buy-btn {
  display: inline-block;
  margin: 10px;
  background: #28a745;
  color: white;
  padding: 12px 24px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
}

.related-posts {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 2px solid #eee;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.related-item {
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.related-item img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 10px;
}

.related-item h4 {
  font-size: 16px;
  margin: 0;
}
/* Admin styles mở rộng */
.admin-container {
  padding: 30px;
  max-width: 1000px;
  margin: auto;
}

.stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  flex: 1;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-actions {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.admin-stats h4 {
  margin-bottom: 20px;
  color: #333;
}

.admin-only {
  background: #28a745 !important;
}

.admin-only:hover {
  background: #218838 !important;
}

/* Role Badge */
.role-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.role-badge.admin {
  background: #dc3545;
  color: white;
}

.role-badge.editor {
  background: #ffc107;
  color: #212529;
}

.role-badge.viewer {
  background: #6c757d;
  color: white;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  border: 1px solid #ddd;
  padding: 10px;
}

.admin-table th {
  background: #0a3d62;
  color: white;
}

.form-post input, .form-post textarea, .form-post select {
  width: 100%;
  padding: 10px;
  margin: 10px 0 20px;
}

.category-list li {
  background: white;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 6px;
}

.danger {
  background-color: crimson;
  color: white;
  border: none;
  padding: 5px 10px;
}

.hero {
  background: linear-gradient(135deg, #0a3d62, #3c6382);
  color: white;
  text-align: center;
  padding: 60px 20px;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 3em;
  margin-bottom: 10px;
}

.hero p {
  font-size: 1.2em;
  opacity: 0.9;
}

.category-filter {
  text-align: center;
  margin: 20px 0;
}

.filter-tabs {
  display: inline-flex;
  gap: 10px;
  background: white;
  padding: 5px;
  border-radius: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filter-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn.active {
  background: #0a3d62;
  color: white;
}

.nav-links a.active {
  color: #ffd700;
  font-weight: bold;
}

/* Hero section stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 30px;
}

.stat-item {
  text-align: center;
  color: white;
}

.stat-item strong {
  display: block;
  font-size: 2em;
  font-weight: bold;
}

.stat-item span {
  font-size: 0.9em;
  opacity: 0.8;
}

/* Post cards */
.post-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  position: relative;
}

.post-card:hover {
  transform: translateY(-5px);
}

.post-card.featured {
  grid-column: span 2;
}

.post-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-content {
  padding: 20px;
}

.post-meta {
  display: flex;
  gap: 15px;
  font-size: 0.85em;
  color: #666;
  margin: 10px 0;
}

.post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.price {
  font-weight: bold;
  color: #e74c3c;
  font-size: 1.1em;
}

/* Grid layouts */
.highlight-posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.category-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.category-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
}

/* Compact post cards */
.post-card.compact img {
  height: 150px;
}

.post-card.compact .post-content {
  padding: 15px;
}

/* Footer */
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  padding: 40px 20px;
  background: #2c3e50;
  color: white;
}

.footer-section h3, .footer-section h4 {
  margin-bottom: 15px;
  color: #3498db;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a {
  color: #bdc3c7;
  text-decoration: none;
}

.footer-section ul li a:hover {
  color: white;
}

.footer-bottom {
  background: #34495e;
  text-align: center;
  padding: 20px;
  color: #bdc3c7;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-stats {
    gap: 20px;
  }
  
  .post-card.featured {
    grid-column: span 1;
  }
  
  .highlight-posts {
    grid-template-columns: 1fr;
  }
  
  .post-meta {
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* Search dropdown styles */
.search-box {
  position: relative;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
  font-size: 14px;
}

.search-header .view-all {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.search-header .view-all:hover {
  text-decoration: underline;
}

.search-result-item {
  border-bottom: 1px solid #eee;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item a {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s;
}

.search-result-item a:hover {
  background-color: #f8f9fa;
}

.result-content h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.result-content p {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #666;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #888;
}

.result-meta .category {
  background: #e3f2fd;
  color: #1976d2;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.search-no-results,
.search-error {
  padding: 20px 16px;
  text-align: center;
  color: #666;
}

.search-no-results p,
.search-error p {
  margin: 0 0 4px 0;
  font-weight: 500;
}

.search-no-results small,
.search-error small {
  color: #888;
}

/* Highlight search terms */
mark {
  background-color: #fff3cd;
  color: #856404;
  padding: 0 2px;
  border-radius: 2px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .search-dropdown {
    left: -20px;
    right: -20px;
  }
  
  .result-content h4 {
    font-size: 13px;
  }
  
  .result-content p {
    font-size: 12px;
  }
}

/* User Menu Styles - Remove shadow */
.user-menu {
  margin-left: 20px;
}

.user-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.user-avatar:hover {
  transform: scale(1.05);
}

.user-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .user-menu {
    margin-left: 10px;
  }
  
  .user-avatar img {
    width: 32px;
    height: 32px;
  }
}

/* Profile Page Styles */
.profile-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.profile-header {
  display: flex;
  gap: 30px;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 30px;
}

.profile-avatar {
  position: relative;
  text-align: center;
}

.profile-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #f0f0f0;
}

.change-avatar-btn {
  margin-top: 10px;
  padding: 6px 12px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.3s;
}

.change-avatar-btn:hover {
  background: #0056b3;
}

.profile-info h1 {
  margin: 0 0 8px 0;
  color: #333;
}

.profile-email {
  color: #666;
  margin: 0 0 4px 0;
}

.profile-joined {
  color: #888;
  font-size: 14px;
  margin: 0 0 20px 0;
}

.profile-stats {
  display: flex;
  gap: 30px;
}

.profile-stats .stat-item {
  text-align: center;
}

.profile-stats .stat-item strong {
  display: block;
  font-size: 24px;
  color: #007bff;
  margin-bottom: 4px;
}

.profile-stats .stat-item span {
  font-size: 14px;
  color: #666;
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  gap: 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 15px 20px;
  border: none;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
}

.tab-btn:hover {
  background: #f8f9fa;
}

.tab-btn.active {
  background: #f8f9fa;
  border-bottom-color: #007bff;
  color: #007bff;
  font-weight: 600;
}

.tab-content {
  display: none;
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-content.active {
  display: block;
}

/* Overview Tab */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.overview-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
}

.overview-card h3 {
  margin: 0 0 20px 0;
  color: #333;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.activity-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.activity-icon {
  font-size: 20px;
  margin-top: 2px;
}

.activity-content p {
  margin: 0 0 4px 0;
  font-weight: 500;
}

.activity-content small {
  color: #666;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.stat-box {
  text-align: center;
  padding: 15px;
  background: white;
  border-radius: 6px;
}

.stat-box strong {
  display: block;
  font-size: 20px;
  color: #007bff;
  margin-bottom: 4px;
}

/* Posts Tab */
.posts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.post-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  align-items: center;
}

.post-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}

.post-info {
  flex: 1;
}

.post-info h4 {
  margin: 0 0 8px 0;
  color: #333;
}

.post-info p {
  margin: 0 0 8px 0;
  color: #666;
  font-size: 14px;
}

.post-meta {
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: #888;
}

.post-actions {
  display: flex;
  gap: 8px;
}

.btn-edit, .btn-delete {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.btn-edit {
  background: #28a745;
  color: white;
}

.btn-delete {
  background: #dc3545;
  color: white;
}

/* Settings Form */
.settings-form {
  max-width: 600px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.form-group textarea {
  height: 80px;
  resize: vertical;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.btn-primary {
  background: #007bff;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-secondary {
  background: #6c757d;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 6px;
  color: white;
  font-weight: 500;
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.3s;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  background: #28a745;
}

.notification.info {
  background: #17a2b8;
}

.notification.error {
  background: #dc3545;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-stats {
    justify-content: center;
  }
  
  .overview-grid {
    grid-template-columns: 1fr;
  }
  
  .post-item {
    flex-direction: column;
    text-align: center;
  }
  
  .user-menu {
    margin-left: 10px;
  }
  
  .user-name {
    display: none;
  }
}

/* Logout Section */
.logout-section {
  text-align: center;
  margin-top: 30px;
  padding: 20px;
}

.logout-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s;
}

.logout-btn:hover {
  background: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Auth Pages */
.auth-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 400px;
}

.auth-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  overflow: hidden;
}

.auth-header {
  background: #0a3d62;
  color: white;
  padding: 30px;
  text-align: center;
}

.auth-header h1 {
  margin: 0 0 8px 0;
  font-size: 28px;
}

.auth-header p {
  margin: 0;
  opacity: 0.9;
}

.auth-form {
  padding: 30px;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
}

.auth-form input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.auth-form input:focus {
  outline: none;
  border-color: #007bff;
}

.btn-auth {
  width: 100%;
  background: #007bff;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-auth:hover {
  background: #0056b3;
}

.auth-footer {
  padding: 20px 30px;
  text-align: center;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.auth-footer a {
  color: #007bff;
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 150px;
  display: none;
  z-index: 1000;
}

.user-dropdown.show {
  display: block;
}

.user-dropdown a {
  display: block;
  padding: 12px 16px;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #eee;
}

.user-dropdown a:hover {
  background: #f5f5f5;
}

.user-dropdown a:last-child {
  border-bottom: none;
}
