/* Euclid Square Font */
@font-face {
  font-family: 'Euclid Square';
  src: url('/fonts/EuclidSquare-Regular.otf') format('opentype');
  font-weight: 400;
}
@font-face {
  font-family: 'Euclid Square';
  src: url('/fonts/EuclidSquare-Medium.otf') format('opentype');
  font-weight: 500;
}
@font-face {
  font-family: 'Euclid Square';
  src: url('/fonts/EuclidSquare-Semibold.otf') format('opentype');
  font-weight: 600;
}
@font-face {
  font-family: 'Euclid Square';
  src: url('/fonts/EuclidSquare-Bold.otf') format('opentype');
  font-weight: 700;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Euclid Square', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0b0712;
  color: #e0e0e0;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header & Logo */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-mark {
  width: 120px;
  flex-shrink: 0;
}

.logo-mark svg {
  width: 100%;
  height: auto;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #fff;
}

.admin-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(128, 70, 255, 0.15);
  color: #a06fff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.5rem;
}

.subtitle {
  color: #888;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Controls Bar (Search + Sort) */
.controls-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: 1px solid #2a2235;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #150f1e;
  color: #e0e0e0;
}

.search-input::placeholder {
  color: #555;
}

.search-input:focus {
  outline: none;
  border-color: #8046FF;
}

.sort-btn {
  white-space: nowrap;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #1e1728;
}

.tab {
  padding: 0.6rem 1.25rem;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: #bbb;
}

.tab.active {
  color: #8046FF;
  border-bottom-color: #8046FF;
}

/* Notice Cards */
.notice-card {
  background: #150f1e;
  border: 1px solid #2a2235;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.notice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.notice-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.notice-date {
  font-size: 0.85rem;
  color: #666;
  white-space: nowrap;
}

.notice-description {
  color: #999;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
}

.notice-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.notice-links a {
  color: #8046FF;
  text-decoration: none;
  font-size: 0.9rem;
}

.notice-links a:hover {
  text-decoration: underline;
  color: #a06fff;
}

/* Notice Author */
.notice-author {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1e1728;
}

.notice-author a {
  color: #fff;
  text-decoration: underline;
  font-weight: 500;
}

.notice-author a:hover {
  color: #a06fff;
}

/* Date input styling */
.form-group input[type="date"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #2a2235;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #0b0712;
  color: #e0e0e0;
}

.form-group input[type="date"]:focus {
  outline: none;
  border-color: #8046FF;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* Avatars */
.avatar-sm {
  width: 32px;
  height: 40px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  flex-shrink: 0;
  vertical-align: middle;
  object-fit: cover;
}

.avatar-lg {
  width: 120px;
  height: 150px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  flex-shrink: 0;
  object-fit: cover;
}

.avatar-initials {
  background: #8046FF;
  color: #fff;
}

/* Keep circle style for user menu trigger only */
.user-menu-trigger .avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: #8046FF;
  color: #fff;
}

.btn-primary:hover {
  background: #6b30e0;
}

.btn-secondary {
  background: #1e1728;
  color: #bbb;
  border: 1px solid #2a2235;
}

.btn-secondary:hover {
  background: #2a2235;
  color: #e0e0e0;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

/* Login Form */
.login-form {
  max-width: 360px;
  margin: 4rem auto;
}

.login-form label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: #ccc;
}

.login-form input {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 0.25rem;
  border: 1px solid #2a2235;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #150f1e;
  color: #e0e0e0;
}

.login-form input::placeholder {
  color: #555;
}

.login-form .form-group {
  margin-bottom: 1rem;
}

.login-form .btn {
  width: 100%;
  margin-top: 0.5rem;
}

.error {
  color: #ef4444;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Notice Form */
.notice-form {
  background: #150f1e;
  border: 1px solid #2a2235;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: #ccc;
}

.hint {
  color: #666;
  font-weight: 400;
  font-size: 0.85rem;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #2a2235;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #0b0712;
  color: #e0e0e0;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #8046FF;
}

.link-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.link-row input {
  flex: 1;
  padding: 0.4rem;
  border: 1px solid #2a2235;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #0b0712;
  color: #e0e0e0;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Add Notice button spacing */
#tab-notices > .btn-primary:first-child {
  margin-bottom: 1.25rem;
}

/* Pagination */
.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #150f1e;
  border: 1px solid #2a2235;
  border-radius: 8px;
}

.page-size-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #888;
}

.page-size-select select {
  padding: 0.3rem 0.5rem;
  border: 1px solid #2a2235;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
  background: #0b0712;
  color: #e0e0e0;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-nav span {
  font-size: 0.85rem;
  color: #888;
}

.page-nav button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Admin card actions */
.card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1e1728;
}

/* Invite Section */
.invite-section {
  background: #150f1e;
  border: 1px solid #2a2235;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.invite-section h3 {
  margin-bottom: 1rem;
  color: #fff;
}

.invite-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.invite-row input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #2a2235;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #0b0712;
  color: #e0e0e0;
}

.invite-label {
  font-size: 0.9rem;
  color: #888;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.invite-link-box {
  display: flex;
  gap: 0.5rem;
}

.invite-link-box input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #2a2235;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #150f1e;
  color: #ccc;
}

/* User List */
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #150f1e;
  border: 1px solid #2a2235;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 0.5rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-name {
  font-weight: 600;
  color: #8046FF;
  text-decoration: none;
}

.user-name:hover {
  text-decoration: underline;
  color: #a06fff;
}

.user-email {
  font-size: 0.85rem;
  color: #666;
}

.user-role {
  font-size: 0.75rem;
  background: rgba(128, 70, 255, 0.15);
  color: #a06fff;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  text-transform: uppercase;
  font-weight: 600;
}

.user-actions {
  flex-shrink: 0;
}

/* Profile Page */
.profile-card {
  background: #150f1e;
  border: 1px solid #2a2235;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.profile-top {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.profile-info h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  color: #fff;
}

.profile-info p {
  margin-bottom: 0.5rem;
  color: #999;
}

.profile-info a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #0077B5;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.profile-info a:hover {
  text-decoration: underline;
}

/* Success Message */
.success-message {
  text-align: center;
  padding: 3rem 1rem;
}

.success-message h2 {
  color: #34d399;
  margin-bottom: 0.75rem;
}

.success-message a {
  color: #8046FF;
}

/* Back Link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #8046FF;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.back-link:hover {
  text-decoration: underline;
  color: #a06fff;
}

/* Logo Link */
.logo-link {
  text-decoration: none;
  display: block;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.view-bulletin-btn {
  white-space: nowrap;
}

/* User Menu */
.user-menu-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid #2a2235;
  border-radius: 999px;
  padding: 0.3rem 0.6rem 0.3rem 0.3rem;
  cursor: pointer;
  color: #888;
  transition: border-color 0.15s;
}

.user-menu-trigger:hover {
  border-color: #8046FF;
}

.user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: #1e1728;
  border: 1px solid #2a2235;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  text-align: left;
  background: none;
  border: none;
  font-size: 0.9rem;
  font-family: inherit;
  color: #ccc;
  text-decoration: none;
  cursor: pointer;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
  background: #2a2235;
}

.user-menu-dropdown button {
  color: #ef4444;
  border-top: 1px solid #2a2235;
}

/* Invite Role Select */
.invite-role-select {
  padding: 0.5rem;
  border: 1px solid #2a2235;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #0b0712;
  color: #e0e0e0;
}

/* States */
.loading, .empty {
  text-align: center;
  color: #666;
  padding: 3rem 1rem;
  font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 600px) {
  .notice-header {
    flex-direction: column;
    gap: 0.25rem;
  }

  .link-row {
    flex-direction: column;
  }

  .link-row input {
    width: 100%;
  }

  header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .controls-bar {
    flex-direction: column;
  }

  .sort-btn {
    align-self: flex-end;
  }

  .logo-mark {
    width: 80px;
  }

  .invite-row {
    flex-direction: column;
  }

  .profile-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .user-row {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
}
