/*
 * Application-wide base styles
 * Rails 8 uses Propshaft instead of Sprockets
 * Individual stylesheets are loaded via stylesheet_link_tag in layouts
 */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f7fafc;
  color: #2d3748;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Application Header */
.app-header {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

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

.app-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #2d3748;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.3s ease;
}

.app-logo:hover {
  opacity: 0.8;
}

.app-logo img {
  height: 40px;
  width: auto;
}

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

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: #667eea;
  border-radius: 3px;
  transition: all 0.3s ease;
}

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

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

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

.mobile-user-email {
  display: none;
}

.balance-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.balance-display:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.balance-amount {
  font-weight: 700;
}

.balance-currency {
  opacity: 0.9;
  font-size: 0.9rem;
}

.header-link {
  color: #667eea;
  text-decoration: none;
  padding: 0.5rem 1rem;
  background: #f7fafc;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.header-link:hover {
  background: #edf2f7;
  color: #764ba2;
}

.user-email {
  color: #4a5568;
  font-size: 0.9rem;
}

.logout-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.logout-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  flex: 1 0 auto;
  width: 100%;
}

/* Alerts and Notices */
.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  font-weight: 500;
}

.alert-success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

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

/* Footer */
.app-footer {
  margin-top: auto;
  padding: 2rem;
  background: #2d3748;
  text-align: center;
  color: white;
  flex-shrink: 0;
}

.app-footer p {
  margin: 0;
  opacity: 0.9;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .app-header-container {
    position: relative;
  }

  .app-header-actions {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
  }

  .mobile-user-email {
    display: none;
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
    margin-bottom: 0.5rem;
  }

  .app-header-actions.active .mobile-user-email {
    display: block;
  }

  .app-header-actions.active {
    right: 0;
  }

  .balance-display,
  .header-link {
    width: 100%;
    justify-content: center;
  }

  .user-email {
    text-align: center;
    padding: 0.5rem;
  }

  .logout-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .app-logo img {
    height: 32px;
  }

  .app-header {
    padding: 0.75rem 0;
  }

  .balance-display {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }

  .header-link {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
}

* {
  box-sizing: border-box;
}