/* ===== VARIABLES ===== */
:root {
  --primary-color: #e91e63;
  --secondary-color: #9c27b0;
  --accent-color: #ff4081;
  --dark-bg: #121212;
  --card-bg: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --border-color: #333333;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --error-color: #f44336;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* ===== BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--dark-bg);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== HEADER ===== */
.header {
  background-color: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 15px 0;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  height: 40px;
  width: auto;
}

.logo h1 {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-text p {
  color: var(--text-secondary);
  font-size: 14px;
}

.back-button {
  display: flex;
  align-items: center;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  padding: 30px 0;
  min-height: calc(100vh - 180px);
}

/* ===== FILTER SECTION ===== */
.filter-section {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background-color: rgba(233, 30, 99, 0.1);
  border-color: var(--primary-color);
  color: var(--text-primary);
}

.filter-btn.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* ===== POST GRID ===== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.post-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.post-card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-card-image img {
  transform: scale(1.05);
}

.post-card-category {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--primary-color);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.post-card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.post-card-title {
  font-size: 18px;
  margin-bottom: 10px;
  font-weight: 600;
}

.post-card-description {
  color: var(--text-secondary);
  margin-bottom: 15px;
  flex-grow: 1;
}

.post-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.post-card-views {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-size: 14px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--accent-color);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: #7b1fa2;
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* ===== LOADING INDICATOR ===== */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 15px;
}

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

/* ===== NO RESULTS ===== */
.no-results {
  text-align: center;
  padding: 40px 0;
  color: var(--text-secondary);
}

.no-results i {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* ===== ERROR MESSAGE ===== */
.error-message {
  text-align: center;
  padding: 40px 0;
}

.error-message i {
  font-size: 48px;
  color: var(--error-color);
  margin-bottom: 15px;
}

.error-message h2 {
  margin-bottom: 10px;
}

.error-message p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ===== FOOTER ===== */
.footer {
  background-color: rgba(18, 18, 18, 0.95);
  border-top: 1px solid var(--border-color);
  padding: 20px 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.social-links a {
  color: var(--text-secondary);
  font-size: 18px;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--primary-color);
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  overflow: hidden;
  box-shadow: var(--shadow-hover);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  margin: 0;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== POST DETAIL ===== */
.post-detail {
  max-width: 800px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}

.post-title {
  font-size: 28px;
  margin-bottom: 10px;
}

.post-meta {
  display: flex;
  gap: 15px;
  color: var(--text-secondary);
  font-size: 14px;
}

.post-category {
  background-color: var(--primary-color);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.post-body {
  margin-bottom: 40px;
}

.post-body p {
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.7;
}

/* ===== PREVIEW SECTION ===== */
.preview-section {
  margin-bottom: 30px;
}

.preview-section h2 {
  margin-bottom: 15px;
  font-size: 20px;
}

.preview-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.2);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-loading, .preview-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.preview-error {
  color: var(--error-color);
}

.preview-error i {
  font-size: 36px;
  margin-bottom: 15px;
}

#preview-image {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
  display: flex;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.action-buttons .btn {
  flex: 1;
  min-width: 200px;
  padding: 15px 20px;
  font-size: 16px;
}

/* ===== POST INFO ===== */
.post-info {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 40px;
}

.post-info h3 {
  margin-bottom: 15px;
  font-size: 18px;
}

.post-info ul {
  list-style: none;
}

.post-info li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.post-info i {
  width: 20px;
  text-align: center;
  color: var(--primary-color);
}

/* ===== RELATED CONTENT ===== */
.related-content h3 {
  margin-bottom: 20px;
  font-size: 18px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.related-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.related-card:hover {
  transform: translateY(-3px);
}

.related-card-image {
  height: 120px;
  overflow: hidden;
}

.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card-content {
  padding: 15px;
}

.related-card-title {
  font-size: 14px;
  margin-bottom: 5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-card-category {
  font-size: 12px;
  color: var(--text-secondary);
}
