/* Accessibility: disclaimer notice - sufficient contrast (WCAG AA) */
.disclaimer-notice {
  background: #f0e6c8;
  color: #4a3c0a;
}

.disclaimer-notice strong {
  color: #3d3208;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: white;
  font-size: 24px;
  font-weight: 700;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.logo-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.logo-text {
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  order: 2;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: white;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.header-nav {
  display: flex;
  gap: 5px;
  align-items: center;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: left 0.3s ease;
  z-index: -1;
}

.nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-link:hover::before {
  left: 0;
}

.nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

.nav-link.active::before {
  left: 0;
  background: rgba(255, 255, 255, 0.2);
}

@media screen and (max-width: 768px) {
  .header-container {
    padding: 12px 20px;
    position: relative;
  }
  .logo {
    font-size: 20px;
    order: 1;
    flex: 1;
  }
  .logo-icon {
    font-size: 24px;
  }
  .menu-toggle {
    display: flex !important;
    order: 2;
    margin-left: auto;
  }
  .header-nav {
    order: 3;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-direction: column;
    width: 100%;
    padding: 20px;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
  }
  .header-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-link {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    text-align: left;
    border-radius: 8px;
  }
}
@media screen and (max-width: 480px) {
  .header-container {
    padding: 10px 15px;
  }
  .logo {
    font-size: 18px;
  }
  .logo-icon {
    font-size: 22px;
  }
}
/* Footer Styles */
.footer {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  margin-top: 50px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 30px 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
}

.footer-logo-icon {
  font-size: 26px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.footer-logo-text {
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: right;
}

.footer-contact {
  margin: 0;
  font-size: 15px;
}

.footer-contact a {
  color: white;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.footer-contact a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.footer-links {
  margin: 0;
  font-size: 14px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: white;
  text-decoration: underline;
}

.footer-separator {
  margin: 0 10px;
  color: rgba(255, 255, 255, 0.85);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.95);
}

@media screen and (max-width: 768px) {
  .footer-container {
    padding: 30px 20px 15px;
  }
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 25px;
  }
  .footer-info {
    text-align: center;
    width: 100%;
  }
  .footer-logo {
    justify-content: center;
  }
}
@media screen and (max-width: 480px) {
  .footer-container {
    padding: 25px 15px 15px;
  }
  .footer-logo {
    font-size: 20px;
  }
  .footer-logo-icon {
    font-size: 24px;
  }
  .footer-contact {
    font-size: 14px;
  }
  .footer-links {
    font-size: 13px;
  }
  .footer-bottom {
    font-size: 12px;
  }
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  position: relative;
}

/* AdSense Sidebar Styles (Desktop) */
.ads-sidebar {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  max-width: 160px;
  z-index: 100;
  display: none; /* Hidden by default, shown on desktop */
}

.ads-sidebar-left {
  left: 20px;
}

.ads-sidebar-right {
  right: 20px;
}

.ads-sidebar .adsbygoogle {
  display: block;
  margin: 0 auto;
}

/* AdSense Bottom Ad (Mobile) */
.ads-bottom {
  display: none; /* Hidden by default, shown on mobile */
  width: 100%;
  max-width: 100%;
  margin: 20px auto;
  text-align: center;
  padding: 0 15px;
  position: relative;
  z-index: 1;
}

.ads-bottom .adsbygoogle {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

/* Adjust container to accommodate sidebars on desktop */
@media screen and (min-width: 1400px) {
  .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px;
  }
  
  .ads-sidebar {
    display: block;
  }
}

@media screen and (min-width: 1200px) and (max-width: 1399px) {
  .ads-sidebar {
    width: 140px;
    max-width: 140px;
  }
  
  .ads-sidebar-left {
    left: 10px;
  }
  
  .ads-sidebar-right {
    right: 10px;
  }
  
  .ads-sidebar {
    display: block;
  }
}

/* Show bottom ad on mobile/tablet */
@media screen and (max-width: 1199px) {
  .ads-sidebar {
    display: none !important;
  }
  
  .ads-bottom {
    display: block;
  }
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 30px;
  position: relative;
  z-index: 1;
}

h1 {
  color: #667eea;
  text-align: center;
  margin-bottom: 30px;
  font-size: 2em;
}

.section {
  margin-bottom: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
}

.section h2 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.4em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

input, select, button {
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
}

input:focus, select:focus {
  outline: none;
  border-color: #667eea;
}

input[type=text], input[type=number] {
  flex: 1;
  min-width: 150px;
}

button {
  background: #667eea;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  padding: 12px 20px;
}

button:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-danger {
  background: #e74c3c;
  padding: 8px 12px;
  font-size: 12px;
}

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

.btn-secondary {
  background: #95a5a6;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

.member-list, .expense-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-item, .expense-item {
  background: white;
  padding: 15px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.expense-item {
  flex-direction: column;
  align-items: flex-start;
}

.expense-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.expense-details {
  width: 100%;
  color: #666;
  font-size: 14px;
}

.receipt-preview {
  max-width: 80px;
  max-height: 80px;
  margin: 5px;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid #ddd;
}

.receipts-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.summary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 10px;
  text-align: center;
}

.summary h3 {
  font-size: 1.5em;
  margin-bottom: 15px;
}

.summary .amount {
  font-size: 2.5em;
  font-weight: bold;
  margin: 10px 0;
}

.per-person {
  background: rgba(255, 255, 255, 0.2);
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
}

.per-person div {
  margin: 8px 0;
  font-size: 1.1em;
}

.empty-state {
  text-align: center;
  color: #5a5a5a;
  padding: 20px;
  font-style: italic;
}

input[type=file] {
  padding: 8px;
  width: fit-content;
}
@media (max-width: 600px) {
  input[type=file] {
    width: 100%;
  }
}

.file-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
}

.currency-rates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.rate-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
}

.rate-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.rate-item label {
  font-weight: 700;
  min-width: 60px;
  color: #667eea;
  font-size: 14px;
}

.rate-item input {
  flex: 1;
  padding: 10px;
  margin: 0;
  border: 2px solid #e0e0e0;
  font-weight: 600;
}

.rate-item input:focus {
  border-color: #667eea;
}

.rate-item span {
  font-weight: 700;
  color: #764ba2;
  min-width: 40px;
}

.target-currency {
  margin-bottom: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.target-currency label {
  font-weight: 600;
  color: white;
  font-size: 1.1em;
  display: block;
  margin-bottom: 10px;
}

.target-currency select {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  border: 3px solid white;
  background: white;
  color: #333;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.target-currency select:hover {
  border-color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.target-currency select:focus {
  border-color: #ffd700;
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.3);
}

.participants {
  margin-top: 10px;
  padding: 10px;
  background: #f1f3f5;
  border-radius: 8px;
  font-size: 13px;
}

.participants-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.participants-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.participants-list label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.welcome-screen {
  text-align: center;
  padding: 60px 20px;
}

.welcome-screen h2 {
  color: #667eea;
  font-size: 2.5em;
  margin-bottom: 20px;
}

.welcome-screen p {
  color: #666;
  font-size: 1.2em;
  margin-bottom: 40px;
}

.welcome-screen button {
  padding: 20px 40px;
  font-size: 18px;
  margin: 10px;
}

.share-link-section {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 30px;
  color: white;
  box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.share-link-section h3 {
  margin-bottom: 15px;
  font-size: 1.3em;
}

.share-link-box {
  display: flex;
  gap: 10px;
  align-items: center;
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-top: 10px;
}

.share-link-box input {
  flex: 1;
  border: none;
  font-size: 14px;
  color: #333;
  font-weight: 600;
}

.share-link-box input:focus {
  outline: none;
}

.copy-btn {
  background: #27ae60;
  padding: 10px 20px;
  white-space: nowrap;
}

.copy-btn:hover {
  background: #229954;
}

#app {
  display: none;
}

#app.active {
  display: block;
}

.group-header {
  text-align: center;
  margin-bottom: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
}

.group-header h2 {
  color: white;
  margin: 0;
  font-size: 1.8em;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  padding: 20px 24px;
  border-radius: 12px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  max-height: 80vh;
  overflow-y: auto;
}

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

.modal h3 {
  margin-bottom: 10px;
  font-size: 1.1em;
}

.modal p {
  margin-bottom: 20px;
  font-size: 0.95em;
  color: #555;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  font-size: 0.9em;
  cursor: pointer;
}

.modal-cancel {
  background: #e5e7eb;
  color: #111827;
}

.modal-confirm {
  background: #e74c3c;
  color: #fff;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
  pointer-events: auto;
}

.toast-success {
  background: #27ae60;
}

.toast-error {
  background: #e74c3c;
}

.currency-selection {
  margin-top: 15px;
  padding: 15px;
  background: white;
  border-radius: 10px;
}
@media (max-width: 600px) {
  .currency-selection .input-group {
    flex-direction: column;
  }
}

.currency-selection label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.currency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.currency-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.currency-checkbox:hover {
  background: #e9ecef;
}

.currency-checkbox input[type=checkbox] {
  margin: 0;
  cursor: pointer;
}

.history-log {
  max-height: 500px;
  overflow-y: auto;
}

.history-item {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 4px solid #667eea;
}

.history-item.member_added {
  border-left-color: #27ae60;
}

.history-item.member_removed {
  border-left-color: #e74c3c;
}

.history-item.expense_added {
  border-left-color: #3498db;
}

.history-item.expense_removed {
  border-left-color: #e67e22;
}

.history-item.rates_updated {
  border-left-color: #9b59b6;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-action {
  font-weight: 600;
  color: #333;
}

.history-time {
  font-size: 12px;
  color: #5a5a5a;
}

.history-by {
  font-size: 13px;
  color: #666;
  margin-bottom: 5px;
}

.history-details {
  font-size: 14px;
  color: #555;
}

@media (max-width: 600px) {
  .container {
    padding: 20px;
  }
  h1 {
    font-size: 1.5em;
  }
  .input-group {
    flex-direction: column;
  }
  input[type=text], input[type=number] {
    width: 100%;
  }
  .currency-rates {
    grid-template-columns: 1fr;
  }
  .welcome-screen h2 {
    font-size: 1.8em;
  }
  .welcome-screen button {
    width: 100%;
    padding: 15px;
  }
  .share-link-box {
    flex-direction: column;
  }
  .copy-btn {
    width: 100%;
  }
  .currency-grid {
    grid-template-columns: 1fr;
  }
}
