/* announcements/style.css */
.announcements-page {
  /* CARD SIZE: Increased max-width to make the whole section wider */
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 16px;
}

.announcements-page .lead {
  color: #ccc;
  margin-bottom: 24px;
}

.announcement-filters {
  margin-bottom: 24px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--secondary-color);
  padding-bottom: 16px;
}

.filter-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  color: #aaa;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s, color 0.2s;
}

.filter-btn:hover {
  background: var(--secondary-color);
  color: #fff;
}

.filter-btn.active {
  background: var(--accent-color);
  color: #fff;
}

.announcement {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  margin-bottom: 24px;
  border-left: 4px solid transparent;
  display: flex;
  gap: 24px; /* CARD SIZE: Increased gap for more internal space */
  overflow: hidden;
}
.announcement-image {
  /* IMAGE SIZE: Reduced width for a smaller image */
  width: 120px;
  flex-shrink: 0;
  object-fit: contain;
  background-color: rgba(0,0,0,0.2); 
}
.announcement-main {
  /* CARD SIZE: Increased padding to make content area larger */
  padding: 24px;
  flex-grow: 1;
}

.announcement.source-youtube { border-left-color: #ff0000; }
.announcement.source-discord { border-left-color: #7289da; }
.announcement.source-website { border-left-color: #039e00; }

.announcement h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.8rem; /* CARD SIZE: Slightly larger title */
}
.announcement-meta {
  font-size: 0.9em;
  color: #999;
  margin-bottom: 12px;
}
.announcement-content p {
  margin: 0;
  line-height: 1.6;
}

.source-icon {
  width: 16px;
  height: 16px;
}

.admin-controls {
  margin-bottom: 24px;
}

.primary-btn {
  background: #4a9eff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
}

.primary-btn:hover {
  background: #3a8eef;
}

/* Modal styles */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8); display: flex; align-items: center;
  justify-content: center; z-index: 1000;
}
.modal-content {
  background: #1a1a1a; padding: 24px; border-radius: 8px;
  width: 100%; max-width: 500px; position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

/* Form styles */
form label {
  display: block;
  margin-bottom: 16px;
}

form input[type="text"],
form textarea {
  width: 100%;
  padding: 8px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  color: #fff;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 24px;
}

.secondary {
  background: #444;
}

.secondary:hover {
  background: #555;
}


/* --- Admin Controls (Consistent Method) --- */

/* 1. Hide the admin controls by default for everyone. */
.admin-controls {
    display: none;
    margin-bottom: 24px;
    text-align: center; /* Center the button */
}

/* 2. ONLY if the body has our magic class, show the controls. */
body.admin-logged-in .admin-controls {
    display: block;
}

.announcement-filters {
  margin-bottom: 24px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--secondary-color);
  padding-bottom: 16px;
}
.filter-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  color: #aaa;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s, color 0.2s;
}
.filter-btn:hover {
  background: var(--secondary-color);
  color: #fff;
}
.filter-btn.active {
  background: var(--accent-color);
  color: #fff;
}
