/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Base styles */
* {
  box-sizing: border-box;
}

/* Ensure hidden attribute works properly across all browsers */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

/* Header styles */
.app-header {
  background: white;
  border-bottom: 1px solid #e9ecef;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.app-logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #007bff;
  text-decoration: none;
}

.app-logo:hover {
  color: #0056b3;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.875rem;
}

.user-label {
  color: #6c757d;
  font-size: 0.75rem;
}

.user-email {
  font-weight: 600;
  color: #495057;
}

.nav-link {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.nav-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* Main content */
.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: calc(100vh - 120px);
}

/* Button styles */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: 2px solid;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px; /* Touch target minimum */
}

.btn--primary {
  background-color: #007bff;
  border-color: #007bff;
  color: white;
}

.btn--primary:hover {
  background-color: #0056b3;
  border-color: #0056b3;
}

.btn--outline {
  background-color: transparent;
  border-color: #007bff;
  color: #007bff;
}

.btn--outline:hover {
  background-color: #007bff;
  color: white;
}

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

/* Flash messages - positioned at top of page */
body > .flash-container {
  margin: 0;
  padding: 0;
}

/* Authentication container */
.auth-container {
  max-width: 480px;
  margin: 2rem auto;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  padding: 2rem;
}

.auth-container h1 {
  text-align: center;
  margin: 0;
  padding: 0 0 1rem;
  color: #333;
  font-size: 1.75rem;
}

.auth-description {
  margin: 0 0 2rem;
  padding: 0;
  color: #6c757d;
  text-align: center;
  font-size: 1rem;
}

.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert--notice {
  background-color: #d1ecf1;
  border: 1px solid #b6d4da;
  color: #0c5460;
}

.alert--alert {
  background-color: #f8d7da;
  border: 1px solid #f1aeb5;
  color: #721c24;
}

.alert__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert__message {
  flex: 1;
}

/* Auth forms */
.auth-form {
  padding: 2rem;
}

/* Form styles */
.form {
  width: 100%;
}

.form-field {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid #e9ecef;
  border-radius: 0.375rem;
  transition: border-color 0.2s ease;
  min-height: 44px; /* Touch target minimum */
}

.form-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-input:invalid {
  border-color: #dc3545;
}

.field-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #6c757d;
}

.field-error {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #dc3545;
  font-weight: 500;
}


/* Password strength indicator */
.password-strength {
  margin-top: 0.5rem;
}

.password-strength__bar {
  width: 100%;
  height: 4px;
  background-color: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
}

.password-strength__fill {
  height: 100%;
  width: 0%;
  background-color: #dc3545;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.password-strength__fill.weak {
  width: 25%;
  background-color: #dc3545;
}

.password-strength__fill.fair {
  width: 50%;
  background-color: #fd7e14;
}

.password-strength__fill.good {
  width: 75%;
  background-color: #ffc107;
}

.password-strength__fill.strong {
  width: 100%;
  background-color: #28a745;
}

.password-strength__text {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.25rem;
  display: block;
}

/* Form actions */
.form-actions {
  margin: 2rem 0 1rem;
}

.form-actions .btn {
  width: 100%;
}

/* Aligned form actions for settings */
.form-actions--aligned {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

.form-actions--aligned .btn {
  width: auto;
  min-width: 120px;
}

/* Form footer */
.form-footer {
  text-align: center;
  margin-top: 1rem;
}

.link {
  color: #007bff;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.link--secondary {
  color: #6c757d;
  font-size: 0.875rem;
}

.terms-text {
  font-size: 0.75rem;
  color: #6c757d;
  margin: 0;
  line-height: 1.4;
}

/* Responsive design */
@media (max-width: 768px) {
  .header-container {
    padding: 0.75rem;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .user-status {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .user-info {
    align-items: center;
  }
  
  .auth-container {
    margin: 1rem;
    border-radius: 0.375rem;
    padding: 1.5rem;
  }
  
  .auth-container h1 {
    font-size: 1.5rem;
    padding: 0 0 1rem;
  }
  
  .auth-form {
    padding: 1.5rem;
  }
  
}

@media (max-width: 480px) {
  .app-main {
    padding: 1rem 0.5rem;
  }
  
  .auth-container {
    margin: 0.5rem;
  }
  
  .form-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .btn {
    padding: 1rem 1.5rem; /* Larger touch targets on mobile */
  }
  
  /* Stack buttons on mobile */
  .form-actions--aligned {
    flex-direction: column-reverse;
  }
  
  .form-actions--aligned .btn {
    width: 100%;
  }
  
  /* Mobile notification dropdown styles */
  .notification-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    max-height: 70vh;
    border-radius: 1rem 1rem 0 0;
    margin: 0;
    animation: slideUpMobile 0.3s ease-out;
  }
  
  .notification-item {
    padding: 1.25rem;
  }
  
  .notification-dropdown__content {
    max-height: calc(70vh - 4rem);
  }
}

@keyframes slideUpMobile {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Focus indicators for accessibility */
.btn:focus,
.form-input:focus,
.nav-link:focus,
.link:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Inline form styles */
.inline-form {
  display: inline-block;
  margin: 0;
}

/* Dashboard styles */
.dashboard {
  max-width: 800px;
  margin: 0 auto;
}

.dashboard h1 {
  color: #333;
  margin-bottom: 1rem;
}

.dashboard p {
  color: #6c757d;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.dashboard-placeholder {
  background: white;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-placeholder h2 {
  color: #007bff;
  margin-bottom: 1rem;
}

.dashboard-placeholder ul {
  list-style: none;
  padding: 0;
}

.dashboard-placeholder li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f8f9fa;
  position: relative;
  padding-left: 1.5rem;
}

.dashboard-placeholder li:before {
  content: "⏳";
  position: absolute;
  left: 0;
}

.dashboard-placeholder li:last-child {
  border-bottom: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .form-input {
    border-width: 3px;
  }
  
  .btn {
    border-width: 3px;
  }
  
  .alert {
    border-width: 2px;
  }
}

/* Service Worker Update Banner */
.service-worker-update-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: slideUp 0.3s ease-out;
}

.service-worker-update-banner p {
  margin: 0;
  color: #333;
  font-weight: 500;
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* Notification Permission Card */
.notification-permission-card {
  background: white;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.notification-permission-card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #333;
}

.notification-status {
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  text-align: center;
}

.notification-status--default {
  background-color: #f8f9fa;
  color: #6c757d;
}

.notification-status--granted,
.notification-status--subscribed {
  background-color: #d4edda;
  color: #155724;
}

.notification-status--denied {
  background-color: #f8d7da;
  color: #721c24;
}

.notification-status--error {
  background-color: #fff3cd;
  color: #856404;
}

.notification-status--not-supported {
  background-color: #cce5ff;
  color: #004085;
}

.permission-ui {
  margin-top: 1rem;
}

.browser-instructions {
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 0.25rem;
  margin: 1rem 0;
}

.browser-instructions li {
  margin-bottom: 0.5rem;
}

.button-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Secondary button style (was missing) */
.btn--secondary {
  background-color: #6c757d;
  border-color: #6c757d;
  color: white;
}

.btn--secondary:hover {
  background-color: #545b62;
  border-color: #545b62;
}

/* Enhanced permission UI states */
.permission-ui {
  animation: fadeIn 0.3s ease-in;
}

.permission-ui[data-permission-state="granted"] {
  border-left: 4px solid #28a745;
  padding-left: 1rem;
}

.permission-ui[data-permission-state="denied"] {
  border-left: 4px solid #dc3545;
  padding-left: 1rem;
}

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

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mobile responsive styles for notifications */
@media (max-width: 768px) {
  .notification-permission-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .button-group {
    flex-direction: column;
    width: 100%;
  }
  
  .button-group .btn {
    width: 100%;
  }
  
  .browser-instructions {
    font-size: 0.875rem;
  }
  
  .notification-dropdown {
    width: 100%;
    max-width: 360px;
    left: 0;
    right: 0;
    margin: 0 auto;
  }
}

/* Settings Styles */
.settings-container {
  max-width: 640px;
}

.settings-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #e9ecef;
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.settings-description {
  color: #6c757d;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* Checkbox styles */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  padding: 0.75rem 1rem;
  margin-left: -1rem;
  margin-right: -1rem;
  transition: background-color 0.2s;
  border-radius: 0.25rem;
}

.checkbox-label:hover {
  background-color: #f8f9fa;
}

.checkbox-label:focus-within {
  outline: 2px solid #007bff;
  outline-offset: -2px;
}

.checkbox-input {
  margin-right: 0.75rem;
  margin-top: 0.25rem;
  cursor: pointer;
}

.checkbox-text {
  flex: 1;
}

.checkbox-text strong {
  display: block;
  color: #333;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.checkbox-description {
  display: block;
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.4;
}

/* Notification Badge & Dropdown */
.notification-badge-container {
  position: relative;
}

.notification-badge-button {
  position: relative;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1.25rem;
  color: #6c757d;
  transition: color 0.2s;
}

.notification-badge-button:hover {
  color: #333;
}

.notification-badge-button:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
  border-radius: 4px;
}

.notification-icon {
  display: block;
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #dc3545;
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 0.125rem 0.375rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 360px;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.notification-dropdown__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.notification-dropdown__header h3 {
  margin: 0;
  font-size: 1.125rem;
  color: #333;
}

.notification-dropdown__view-all {
  color: #007bff;
  text-decoration: none;
  font-size: 0.875rem;
}

.notification-dropdown__view-all:hover {
  text-decoration: underline;
}

.notification-dropdown__content {
  flex: 1;
  overflow-y: auto;
  max-height: 360px;
}

.notification-dropdown__loading,
.notification-dropdown__empty {
  padding: 2rem;
  text-align: center;
  color: #6c757d;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.notification-dropdown__list {
  padding: 0;
}

.notification-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid #f8f9fa;
  cursor: pointer;
  transition: background-color 0.2s;
}

.notification-item:hover {
  background-color: #f8f9fa;
}

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

.notification-item--unread {
  background-color: #f0f8ff;
  position: relative;
}

.notification-item--unread:hover {
  background-color: #e6f3ff;
}

.notification-item--unread::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background-color: #007bff;
  border-radius: 50%;
}

.notification-item--unread .notification-item__title {
  font-weight: 700;
}

.notification-item__icon {
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1;
}

.notification-item__content {
  flex: 1;
  min-width: 0;
}

.notification-item__title {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
}

.notification-item__body {
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notification-item__time {
  color: #6c757d;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.notification-error {
  padding: 2rem;
  text-align: center;
}

.notification-error p {
  color: #dc3545;
  margin-bottom: 1rem;
}

/* Notifications Page Styles */
.notifications {
  max-width: 800px;
  margin: 0 auto;
}

.notifications__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.notifications__title {
  margin: 0;
  color: #333;
}

.notifications__actions {
  display: flex;
  gap: 0.5rem;
}

/* Notification Filters */
.notifications__filters {
  background: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}

.filters__group {
  display: flex;
  flex-direction: column;
}

.filters__group--actions {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.filters__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
}

.filters__select,
.filters__input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.15s ease-in-out;
}

.filters__select:focus,
.filters__input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.filters__input--date {
  width: 100%;
}

/* Notifications List */
.notifications__list {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.notifications__day-group {
  border-bottom: 1px solid #e9ecef;
}

.notifications__day-group:last-child {
  border-bottom: none;
}

.notifications__day-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6c757d;
  padding: 1rem 1.5rem 0.5rem;
  margin: 0;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.notifications__day-items {
  padding: 0;
}

/* Individual Notification Item */
.notification {
  display: flex;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f8f9fa;
  transition: background-color 0.2s;
  position: relative;
}

.notification:hover {
  background-color: #f8f9fa;
}

.notification--unread {
  background-color: #f0f8ff;
}

.notification--unread:hover {
  background-color: #e6f3ff;
}

.notification--unread::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background-color: #007bff;
  border-radius: 50%;
}

.notification__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9ecef;
  border-radius: 50%;
}

.notification__icon svg {
  width: 24px;
  height: 24px;
  stroke: #6c757d;
}

.notification--unread .notification__icon {
  background: #e7f3ff;
}

.notification--unread .notification__icon svg {
  stroke: #007bff;
}

.notification__content {
  flex: 1;
  min-width: 0;
}

.notification__title {
  font-weight: 600;
  color: #333;
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.notification--unread .notification__title {
  font-weight: 700;
}

.notification__body {
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 0.5rem;
}

.notification__meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #6c757d;
}

.notification__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: 1rem;
}

.notification__action {
  background: none;
  border: none;
  padding: 0.75rem;
  cursor: pointer;
  color: #6c757d;
  transition: all 0.2s;
  border-radius: 0.25rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification__action:hover {
  background: #e9ecef;
  color: #333;
}

.notification__action svg {
  width: 18px;
  height: 18px;
  display: block;
}

.notification__action--mark-read:hover {
  color: #28a745;
}

.notification__action--view:hover {
  color: #007bff;
}

.notification__action--delete:hover {
  color: #dc3545;
}

/* Empty State */
.notifications__empty {
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state {
  max-width: 400px;
  margin: 0 auto;
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  color: #dee2e6;
}

.empty-state__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 0.5rem;
}

.empty-state__text {
  color: #6c757d;
  margin: 0;
}

/* Pagination */
.notifications__pagination {
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid #e9ecef;
}

/* Modal Styles */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal--active {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.modal__content {
  position: relative;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  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 #e9ecef;
}

.modal__title {
  margin: 0;
  font-size: 1.25rem;
  color: #333;
}

.modal__close {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: #6c757d;
  transition: color 0.2s;
  border-radius: 0.25rem;
}

.modal__close:hover {
  color: #333;
  background: #f8f9fa;
}

.modal__close svg {
  width: 20px;
  height: 20px;
  display: block;
}

.modal__body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Notification Detail */
.notification-detail__header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.notification-detail__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9ecef;
  border-radius: 50%;
  flex-shrink: 0;
}

.notification-detail__icon svg {
  width: 28px;
  height: 28px;
  stroke: #6c757d;
}

.notification-detail__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 0.25rem;
}

.notification-detail__type {
  color: #6c757d;
  font-size: 0.875rem;
  margin: 0;
}

.notification-detail__body {
  margin-bottom: 2rem;
  color: #495057;
  line-height: 1.6;
}

.notification-detail__metadata {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
}

.notification-detail__metadata-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6c757d;
  margin: 0 0 1rem;
  text-transform: uppercase;
}

.notification-detail__metadata-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}

.notification-detail__metadata-list dt {
  font-weight: 600;
  color: #495057;
  font-size: 0.875rem;
}

.notification-detail__metadata-list dd {
  color: #6c757d;
  font-size: 0.875rem;
  margin: 0;
  word-break: break-all;
}

.notification-detail__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
  .notifications__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .filters__group--actions {
    justify-content: stretch;
  }

  .filters__group--actions .btn {
    flex: 1;
  }

  .notification {
    padding: 1rem;
  }

  .notification__icon {
    width: 32px;
    height: 32px;
  }

  .notification__actions {
    flex-direction: column;
    margin-left: 0.5rem;
  }

  .modal__content {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }
}

/* Turbo Loading States */
turbo-frame[busy] {
  position: relative;
}

turbo-frame[busy]::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

turbo-frame[busy]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2rem;
  height: 2rem;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 2;
}
