:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  padding: 1.5rem;
}

.announcements-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

/* Header Section */
.announcements-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1rem;
}

.announcements-header h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
  flex-wrap: wrap;
}

.announcements-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Modern Clickable Notification Badge Counter */
.notification-badge-container {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.notification-badge-container:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.notification-badge-container.active-filter {
  background: var(--primary);
  border-color: var(--primary-dark);
  color: white;
}

.notification-badge-container.active-filter .badge-label {
  color: white;
}

.notification-counter {
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.45rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.badge-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}

/* Controls Bar */
.announcements-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 0.6rem 0.75rem 0.6rem 2.3rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  background: var(--card-bg);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-box select {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--card-bg);
  cursor: pointer;
  outline: none;
}

/* Buttons */
.btn {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  transition: background 0.2s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: #f1f5f9; }
.btn-danger-outline { background: transparent; border: 1px solid #fca5a5; color: var(--danger); }
.btn-danger-outline:hover { background: #fef2f2; }

/* Feed Container */
.announcements-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.announcement-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s;
}

.announcement-card.unread-notice {
  border-right: 3px solid var(--primary);
  background: #fdfeff;
}

.announcement-card.priority-urgent {
  border-left-color: var(--danger);
  background: #fff5f5;
}

.announcement-card.priority-warning {
  border-left-color: var(--warning);
}

.announcement-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-general { background: #e0f2fe; color: #0369a1; }
.badge-urgent { background: #fee2e2; color: #991b1b; }
.badge-exam { background: #fef3c7; color: #92400e; }

.announcement-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.announcement-body {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #334155;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
}

.announcement-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.75rem;
  font-size: 0.8rem;
  margin-top: 1rem;
}

/* Modal Styling */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(2px);
}

.modal-box {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h3 { font-size: 1.1rem; }
.modal-header button { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
}
.form-group textarea { resize: vertical; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}
