:root {
  --primary-color: #4869b1;
  --primary-light: #DABFFF;
  --primary-dark: #2C2A4A;
  --secondary-color: #907AD6;
  --accent-color: #5b5fc9;
  --bg-color: #2a2a2b;
  --text-color: #e0e0e0;
  --card-bg: #121213;
  --header-bg: #4F518C;
  --border-color: #4c4c4d;
  --error-color: #f44336;
  --success-color: #4caf50;
  --outline-color: #303030;
  --NewsBorder-color: #313131;
}


body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-color);
  transition: 0.2s ease, color 0.3s ease;
}

body:not(.dark-mode) {
  --bg-color: #f5f5f5;
  --text-color: #333;
  --card-bg: #ebe8df;
  --header-bg: #4F518C;
  --border-color: #ddd;
  --primary-dark: #55518d;
  --outline-color: #c4c4c4;
  --NewsBorder-color: #d4d4d4;
}

/* ===== Layout ===== */
header {
  background: var(--header-bg);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

header {
  direction: ltr !important;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-auth-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}



.review-section {
  margin-bottom: 3rem;
}
.review-section h2 {
  margin-bottom: 1rem;
  color: var(--primary-light);
}
.score-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.score-label {
  font-weight: bold;
}
.score-points {
  font-weight: 600;
  color: var(--accent-color);
}
.final-score {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent-color);
  margin-top: 1rem;
}
.note {
  font-size: 0.9rem;
  opacity: 0.7;
}
.footer {
  background-color: var(--accent-color);
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}
.footer-left p,
.footer-left a {
  margin: 0.3rem 0;
}
.footer-column {
  flex: 1;
  min-width: 220px;
  margin-bottom: 1rem;
}
.footer-column h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.footer-column a {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-light);
}
.footer-column a:hover {
  text-decoration: underline;
}
.footer-logo {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}
.footer-logo img {
  width: 40px;
  margin-right: 10px;
  margin-left: 10px;
  border-radius: 64px;
}
.footer-note {
  font-size: 0.85rem;
  opacity: 0.6;
}

.social-icon {
  width: 28px;
  height: 28px;
  transition: transform 0.2s ease;
}

.social-icon:hover {
  transform: scale(1.2);
}

.nav-btn,
#languageSelector {
  background-color: #1e1e1e;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 36px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#languageSelector {
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='10' viewBox='0 0 20 20' width='10' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5H7z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
  padding-right: 28px;
}


#languageSelector:hover {
  background-color: #2c2c2c;
}

#languageSelector:focus {
  outline: none;
  box-shadow: 0 0 0 2px #5b5fc9;
}


/* ===== Components ===== */
/* User Info */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo, .user-avatar {
  border-radius: 50%;
  object-fit: cover;
}

.logo {
  display: flex;
  width: 50px;
  height: 50px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent-color);
}

/* Navigation */
nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  transition: 0.2s;
  background: rgba(255, 255, 255, 0.226);
}

nav a:hover {
  background: rgba(255,255,255,0.1);
}

.themestyle{
  border-radius: 64px;
  max-width: 100%;
  max-height: 30px;
}

.themestyle img {

  border-radius: 64px;
}

/* Buttons */
button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Forms */
form {
  margin-top: 2rem;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-group {
  margin-bottom: 1rem;
}

input, textarea, select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 1rem;
  background: var(--card-bg);
  color: var(--text-color);
  transition: border-color 0.2s;
}

select{
    border: 1px solid var(--outline-color);
    border-radius: 10px;
    cursor: pointer;
}

textarea{
    width: 98%;
}

input{
    width: 98%;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(89, 46, 131, 0.2);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

/* Platform Tags */
.platform-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.platform-tag {
  background: var(--primary-dark);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.platform-tag.selected {
  background: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.platform-badge {
  background: var(--primary-dark);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  display: inline-block;
  margin-right: 0.3rem;
}

#newsText[contenteditable] {
  width: 98%;
  min-height: 150px;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-color);
  transition: border-color 0.2s;
  resize: vertical;
  outline: none;
  margin-bottom: 1rem;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  max-width: 100%;
}

#newsText_ar[contenteditable] {
  width: 98%;
  min-height: 150px;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-color);
  transition: border-color 0.2s;
  resize: vertical;
  outline: none;
  margin-bottom: 1rem;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  max-width: 100%;
}

#reviewText[contenteditable] {
  width: 98%;
  min-height: 150px;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-color);
  transition: border-color 0.2s;
  resize: vertical;
  outline: none;
  margin-bottom: 1rem;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  max-width: 100%;
}

#newsText[contenteditable]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(89, 46, 131, 0.2);
}

#newsText_ar[contenteditable]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(89, 46, 131, 0.2);
}

#reviewText[contenteditable] {
  width: 98%;
  min-height: 150px;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-color);
  margin-bottom: 1rem;
  resize: vertical;
  transition: border-color 0.2s;
}

#reviewText[contenteditable]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(89, 46, 131, 0.2);
}
.review-editor img {
  width: 90%;
  height: 90%;
  object-fit: fill;
}

#reviewText_ar[contenteditable] {
  width: 98%;
  min-height: 150px;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-color);
  margin-bottom: 1rem;
  resize: vertical;
  transition: border-color 0.2s;
}

#reviewText_ar[contenteditable]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(89, 46, 131, 0.2);
}

/* Tags */
.tag-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: var(--secondary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.tag:hover{
   background: #27273893;
}

.tag.genre-tag {
  background-color: var(--primary-dark);
  font-weight: bold;
}

.genre-tag{
  background: var(--secondary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  text-decoration: none;
}
.genre-tag:hover{
    background: #27273893;
}

.tag-selector button {
    margin-bottom: 1rem;
}

.remove-tag-btn {
  background: none;
  border: none;
  color: white;
  margin-left: 0.5rem;
  padding: 0;
  font-size: 1rem;
  cursor: pointer;
}

/* Rating System */
.rating-container {
  margin-bottom: 1rem;
}

.rating-category {
  margin-bottom: 1rem;
}

.rating-bars {
  margin: 1.5rem 0;
}

.rating-bar {
  margin-bottom: 1rem;
}

.rating-label {
  display: inline-block;
  width: 120px;
  font-weight: 500;
}

.rating-bar-container {
  display: inline-block;
  width: calc(100% - 130px);
  height: 20px;
  background: var(--border-color);
  border-radius: 10px;
  position: relative;
  vertical-align: middle;
}

.rating-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: var(--primary-color);
  transition: width 0.5s ease;
}

.rating-value {
  margin-left: 0.5rem;
  font-weight: bold;
}

.rating-bar.overall .rating-bar-fill {
  background: var(--accent-color);
}

/* Review Cards */
.review-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 4px solid var(--primary-color);
  display: flex;
  gap: 1.5rem;
  cursor: pointer;
}

.review-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  border-right: 1px solid var(--accent-color);
  border-top: 1px solid var(--accent-color);
  border-bottom: 1px solid var(--accent-color);
  transition: all 0.2s ease;
}

.review-thumbnail {
  width: 200px;
  height: 200px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 4px;
  transition: box-shadow 0.3s ease; /* so the glow feels smooth */
}

.review-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-content {
  flex: 1;
    line-height: 1.7;
}

.review-content strong {
  color: var(--primary-light);
}

.review-content em {
  font-style: italic;
}

.review-content img {
  width: 90%;
  height: 90%;
  object-fit: cover;
  margin-top: 10px;
  margin-bottom: 10px;
  border-radius: 10px;
}

.reviewinner-content {
  flex: 1;
  line-height: 1.7;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.reviewinner-content strong {
  color: var(--primary-light);
}

.reviewinner-content em {
  font-style: italic;
}

.reviewinner-content img {
  width: 90%;
  height: 90%;
  object-fit: cover;
  margin-top: 10px;
  margin-bottom: 10px;
  border-radius: 10px;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.review-header h3 {
  margin: 0;
}

.review-header h3 a {
  color: var(--text-color);
  text-decoration: none;
}

.review-header h3 a:hover {
  color: var(--primary-light);
}

.editor-toolbar select {
  padding: 0.25rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-color);
}

.review-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--secondary-color);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.review-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.review-preview {
  color: var(--text-color);
  opacity: 0.9;
  margin-bottom: 1rem;
}



.review-stats {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  align-items: center;
}

.review-stats button {
  background: none;
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--primary-color);
  transition: all 0.2s;
}

.review-stats button:hover {
  background: rgba(89, 46, 131, 0.1);
}

.review-date {
  margin-left: auto;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Browse page specific styles */
/* Refined Review Card Grid Style */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
}

/* Card Layout Update */
.review-carde {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.review-carde:hover {
  transform: translateY(-5px);
}

.review-carde-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.review-carde-image {
  width: 100%;
  height: 210px;
  object-fit: cover;
  /* fade out the bottom */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
}


.review-carde-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.review-carde-image.placeholder::before {
  content: "🖼️";
  font-size: 2rem;
  color: var(--border-color);
}


.review-carde-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.review-carde-content h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.review-carde-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

/* Excerpt */
.review-carde-excerpt {
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.85;
  margin-top: auto;
}

/* Platform + Tag Limits */
.platform-badge,
.tag {
  background-color: var(--primary-dark);
  color: white;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  display: inline-block;
  white-space: nowrap;
}

.tag.genre-tag {
  background: var(--secondary-color);
  font-weight: bold;
}

.tag.more,
.platform-badge.more {
  background-color: #444;
  color: #fff;
  font-weight: bold;
}

.platform-badge,
.tage {
  background-color: var(--primary-dark);
  color: white;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  display: inline-block;
  white-space: nowrap;
}

.tage.genre-tag {
  background: var(--secondary-color);
  font-weight: bold;
}

.tage.more,
.platform-badge.more {
  background-color: #444;
  color: #fff;
  font-weight: bold;
}

/* Rating bar styles */
.rating-bar-container.small {
  height: 12px;
  background: var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.rating-bar-fill {
  height: 100%;
  background: var(--accent-color);
  transition: width 0.3s ease;
}

.rating-value {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-color);
}


/* Full Review View */
.review-full {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-left: 4px solid var(--primary-color);
}

.review-full .review-header h2 {
  margin-top: 0;
}

.review-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.review-image img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.review-image img.thumbnail {
  border: 2px solid var(--primary-color);
}

/* Comments Section */
#commentsSection {
  margin-top: 3rem;
}

.comment {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--secondary-color);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.comment-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-text {
  margin: 0.5rem 0;
  line-height: 1.6;
}

.comment-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--secondary-color);
}

.comment-votes {
  display: flex;
  gap: 0.5rem;
}

.comment-votes button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--secondary-color);
  transition: color 0.2s;
}

.comment-votes button:hover {
  color: var(--primary-color);
}

.comment-image {
  margin: 0.5rem 0;
}

.comment-image img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 4px;
}

.edit-comment-form {
  margin-top: 1rem;
}

.edit-comment-form textarea {
  width: 100%;
  min-height: 100px;
}

.edit-comment-form button {
  margin-right: 0.5rem;
}

/* Comment Form */
.comment-editor {
  margin-bottom: 1rem;
}

.comment-editor textarea {
  width: 100%;
  min-height: 100px;
}

.toolbar {
  margin-bottom: 0.5rem;
}

.format-btn {
  background: var(--border-color);
  border: none;
  padding: 0.25rem 0.5rem;
  margin-right: 0.25rem;
  cursor: pointer;
  border-radius: 3px;
}

.format-btn:hover {
  background: var(--primary-light);
}

.comment-image-preview {
  margin: 0.5rem 0;
}

.comment-image-preview img {
  max-width: 100%;
  max-height: 300px; /* or any height you like */
  border-radius: 8px;
  object-fit: contain;
  display: block;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
}

/* Image Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8);
}

.modal-content {
  background-color: var(--card-bg);
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: var(--text-color);
}

/* Image Grid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.image-item {
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.image-item:hover {
  transform: scale(1.05);
}

.image-item.selected {
  border-color: var(--primary-color);
}

.image-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.image-item p {
  margin: 0.5rem 0;
  text-align: center;
  font-size: 0.9rem;
}

/* Image Search */
#imageSearch {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
}

/* Selected Images */
.selected-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.selected-image {
  position: relative;
  width: 100px;
  height: 100px;
}

.selected-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.selected-image .remove-btn {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--error-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Dropdown Menu */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.5rem;
  transition: transform 0.2s;
}

.dropdown-btn:hover {
  transform: rotate(90deg);
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background: var(--card-bg);
  min-width: 120px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 4px;
  overflow: hidden;
}

.dropdown-content a {
  color: var(--text-color);
  padding: 0.5rem 1rem;
  display: block;
  text-decoration: none;
  transition: 1s;
}

.dropdown-content a:hover {
  background: var(--primary-dark);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* FAB Button */
.fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 1000;
  border: none;
  transition: all 0.3s;
}

.fab.hidden {
  display: none;
}

.fab:hover {
  background-color: var(--primary-dark);
  transform: scale(1.1);
}

/* Utility Classes */
.loading, .empty, .error {
  padding: 2rem;
  text-align: center;
  color: var(--secondary-color);
  font-style: italic;
}

.error {
  color: var(--error-color);
}

.error-message {
  color: var(--error-color);
  font-size: 0.8rem;
  margin-bottom: 1rem;
  display: none;
}

.success {
  color: var(--success-color);
}

.hidden {
  display: none !important;
}

/* Theme Toggle */
#themeToggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
  transition: transform 0.3s;
  padding: 0.5rem;
}

#themeToggle {
  transition: transform 0.3s ease;
}
#themeToggle.rotated {
  transform: rotate(180deg);
}



#writeFab {
  display: none;
}

.platform-badge.more {
  background-color: #444;
  color: #fff;
  font-weight: bold;
  cursor: default;
}

.tag.more {
  background-color: #444;
  color: #fff;
  font-weight: bold;
  cursor: default;
}

.search-container {
  margin: 1rem 0;
  text-align: center;
}

#searchInput {
  width: 97%;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid var(--outline-color);
}

.genre-label, .tags-label {
  margin-bottom: 6px;
  font-size: 0.9em;
  color: #444;
}

.genre-label strong, .tags-label strong {
  color: #222;
  margin-right: 5px;
}

.upload-container {
  margin: 1rem 0;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.upload-status {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #4caf50;
}

.sort-controlshide{
    display: none;
}

.review-video {
  margin: 20px 0;
  margin-top: 50px;
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.review-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}


.review-images-carousel {
  position: relative;
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-images-container {
  display: flex;
  overflow: hidden;
  width: 100%;
  max-width: 800px;
  position: relative;
}

.review-image {
  display: none;
  width: 100%;
  transition: opacity 0.5s ease;
}

.review-image.active {
  display: block;
}

.review-image img {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 8px;
}

.carousel-arrow {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 10px 15px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 50%;
  margin: 0 10px;
  z-index: 1;
  transition: background 0.3s;
}

.carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.8);
}

.carousel-indicators {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s;
}

.indicator.active {
  background: rgba(255, 255, 255, 0.9);
}


.rating-bar-container{
  align-self: right;
}
.average-rating {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rating-count {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 10px;
}

#searchSuggestions {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 300px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.suggestion {
  padding: 8px 12px;
  cursor: pointer;
}

.suggestion:hover {
  background-color: #f5f5f5;
}

.suggestion strong {
  font-weight: bold;
  color: #0066cc;
}

/* News specific styles */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.news-card {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.news-card:hover {
  transform: translateY(-5px);
}

.news-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.news-card:hover .news-card-image img {
  transform: scale(1.05);
}

.news-card-content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-card-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.news-preview {
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.9;
  margin-top: auto;
}

/* Single news article styles */
.news-header {
  margin-bottom: 2rem;
}

.news-header h1 {
  margin-bottom: 1rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.news-cover-image {
  margin: 2rem 0;
}

.news-cover-image img {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 8px;
}

.news-content {
  line-height: 1.7;
  margin-top: 2rem;
}

.news-content img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 4px;
}

.news-content p {
  margin-bottom: 1.5rem;
}

.news-content a {
  color: var(--primary-color);
  text-decoration: none;
}

.news-content a:hover {
  text-decoration: underline;
}

/* Editor styles */
.editor-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.news-editor {
  min-height: 300px;
  max-width: 1200px;
  margin: auto;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-color);
  outline: none;
}

.news-editor:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(89, 46, 131, 0.2);
}

.image-preview {
  margin-top: 10px;
}

.image-preview img {
  max-width: 300px;
  max-height: 200px;
}

.search-suggestions {
  position: absolute;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  width: calc(100% - 2rem);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  margin-top: 5px;
}

.search-suggestions .suggestion {
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.search-suggestions .suggestion:hover {
  background: var(--primary-dark);
  color: white;
}

/* ===== UPDATED NEWS STYLES ===== */
.news-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 columns */
  gap: 20px;
  padding: 20px 0;
}

.news-card {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 4px solid var(--primary-color);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  border-right: 1px solid var(--accent-color);
  border-top: 1px solid var(--accent-color);
  border-bottom: 1px solid var(--accent-color);
  transition: all 0.2s ease;
}

.news-thumbnail {
  width: 100%;
  height: 300px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
}

.news-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-card:hover .news-thumbnail img {
  transform: scale(1.05);
}

.news-content {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-header {
  margin-bottom: 0.8rem;
}

.news-header h3 {
  margin-bottom: 5px;
  padding-bottom: 10px;
  font-size: 1.5rem;
  border-bottom: 1px solid var(--NewsBorder-color);
  color: var(--text-color);
  line-height: 1.3;
}

.news-preview {
  color: var(--text-color);
  opacity: 0.9;
  margin-bottom: 1rem;
  flex-grow: 1;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-stats {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid var(--NewsBorder-color);
  font-size: 0.9rem;
}

.news-statsF {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid var(--NewsBorder-color);
  font-size: 0.9rem;
}

.news-statsF button {
  background: none;
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  transition: all 0.2s;
}

.news-statsF button:hover {
  transform: translateY(0);
  box-shadow: none;
}


.news-stats button {
  background: none;
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--primary-color);
  transition: all 0.2s;
}

.news-stats button:hover {
  background: rgba(89, 46, 131, 0.1);
}

.news-date {
  margin-left: auto;
  font-size: 0.8rem;
  opacity: 0.7;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0 0.5rem;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: var(--card-bg);
  min-width: 120px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1;
  border-radius: 4px;
}

.dropdown-content a {
  color: var(--text-color);
  padding: 0.5rem 1rem;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: rgba(0,0,0,0.05);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* iPad (portrait and landscape) */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
  /* Adjust main content padding */
  main {
    padding: 0 2rem;
  }
  
  /* Review card adjustments */
  .review-card {
    flex-direction: column;
    gap: 1rem;
  }
  
  .review-thumbnail {
    width: 100%;
    height: 300px;
  }
  
  /* News grid adjustments */
  .news-list {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Form input adjustments */
  input, textarea, select {
    width: 97%;
  }
  
  /* Header adjustments */
  header {
    padding: 1rem;
  }
  
  /* Footer adjustments */
  .footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .footer-column {
    margin-bottom: 1.5rem;
  }
}

/* iPhone (portrait and landscape) */
@media only screen and (max-device-width: 767px) {
  /* Main layout adjustments */
  main {
    padding: 0 1rem;
    margin: 1rem auto;
  }
  
  /* Header adjustments */
  header {
    padding: 0.5rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .header-left, .header-right {
    width: 100%;
    justify-content: center;
  }
  
  /* Navigation adjustments */
  nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  /* Review card adjustments */
  .review-card {
    flex-direction: column;
    gap: 1rem;
  }
  
  .review-thumbnail {
    width: 100%;
    height: 200px;
  }

  .reviewinner-content img{
    width: 100%;
  }
  
  /* News grid adjustments */
  .news-list {
    grid-template-columns: 1fr;
  }
  
  .news-thumbnail {
    height: 200px;
  }
  
  /* Form adjustments */
  form {
    padding: 1rem;
  }
  
  input, textarea, select {
    width: 95%;
  }
  
  /* Review grid adjustments */
  .reviews-grid {
    grid-template-columns: 1fr;
  }
  
  /* Footer adjustments */
  .footer {
    flex-direction: column;
    padding: 1.5rem 1rem;
    align-items: center;
    text-align: center;
  }
  
  .footer-column {
    min-width: 100%;
    margin-bottom: 1.5rem;
  }
  
  /* Hide some elements on mobile */
  .sort-controlshide {
    display: none;
  }
  
  /* Adjust rating bars */
  .rating-bar-container {
    width: calc(100% - 140px);
  }
  
  /* Adjust review stats */
  .review-stats, .news-stats {
    flex-wrap: wrap;
  }
  
  .review-date, .news-date {
    margin-left: 0;
    width: 100%;
    text-align: right;
  }
  
  /* Adjust contenteditable elements */
  #newsText[contenteditable], 
  #newsText_ar[contenteditable], 
  #reviewText[contenteditable], 
  #reviewText_ar[contenteditable] {
    width: 95%;
  }
  
  /* Adjust carousel */
  .review-images-carousel {
    margin: 10px 0;
  }
  
  .review-image img {
    max-height: 300px;
  }
  
  /* Adjust video embed */
  .review-video {
    margin-top: 30px;
  }
}

/* iPhone landscape specific adjustments */
@media only screen and (max-device-width: 767px) and (orientation: landscape) {
  .news-list {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .review-thumbnail, .news-thumbnail {
    height: 150px;
  }
  
  .review-card {
    flex-direction: row;
  }
  
  .review-thumbnail {
    width: 150px;
    height: 150px;
  }
}