/**
 * Anonymous Messaging Application - Styles
 * Modern, responsive design with dark mode support
 */

/* ========== Variables & Reset ========== */
:root {
  --primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-solid: #667eea;
  --primary-dark: #5568d3;
  --secondary: #f093fb;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: rgba(0, 0, 0, 0.3);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== Navbar ========== */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  height: 80px;
  width: auto;
  margin-bottom: 1rem;
  object-fit: contain;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-user {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-solid);
}

/* ========== Container ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 3rem;
}

.dashboard-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: var(--primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ========== Authentication Pages ========== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(circle at top right, rgba(102, 126, 234, 0.1), transparent),
    radial-gradient(circle at bottom left, rgba(118, 75, 162, 0.1), transparent);
}

.auth-box {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 3rem;
  max-width: 450px;
  width: 100%;
  box-shadow: 0 20px 60px var(--shadow);
  animation: fadeInUp 0.6s ease;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: var(--primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-header p {
  color: var(--text-secondary);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary-solid);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.3s ease;
}

.auth-footer a:hover {
  opacity: 0.8;
}

/* ========== Forms ========== */
.auth-form,
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-solid);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-hint {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.filter-form .form-row {
  align-items: end;
}

/* ========== Buttons ========== */
.btn {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== Cards ========== */
.card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px var(--shadow);
}

.card-primary {
  border: 1px solid rgba(102, 126, 234, 0.3);
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.2);
}

.card-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 1.5rem;
  margin: 0;
}

.card-body {
  padding: 2rem;
}

/* ========== Dashboard Grid ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (max-width: 968px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Alerts ========== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  animation: slideIn 0.3s ease;
}

.alert p {
  margin: 0.25rem 0;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

/* ========== Privacy Notice ========== */
.privacy-notice {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.privacy-notice p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ========== Messages ========== */
.message-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-item {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: 10px;
  border-left: 3px solid var(--primary-solid);
}

.message-category {
  display: inline-block;
  background: var(--primary-solid);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ========== Status Badges ========== */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.status-read {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.status-resolved {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

/* ========== Info Section ========== */
.info-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.info-card {
  text-align: center;
  padding: 2rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  transition: transform 0.3s ease;
}

.info-card:hover {
  transform: translateY(-5px);
}

.info-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.info-card h3 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.info-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ========== Admin Dashboard ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.admin-message-card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.admin-message-body {
  background: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.admin-message-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.admin-message-actions {
  display: flex;
  gap: 1rem;
}

.update-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ========== Footer ========== */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* ========== Animations ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-menu {
    flex-direction: column;
    gap: 0.5rem;
  }

  .dashboard-header h1 {
    font-size: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .meta-row {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ========== MUI Style Pagination Refined ========== */
.pagination-mui {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  margin-top: 4rem;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px var(--shadow);
}

.pagination-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Notched Label Group Style */
.pagination-field {
  position: relative;
  display: flex;
  align-items: center;
}

.pagination-field label {
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--bg-secondary);
  padding: 0 8px;
  font-size: 0.75rem;
  color: var(--primary-solid);
  font-weight: 600;
  pointer-events: none;
  z-index: 2;
  white-space: nowrap;
}

.pagination-mui select,
.pagination-mui .jump-input {
  height: 48px;
  padding: 0 1rem;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pagination-mui select {
  min-width: 140px;
  cursor: pointer;
}

.pagination-mui .jump-input {
  width: 70px !important;
  text-align: center;
}

.pagination-mui select:hover,
.pagination-mui .jump-input:hover {
  border-color: var(--text-muted);
}

.pagination-mui select:focus,
.pagination-mui .jump-input:focus {
  border-color: var(--primary-solid);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.pagination-jump {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-tertiary);
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.page-btn:hover:not(.disabled):not(.active) {
  background: var(--glass);
  border-color: var(--glass-border);
  color: var(--primary-solid);
  transform: translateY(-1px);
}

.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.page-btn.disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

@media (max-width: 968px) {
  .pagination-mui {
    flex-direction: column;
    gap: 2rem;
    padding: 1.5rem;
  }
}
