/* ============ CRN CHANGES PAGE STYLES ============ */
/* Apple-inspired design system matching index.html & syllabus-view.html */

:root {
  --primary-color: #1a73e8;
  --primary-hover: #1557b0;
  --secondary-color: #34a853;
  --danger-color: #ea4335;
  --warning-color: #fbbc04;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
  --border-color: #dadce0;
  --shadow-light: 0 1px 6px rgba(32, 33, 36, 0.28);
  --shadow-medium: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.15);
}

html[data-theme="dark"] {
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --bg-light: #202124;
  --bg-white: #292a2d;
  --border-color: #5f6368;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Google Sans', Roboto, sans-serif;
  color: var(--text-primary);
  background: var(--bg-light);
}

.crn-changes-main {
  padding: 3rem 1rem 2rem 1rem;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  margin-top: 130px;
}

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

/* ============ HEADER SECTION ============ */

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

.crn-header h1 {
  font-size: 2rem;
  font-weight: 500;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.crn-header p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ============ VERIFICATION GATE ============ */

.verification-gate {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow-light);
  margin-bottom: 3rem;
}

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

.verification-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.verification-header p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
}

.verification-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.verification-option {
  padding: 1.75rem;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.verification-option:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-medium);
}

.verification-option.primary-option {
  border: 2px solid var(--primary-color);
  background: rgba(26, 115, 232, 0.02);
}

.verification-option.primary-option:hover {
  background: rgba(26, 115, 232, 0.04);
}

.option-header {
  margin-bottom: 1rem;
}

.option-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recommended-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: var(--primary-color);
  color: white;
  border-radius: 20px;
  font-weight: 600;
}

.verification-option p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

/* ============ CRN CONTENT SECTION ============ */

.crn-content {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.crn-content.blurred {
  position: relative;
  opacity: 0.5;
  pointer-events: none;
}

/* ============ SEARCH & FILTER SECTION ============ */

.crn-search-section {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-light);
}

.crn-search-section h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
}

.search-filter-row {
  display: grid;
  grid-template-columns: 1fr 250px 250px 50px;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
}

@media (max-width: 1024px) {
  .search-filter-row {
    grid-template-columns: 1fr;
  }
}

.search-input-group {
  position: relative;
}

.crn-search-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-white);
  color: var(--text-primary);
  transition: all 0.2s ease;
  font-family: inherit;
}

.crn-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.crn-search-input::placeholder {
  color: var(--text-secondary);
}

.filter-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-white);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.btn-refresh {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
}

.btn-refresh:hover {
  background: var(--bg-light);
  transform: scale(1.05);
}

.btn-refresh:active {
  transform: scale(0.95);
}

.days-selector-group {
  margin-top: 1rem;
}

.days-selector-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.days-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.day-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-light);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: inherit;
}

.day-btn:hover {
  border-color: var(--primary-color);
  background: var(--bg-white);
}

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

/* ============ RESULTS SECTION ============ */

.crn-results-container {
  position: relative;
  margin-bottom: 2rem;
}

.crn-results-blur {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.blur-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 1200px;
  padding: 2rem;
  z-index: 11;
}

.blur-overlay .login-button-container {
  margin-bottom: 2rem;
}

.blur-overlay .btn-login-prompt {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.blur-overlay .btn-login-prompt:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.blur-overlay .login-note {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin: 0;
}

.placeholder-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 1000px;
}

.crn-card.placeholder {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

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

.crn-card.placeholder .placeholder-text {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.crn-card.placeholder .contact-icon {
  font-size: 1.2rem;
}

.crn-card.placeholder .card-body .crn-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.crn-card.placeholder .info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.crn-card.placeholder .label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.crn-card.placeholder .value {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 0.9rem;
}

.crn-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .crn-results-grid {
    grid-template-columns: 1fr;
  }
}

.crn-request-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-light);
  transition: all 0.2s ease;
}

.crn-request-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-heavy);
  border-color: var(--primary-color);
}

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

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-professor {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0 0;
}

.contact-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-color);
  color: white;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-content {
  margin-bottom: 1rem;
}

.content-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.content-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.content-value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}

.card-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn-contact {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-contact:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-medium);
}

.btn-contact:active {
  transform: scale(0.98);
}

.btn-contact:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

.no-results {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary);
  font-size: 1rem;
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow-light);
}

/* ============ BUTTONS ============ */

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
  font-family: inherit;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-medium);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--bg-light);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-outline:hover {
  background: rgba(26, 115, 232, 0.05);
}

.btn-full {
  width: 100%;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-create-request {
  display: block;
  margin: 3rem auto 0;
  padding: 1rem 2rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-create-request:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-medium);
}

.create-request-section {
  display: flex;
  justify-content: center;
  margin: 4rem 0 0 0;
}

.past-swaps-section {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 1.75rem;
  margin-top: 4rem;
  box-shadow: var(--shadow-light);
}

.past-swaps-section h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
}

.past-swaps-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.past-swap-item {
  padding: 1rem;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.past-swap-item:hover {
  background: var(--bg-white);
  border-color: var(--primary-color);
}

.past-swap-info {
  flex: 1;
}

.past-swap-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.past-swap-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ============ MODALS ============ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-white);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-heavy);
  animation: slideUp 0.3s ease;
}

.modal-large {
  max-width: 700px;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-white);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 2rem;
}

/* ============ FORMS ============ */

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.required {
  color: var(--danger-color);
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-white);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-input::placeholder {
  color: var(--text-secondary);
}

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

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-input small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.code-input-group {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}

.code-input {
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  text-align: center;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-white);
  color: var(--text-primary);
  transition: all 0.2s ease;
  font-family: monospace;
}

.code-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* ============ AUTOCOMPLETE ============ */

.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-medium);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1001;
  display: none;
  margin-top: 0.5rem;
}

.autocomplete-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: var(--bg-light);
}

.autocomplete-text {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.autocomplete-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ============ CRN SECTION HEADER ============ */

.crn-section-header {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-light);
}

.crn-section-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  text-align: center;
}

.crn-section-header p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ============ CREATE REQUEST BUTTON (TOP) ============ */

.create-request-section-top {
  margin-bottom: 2rem;
  text-align: center;
}

.create-request-section-top .btn-create-request {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

/* ============ CREATE REQUEST INLINE ============ */

.create-request-section-inline {
  margin-bottom: 1.5rem;
  text-align: center;
}

.create-request-section-inline .btn-create-request {
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
}

/* ============ CREATE REQUEST STANDALONE ============ */

.create-request-section-standalone {
  margin: 2rem 0;
  text-align: center;
}

.create-request-section-standalone .btn-create-request {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

/* ============ DAY/TIME SELECTOR ============ */

.days-time-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 8px;
}

.days-selector-form {
  display: flex;
  flex-direction: column;
}

.days-form-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.day-form-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-white);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: inherit;
  min-width: 40px;
}

.day-form-btn:hover {
  border-color: var(--primary-color);
  background: rgba(26, 115, 232, 0.05);
}

.day-form-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.time-inputs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.time-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.time-input {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-white);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
}

.time-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

@media (max-width: 600px) {
  .days-time-selector {
    grid-template-columns: 1fr;
  }
}

/* ============ CHAT STYLES ============ */

.chat-modal {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 400px;
  height: 500px;
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow-heavy);
  display: none;
  flex-direction: column;
  z-index: 999;
  animation: slideUp 0.3s ease;
}

.chat-modal.show {
  display: flex;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-close:hover {
  color: var(--text-primary);
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  display: flex;
  margin-bottom: 0.75rem;
}

.chat-message.own {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  word-wrap: break-word;
  font-size: 0.9rem;
  line-height: 1.4;
}

.message-bubble.own {
  background: var(--primary-color);
  color: white;
}

.message-bubble.other {
  background: var(--bg-light);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.chat-input {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
}

.chat-input input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-white);
  color: var(--text-primary);
  font-family: inherit;
}

.chat-input input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.chat-input button {
  padding: 0.75rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.chat-input button:hover {
  background: var(--primary-hover);
}

/* ============ MODAL STYLES ============ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-heavy);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-light);
  color: var(--text-primary);
}

.modal-body {
  color: var(--text-primary);
}

.modal-body p[data-translate="crn-choose-login"] {
  text-align: center;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.login-option {
  margin-bottom: 1rem;
}

.login-option .btn {
  width: 100%;
}

.login-note {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 1rem;
}

/* Hidden by default, shown with .show class */
.crn-content {
  display: block;
}

.crn-content.show {
  display: block;
}

/* Blur overlay for unverified users */
.crn-results-blur {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.crn-results-blur.show {
  display: flex;
}

.blur-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.blur-overlay .login-button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.blur-overlay .btn-login-prompt {
  background: #000000;
  color: #ffffff;
  border: none;
  padding: 1rem 3rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.blur-overlay .btn-login-prompt:hover {
  background: #333333;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.blur-overlay .login-note {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  max-width: 300px;
}

/* Verification gate - hidden when dashboard is shown */
.verification-gate {
  display: none;
}

.verification-gate.show {
  display: block;
}

.crn-results-blur {
  display: none;
}

.crn-results-blur.show {
  display: flex;
}

.no-results {
  display: none;
}

.no-results.show {
  display: block;
}

/* ============ LOGIN MODAL STYLES ============ */

.login-modal .modal-content {
  max-width: 400px;
}

.login-option {
  text-align: center;
  margin-bottom: 1rem;
}

.login-option .btn {
  width: 100%;
  margin-bottom: 0.5rem;
}

.login-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* ============ TOAST NOTIFICATIONS ============ */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  background: var(--bg-white);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow-medium);
  border-left: 4px solid var(--primary-color);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  pointer-events: auto;
  max-width: 400px;
  word-wrap: break-word;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.success {
  border-left-color: var(--secondary-color);
}

.toast.error {
  border-left-color: var(--danger-color);
}

.toast.warning {
  border-left-color: var(--warning-color);
}

.toast .toast-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast .toast-close:hover {
  color: var(--text-primary);
}

.toast-content {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.toast-icon {
  font-size: 1.2rem;
  margin-top: 0.1rem;
}

.toast-message {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ============ RESPONSIVE DESIGN ============ */

@media (max-width: 768px) {
  .crn-changes-main {
    padding: 1rem 0.5rem;
  }

  .verification-gate {
    padding: 1.5rem 1rem;
  }

  .crn-search-section {
    padding: 1rem;
  }

  .search-filter-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .crn-header h1 {
    font-size: 1.5rem;
  }

  .modal-content {
    width: 95%;
    max-width: 100%;
  }

  .chat-modal {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-height: 100vh;
  }
}

@media (max-width: 480px) {
  .crn-results-grid {
    grid-template-columns: 1fr;
  }

  .verification-options {
    grid-template-columns: 1fr;
  }

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