/* ========================================
   🎨 Base Layout & Navbar Styles
   ======================================== */

/* Modern Gradient Background */
.bg-facebook {
  background: linear-gradient(135deg, #1877F2 0%, #0d5dbf 50%, #084a99 100%);
  box-shadow: 0 4px 20px rgba(24, 119, 242, 0.4);
  position: relative;
  overflow: hidden;
  height: 100%;
}

/* ✅ Navbar Z-Index Fix - แก้ให้ชัดเจน */
.navbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 1050 !important;
  width: 100%;
}

/* ✅ Dropdown Menu Z-Index - ให้สูงกว่าเนื้อหาในเว็บ */
.navbar .dropdown-menu {
  z-index: 1055 !important; /* ✅ เพิ่มจาก 1060 */
  position: absolute !important;
}

/* ✅ Navbar Collapse Z-Index */
.navbar-collapse {
  z-index: 1052 !important;
}

/* ✅ Ensure dropdowns are visible and clickable */
.navbar .dropdown-menu.show {
  display: block !important;
  z-index: 1055 !important;
  pointer-events: auto !important;
}

/* ✅ Fix dropdown items clickable */
.navbar .dropdown-item {
  z-index: auto !important; /* ✅ เปลี่ยนจาก 1061 */
  position: relative !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* ✅ Fix navbar-nav positioning */
.navbar-nav .dropdown {
  position: relative !important;
  z-index: auto !important; /* ✅ เปลี่ยนจาก 1056 */
}

/* ========================================
   🌐 Multi-Language Font Support
   ======================================== */

/* Default font for English and Thai */
html[lang="en"],
html[lang="th"] {
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

/* Font for Traditional Chinese */
html[lang="zh"] {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

/* Ensure all text elements inherit the font */
body,
button,
input,
select,
textarea,
.navbar,
.navbar-brand,
.nav-link,
.dropdown-item,
.btn,
.form-control,
.form-select,
.card,
.modal,
.alert {
  font-family: inherit;
}

/* Optimize font rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Adjust font weights for better readability */
html[lang="zh"] {
  font-weight: 400;
}

html[lang="zh"] h1,
html[lang="zh"] h2,
html[lang="zh"] h3,
html[lang="zh"] h4,
html[lang="zh"] h5,
html[lang="zh"] h6,
html[lang="zh"] .fw-bold,
html[lang="zh"] strong {
  font-weight: 600;
}

/* Wave Animation Container */
.ocean {
  height: 40%;
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  overflow: hidden;
  z-index: 0;
}

.wave {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 88.7'%3E%3Cpath d='M800 56.9c-155.5 0-204.9-50-405.5-49.9-200 0-250 49.9-394.5 49.9v31.8h800v-.2-31.6z' fill='rgba(255,255,255,0.1)'/%3E%3C/svg%3E") repeat-x;
  position: absolute;
  width: 6400px;
  height: 100%;
  animation: wave 28s cubic-bezier(0.36, 0.45, 0.63, 0.53) infinite;
  transform: translate3d(0, 0, 0);
  top: 0;
  z-index: 0;
}

.wave:nth-of-type(2) {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 88.7'%3E%3Cpath d='M800 56.9c-155.5 0-204.9-50-405.5-49.9-200 0-250 49.9-394.5 49.9v31.8h800v-.2-31.6z' fill='rgba(255,255,255,0.15)'/%3E%3C/svg%3E") repeat-x;
  animation: wave 28s cubic-bezier(0.36, 0.45, 0.63, 0.53) -0.5s infinite, 
             swell 28s ease -5s infinite;
  opacity: 1;
  top: 10px;
  z-index: 0;
}

@keyframes wave {
  0% {
    margin-left: 0;
  }
  100% {
    margin-left: -1600px;
  }
}

@keyframes swell {
  0%, 100% {
    transform: translate3d(0, -15px, 0);
  }
  50% {
    transform: translate3d(0, 5px, 0);
  }
}

/* Navbar Styles */
.navbar {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 9999;
  isolation: isolate;
}

.navbar > .container-fluid {
  position: relative;
  z-index: 10;
}

.navbar-brand {
  font-size: 1.4rem;
  color: #fff !important;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
}

.navbar-brand:hover {
  transform: scale(1.05);
  text-shadow: 3px 3px 8px rgba(0,0,0,0.3);
}

/* Navigation Links */
.navbar-nav {
  gap: 8px;
  position: relative;
  z-index: 10;
}

.navbar-nav .nav-link {
  color: white !important;
  font-weight: 500;
  padding: 10px 10px !important;
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  margin: 0 4px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
}

/* Hover Effect with Glassmorphism */
.navbar-nav .nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.navbar-nav .nav-link:hover::before {
  left: 100%;
}

.navbar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2), 
              inset 0 1px 1px rgba(255,255,255,0.3);
}

.navbar-nav .nav-link:active {
  transform: translateY(0) scale(0.98);
}

/* Icon Animation */
.navbar-nav .nav-link i {
  transition: all 0.3s ease;
  display: inline-block;
}

.navbar-nav .nav-link:hover i {
  transform: rotate(10deg) scale(1.2);
}

/* Dropdown Styles */
.dropdown-menu {
  background: linear-gradient(135deg, rgba(24, 119, 242, 0.95) 0%, rgba(13, 93, 191, 0.95) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  padding: 12px 8px;
  margin-top: 8px;
  z-index: 10000 !important;
  position: absolute !important;
}

.dropdown-menu .dropdown-item {
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  margin: 4px 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Dropdown Item Hover Effect */
.dropdown-menu .dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 0;
  background: white;
  transition: height 0.3s ease;
  transform: translateY(-50%);
  border-radius: 0 4px 4px 0;
}

.dropdown-menu .dropdown-item:hover::before {
  height: 70%;
}

.dropdown-menu .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(8px);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.3);
}

.dropdown-menu .dropdown-item i {
  transition: all 0.3s ease;
  margin-right: 8px;
}

.dropdown-menu .dropdown-item:hover i {
  transform: scale(1.2) rotate(5deg);
}

/* Dropdown Divider */
.dropdown-divider {
  border-color: rgba(255,255,255,0.2);
  margin: 12px 0;
}

/* Logout Button Special Style */
.text-warning {
  background: rgba(255, 193, 7, 0.2);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.text-warning:hover {
  background: rgba(255, 193, 7, 0.35) !important;
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
}

/* Active State */
.dropdown-menu .dropdown-item.active {
  background: rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

/* Dropdown Toggle Active State */
.nav-item.dropdown.show > .nav-link {
  background: rgba(255, 255, 255, 0.2);
  z-index: 9998;
}

/* Ensure dropdown parent has proper stacking */
.nav-item.dropdown {
  position: relative;
}

.navbar-collapse {
  position: relative;
  z-index: 10;
}

.navbar .container-fluid {
  position: relative;
  z-index: 10;
}

/* Mobile Responsive */
@media (max-width: 991px) {
  .navbar-nav {
    gap: 4px;
    margin-top: 16px;
  }
  
  .navbar-nav .nav-link {
    margin: 4px 0;
  }

  .dropdown-menu {
    margin-top: 4px;
    position: relative !important;
  }
}

/* Body & Container Styles */
body {
  background-color: #f8f9fa;
  position: relative;
  z-index: 0;
}

.card {
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.section-title {
  background-color: #f1f1f1;
  padding: 10px 15px;
  font-weight: bold;
  border-radius: 0.375rem 0.375rem 0 0;
}

/* Container should not interfere */
.container {
  position: relative;
  z-index: 1 !important;
  isolation: isolate;
  margin-top: 20px;
  max-width: 1920px !important;
  width: 100%;
  padding-left: 15px;
  padding-right: 15px;
}

/* Force all content below navbar */
.container > * {
  position: relative;
  z-index: 1 !important;
}

.row {
  position: relative;
  z-index: 1 !important;
}

/* Alerts should stay below navbar */
.alert {
  position: relative;
  z-index: 1 !important;
}

/* Prevent overflow of navbar */
.navbar {
  overflow: visible !important;
}

.navbar-collapse {
  overflow: visible !important;
}

/* ========================================
   🎨 Shared Rewards Page Styles
   ======================================== */

/* Wide Container for Shared Rewards */
.shared-rewards-page .container-fluid {
  max-width: 98%;
  padding: 0 20px;
  margin: 0 auto;
}

/* Animated Background for Content Area */
.shared-rewards-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 30px;
  border-radius: 20px;
  margin-bottom: 30px;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.shared-rewards-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.shared-rewards-header h1 {
  color: white;
  font-weight: 700;
  margin: 0;
  font-size: 2.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}

/* Quick Actions Card */
.quick-actions-card {
  background: white;
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.08);
  border: 1px solid rgba(102, 126, 234, 0.1);
  transition: all 0.3s ease;
}

.quick-actions-card:hover {
  box-shadow: 0 8px 35px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.quick-actions-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-actions-title i {
  font-size: 1.5rem;
}

/* Search and Export Buttons */
.action-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 300px;
}

.search-wrapper input {
  width: 100%;
  padding: 12px 45px 12px 20px;
  border: 2px solid #e0e7ff;
  border-radius: 15px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-wrapper input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  outline: none;
}

.search-wrapper i {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #667eea;
  font-size: 1.2rem;
}

.export-btn {
  padding: 12px 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.export-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Modern Table Styles */
.table-wrapper {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.08);
  margin-bottom: 30px;
  overflow: hidden;
}

.modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}

.modern-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.modern-table thead th {
  padding: 18px 15px;
  color: white;
  font-weight: 600;
  text-align: left;
  border: none;
  white-space: nowrap;
  font-size: 0.9rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modern-table thead th:first-child {
  border-top-left-radius: 15px;
}

.modern-table thead th:last-child {
  border-top-right-radius: 15px;
}

.modern-table tbody tr {
  transition: all 0.3s ease;
  background: white;
}

.modern-table tbody tr:nth-child(even) {
  background: #f8f9ff;
}

.modern-table tbody tr:hover {
  background: linear-gradient(90deg, #f0f4ff 0%, #e8ecff 100%);
  transform: scale(1.01);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.modern-table tbody td {
  padding: 15px 15px;
  border: none;
  border-bottom: 1px solid #e8ecff;
  vertical-align: middle;
}

.modern-table tbody tr:last-child td {
  border-bottom: none;
}

/* Chart Container */
.chart-container {
  background: white;
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.08);
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.chart-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-title i {
  font-size: 1.8rem;
}

/* Badge Styles for Status */
.status-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
}

.status-verified {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.status-pending {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.status-rejected {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

/* Edit Button Modern Style */
.edit-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.edit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Loading State */
.table-loading {
  text-align: center;
  padding: 60px;
  color: #667eea;
  font-size: 1.2rem;
}

.table-loading i {
  font-size: 3rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Scrollbar Styling */
.table-wrapper::-webkit-scrollbar {
  height: 10px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Responsive Table */
@media (max-width: 1400px) {
  .table-wrapper {
    overflow-x: auto;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .shared-rewards-header h1 {
    font-size: 1.8rem;
  }

  .action-buttons {
    flex-direction: column;
  }

  .search-wrapper {
    min-width: 100%;
  }

  .export-btn {
    width: 100%;
    justify-content: center;
  }

  .modern-table {
    font-size: 0.85rem;
  }

  .modern-table thead th,
  .modern-table tbody td {
    padding: 10px 8px;
  }
}

/* Pagination Styles */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
  gap: 10px;
}

.pagination-btn {
  padding: 10px 20px;
  background: white;
  border: 2px solid #667eea;
  color: #667eea;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateY(-2px);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  color: #667eea;
  font-weight: 600;
  padding: 0 20px;
}

/* ========================================
   🌐 Language Selector Styles
   ======================================== */

.language-selector {
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 12px !important;
  padding: 10px 18px !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
}

.language-selector:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.language-selector i {
  font-size: 1.2rem;
  animation: rotate-globe 3s linear infinite;
}

@keyframes rotate-globe {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
}

#currentLanguage {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

/* Language Dropdown Menu */
.language-menu {
  min-width: 200px !important;
  padding: 10px !important;
  border-radius: 15px !important;
}

.language-option {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 2px 16px !important;
  border-radius: 10px !important;
  transition: all 0.3s ease !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  user-select: none;
}

.language-option:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: translateX(8px) !important;
}

.language-option:active {
  transform: translateX(8px) scale(0.98) !important;
}

.language-option.active {
  background: rgba(255, 255, 255, 0.35) !important;
  font-weight: 700 !important;
  position: relative;
}

.language-option.active::before {
  content: '✓';
  position: absolute;
  right: 16px;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
}

.flag-icon {
  font-size: 1.5rem;
  display: inline-block;
  transition: transform 0.3s ease;
}

.language-option:hover .flag-icon {
  transform: scale(1.2) rotate(10deg);
}

/* ✅ Loading cursor */
body[style*="cursor: wait"] {
  pointer-events: none;
}

body[style*="cursor: wait"] * {
  cursor: wait !important;
}

/* Mobile Responsive for Language Selector */
@media (max-width: 991px) {
  .language-selector {
    margin: 8px 0;
    justify-content: center;
  }
  
  .language-menu {
    position: relative !important;
    width: 100%;
  }
}

/* ========================================
   🌐 MULTI-LANGUAGE FONT SUPPORT
   ======================================== */

/* ✅ Default: Thai & English */
:root,
html,
body {
  font-family: 'Noto Sans Thai', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ✅ Chinese Traditional (when lang="zh" is set on <html>) */
html[lang="zh"],
html[lang="zh"] * {
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', 'Apple LiGothic', sans-serif !important;
}

/* ✅ Thai (when lang="th" is set on <html>) */
html[lang="th"],
html[lang="th"] * {
  font-family: 'Noto Sans Thai', 'Leelawadee UI', 'Cordia New', sans-serif !important;
}

/* ✅ English (when lang="en" is set on <html>) */
html[lang="en"],
html[lang="en"] * {
  font-family: 'Noto Sans Thai', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
}

/* ✅ Exclude monospace elements from font override */
html[lang] code,
html[lang] pre,
html[lang] kbd,
html[lang] samp,
html[lang] .code-input,
html[lang] .font-monospace {
  font-family: 'Courier New', Consolas, Monaco, monospace !important;
}

/* ✅ Preserve icon fonts */
html[lang] .fas,
html[lang] .far,
html[lang] .fab,
html[lang] .fa,
html[lang] [class*="fa-"] {
  font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands' !important;
}

/* ========================================
   Modern Notification System
   ======================================== */
:root {
  --notification-success: #49a87d;
  --notification-error: #e74c3c;
  --notification-warning: #f39c12;
  --notification-info: #3498db;
  --notification-inset: 2rem;
  
  /* SVG Icons */
  --check-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23ffffff'%3E%3Cpath d='M400-314.46 250.46-464 296-509.54l104 104 264-264L709.54-624 400-314.46Z'/%3E%3C/svg%3E");
  --error-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23ffffff'%3E%3Cpath d='m336-280 144-144 144 144 56-56-144-144 144-144-56-56-144 144-144-144-56 56 144 144-144 144 56 56Z'/%3E%3C/svg%3E");
  --warning-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23ffffff'%3E%3Cpath d='M440-280h80v-240h-80v240Zm40-320q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm0 520q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z'/%3E%3C/svg%3E");
  --info-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23ffffff'%3E%3Cpath d='M440-280h80v-240h-80v240Zm40-320q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm0 520q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z'/%3E%3C/svg%3E");
}

.notification {
  color: rgba(0, 0, 0, 0.7);
  position: fixed;
  display: flex;
  font-size: 1rem;
  letter-spacing: 0.5px;
  line-height: 1.4;
  gap: 1.5rem;
  top: 0;
  right: 0;
  margin: var(--notification-inset);
  width: 24rem;
  background-color: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  max-width: calc(100% - 6rem);
  z-index: 9999;
  padding: 1.5rem 1.25rem 1.25rem;
  overflow: clip;
  transform: translateX(calc(100% + var(--notification-inset)));
  animation: slideInOut 5s cubic-bezier(0.33, 0, 0.66, 1);
  animation-fill-mode: forwards;
}

.notification:hover {
  animation-play-state: paused;
}

.notification::before {
  content: "";
  display: block;
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background-color: var(--notification-success);
  transform-origin: left;
  animation: countdown 5s linear;
  animation-fill-mode: forwards;
}

.notification:hover::before {
  animation-play-state: paused;
}

/* Notification Types */
.notification-success::before {
  background-color: var(--notification-success);
}

.notification-success .notification__icon {
  background-color: var(--notification-success);
  background-image: var(--check-svg);
}

.notification-error::before,
.notification-danger::before {
  background-color: var(--notification-error);
}

.notification-error .notification__icon,
.notification-danger .notification__icon {
  background-color: var(--notification-error);
  background-image: var(--error-svg);
}

.notification-warning::before {
  background-color: var(--notification-warning);
}

.notification-warning .notification__icon {
  background-color: var(--notification-warning);
  background-image: var(--warning-svg);
}

.notification-info::before {
  background-color: var(--notification-info);
}

.notification-info .notification__icon {
  background-color: var(--notification-info);
  background-image: var(--info-svg);
}

.notification__icon {
  border-radius: 50%;
  display: block;
  aspect-ratio: 1;
  background-size: 2rem;
  background-color: var(--notification-success);
  background-image: var(--check-svg);
  background-repeat: no-repeat;
  background-position: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: auto;
  flex-shrink: 0;
}

.notification__body {
  flex: 1;
  min-width: 0;
}

.notification__header {
  color: #000;
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.notification__text {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
  word-wrap: break-word;
}

.notification__action {
  margin-left: auto;
}

.notification__close {
  appearance: none;
  background: transparent;
  border: none;
  font: inherit;
  margin: 0;
  padding: 0;
  color: #999;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  transition: color 0.2s;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification__close:hover {
  color: #333;
}

/* Animations */
@keyframes slideInOut {
  0% {
    transform: translateX(calc(100% + var(--notification-inset)));
  }
  10%, 90% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100% + var(--notification-inset)));
    opacity: 0;
  }
}

@keyframes countdown {
  0% {
    transform: scaleX(1);
  }
  90%, 100% {
    transform: scaleX(0);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .notification {
    width: calc(100% - 4rem);
    margin: 1rem 2rem;
    font-size: 0.9rem;
  }
  
  .notification__header {
    font-size: 1rem;
  }
  
  .notification__text {
    font-size: 0.85rem;
  }
}

/* Multiple Notifications Stack */
.notification + .notification {
  margin-top: calc(var(--notification-inset) + 5.5rem);
}
