/**
 * @file
 * CoupGo theme styles with modern color scheme.
 */

:root {
  /* Color Palette */
  --color-light-lime: #abd699;
  --color-fresh-lemon: #ffe26a;
  --color-teal: #75c9b7;
  --color-mint: #c7ddcc;
  --color-navy: #16123f;
  --color-blue: #203647;

  /* Semantic Colors */
  --color-primary: var(--color-teal);
  --color-secondary: var(--color-light-lime);
  --color-accent: var(--color-fresh-lemon);
  --color-background: #ffffff;
  --color-text: var(--color-navy);
  --color-text-light: #ffffff;
  --color-border: var(--color-blue);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(22, 18, 63, 0.1);
  --shadow-md: 0 4px 8px rgba(22, 18, 63, 0.15);
  --shadow-lg: 0 8px 16px rgba(22, 18, 63, 0.2);
}

/* Global box-sizing fix */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Global Styles */
html {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
}

body {
  color: #1e293b;
  background-color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Remove whitespace from page wrapper */
.page-wrapper {
  margin: 0;
  padding: 0;
  background: #ffffff;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.main-content {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.layout-content {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Headers */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-navy);
  font-weight: 600;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-md);
}

h2 {
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-sm);
}

/* Links */
a {
  color: var(--color-teal);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--color-light-lime);
  text-decoration: underline;
}

a:active {
  color: var(--color-navy);
}

/* Override general link styles for header links to prevent green color */
.floating-header a.header-link,
.floating-header .header-link,
.floating-header a.button.header-link,
.floating-header .header-menu a {
  color: #cbd5e1 !important;
}

.floating-header a.header-link:hover,
.floating-header a.header-link:focus,
.floating-header .header-link:hover,
.floating-header .header-link:focus,
.floating-header a.button.header-link:hover,
.floating-header a.button.header-link:focus,
.floating-header .header-menu a:hover,
.floating-header .header-menu a:focus,
.floating-header .header-menu li a:hover,
.floating-header .header-menu li a:focus {
  color: #ffffff !important;
  text-decoration: none !important;
  background-color: #06b6d4 !important;
}

/* Buttons */
.button,
button,
input[type="submit"],
input[type="button"] {
  background-color: var(--color-teal);
  color: var(--color-text-light);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--spacing-xs) var(--spacing-md);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  max-width: 100%;
  word-wrap: break-word;
}

.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background-color: var(--color-light-lime);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Override button hover for header links to prevent green */
.floating-header .button:hover,
.floating-header a.button:hover,
.floating-header .header-link.button:hover,
.floating-header .header-menu .button:hover,
.floating-header .header-menu a.button:hover,
.floating-header .header-menu a:hover,
.floating-header .header-menu li a:hover {
  background-color: #06b6d4 !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

.button:active,
button:active,
input[type="submit"]:active,
input[type="button"]:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.button--primary {
  background-color: var(--color-teal);
}

.button--primary:hover {
  background-color: var(--color-light-lime);
}

/* Override button--primary hover for header links to prevent green */
.floating-header .button--primary:hover,
.floating-header a.button--primary:hover,
.floating-header .header-link.button--primary:hover,
.floating-header .header-menu .button--primary:hover,
.floating-header .header-menu a.button--primary:hover {
  background-color: #06b6d4 !important;
  color: #ffffff !important;
}

.button--secondary {
  background-color: var(--color-mint);
  color: var(--color-navy);
}

.button--secondary:hover {
  background-color: var(--color-light-lime);
  color: var(--color-text-light);
}

.button--small {
  padding: 0.25rem var(--spacing-sm);
  font-size: 0.875rem;
}

/* Floating Header - Complementary Colors */
.floating-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #334155;
  color: #f1f5f9;
  border-bottom: 1px solid #475569;
  transition: background-color 0.2s ease;
}

.floating-header * {
  color: #f1f5f9;
}

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

.header-left {
  display: flex;
  align-items: center;
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #f1f5f9 !important;
  font-weight: 700;
  font-size: 1.5rem;
  transition: opacity 0.2s ease;
}

.site-logo:hover {
  color: #06b6d4 !important;
  text-decoration: none;
  opacity: 0.8;
}

.site-logo-image {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.site-name {
  margin-left: 0.5rem;
  color: #f1f5f9 !important;
}

.header-right {
  display: flex;
  align-items: center;
  position: relative;
}

/* Hamburger Menu Toggle Button */
.hamburger-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  flex-direction: column;
  justify-content: space-around;
  width: 2rem;
  height: 2rem;
  position: relative;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 100%;
  height: 100%;
}

.hamburger-icon span {
  width: 100%;
  height: 3px;
  background-color: #f1f5f9;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger-menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

.header-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1rem;
  align-items: center;
}

.header-menu li {
  margin: 0;
}

.floating-header a.header-link,
.floating-header .header-link,
.floating-header a.button.header-link {
  color: #cbd5e1 !important;
  text-decoration: none !important;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
  display: inline-block;
  background-color: transparent;
  border: none;
}

.floating-header a.header-link:hover,
.floating-header a.header-link:focus,
.floating-header .header-link:hover,
.floating-header .header-link:focus,
.floating-header a.button.header-link:hover,
.floating-header a.button.header-link:focus,
.floating-header a.header-link:hover,
.floating-header a.header-link:focus {
  background-color: #06b6d4 !important;
  color: #ffffff !important;
  text-decoration: none !important;
  border-color: transparent !important;
}

.floating-header a.header-link:active,
.floating-header .header-link:active,
.floating-header a.button.header-link:active,
.floating-header a.header-link:active {
  background-color: #0891b2 !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

/* Add padding to body to account for fixed header */
body {
  padding-top: 70px;
  margin: 0;
  background: #ffffff;
}

/* Header */
.region-header {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-teal) 100%);
  color: var(--color-text-light);
  padding: var(--spacing-md) 0;
  box-shadow: var(--shadow-md);
}

/* Navigation */
.menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--spacing-md);
}

.menu a {
  color: var(--color-text-light);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.menu a:hover,
.menu a:focus {
  background-color: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

/* Content Area */
.main-content {
  padding-top: 1rem;
}

.layout-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-lg) 2rem;
  width: 100%;
  box-sizing: border-box;
}

/* Prevent horizontal overflow on mobile */
@media (max-width: 768px) {
  .layout-content {
    padding: var(--spacing-lg) 1rem;
  }

  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
}

/* Cards */
.card,
.dashboard-card {
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.card:hover,
.dashboard-card:hover {
  box-shadow: var(--shadow-md);
}

/* Forms */
.form-item {
  margin-bottom: var(--spacing-md);
}

.form-item label {
  color: var(--color-navy);
  font-weight: 500;
  margin-bottom: var(--spacing-xs);
  display: block;
}

.form-text,
.form-email,
.form-tel,
.form-url,
.form-textarea,
.form-select {
  width: 100%;
  max-width: 100%;
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.form-element:hover:focus {
  box-shadow: none;
}

.form-text:focus,
.form-email:focus,
.form-tel:focus,
.form-url:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  box-shadow: none;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--spacing-md);
}

table th {
  background-color: var(--color-mint);
  color: var(--color-navy);
  padding: var(--spacing-sm);
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--color-teal);
}

table td {
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
}

table tr:hover {
  background-color: rgba(199, 221, 204, 0.3);
}

/* Messages */
.messages {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  border-left: 4px solid;
}

.messages--status {
  background-color: rgba(199, 221, 204, 0.3);
  border-color: var(--color-light-lime);
  color: var(--color-navy);
}

.messages--warning {
  background-color: rgba(255, 226, 106, 0.3);
  border-color: var(--color-fresh-lemon);
  color: var(--color-navy);
}

.messages--error {
  background-color: rgba(255, 0, 0, 0.1);
  border-color: #ff0000;
  color: var(--color-navy);
}

/* Footer */
.region-footer {
  background-color: var(--color-navy);
  color: var(--color-text-light);
  padding: var(--spacing-lg) 0;
  margin-top: var(--spacing-xl);
}

.region-footer a {
  color: var(--color-teal);
}

.region-footer a:hover {
  color: var(--color-light-lime);
}

/* Local Actions */
.local-actions {
  display: flex;
  gap: var(--spacing-sm);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-md) 0;
}

.local-actions__item {
  display: inline-block;
}

/* Statistics Cards */
.stat-card {
  background: linear-gradient(135deg, var(--color-mint) 0%, var(--color-light-lime) 100%);
  border: 2px solid var(--color-teal);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-fresh-lemon);
}

.stat-card.active {
  background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-light-lime) 100%);
  border-color: var(--color-fresh-lemon);
  box-shadow: var(--shadow-md);
}

/* Dashboard Cards */
.dashboard-card {
  background: linear-gradient(135deg, rgba(199, 221, 204, 0.5) 0%, rgba(171, 214, 153, 0.3) 100%);
  border: 2px solid var(--color-mint);
}

.dashboard-card:hover {
  border-color: var(--color-teal);
}

/* Login Form Styling */
.path-user-login .layout-content,
.path-user .layout-content {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 200px);
  padding-top: 3rem;
}

.user-login-form,
.user-form {
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  background: #ffffff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-login-form h1,
.user-form h1 {
  text-align: center;
  margin-bottom: 2rem;
  color: #1e293b;
}

.user-login-form .form-item,
.user-form .form-item {
  margin-bottom: 1.5rem;
}

.user-login-form .form-actions,
.user-form .form-actions {
  margin-top: 2rem;
  text-align: center;
}

.user-login-form .button,
.user-form .button {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: #06b6d4;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.user-login-form .button:hover,
.user-form .button:hover {
  background: #0891b2;
}

.user-login-form .user-links,
.user-form .user-links {
  margin-top: 1.5rem;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.user-login-form .user-links a,
.user-form .user-links a {
  display: inline-block;
  margin: 0.5rem 1rem;
  color: #06b6d4;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.user-login-form .user-links a:hover,
.user-form .user-links a:hover {
  color: #0891b2;
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .menu {
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .layout-content {
    padding: var(--spacing-md) 1rem;
  }

  .floating-header .header-container {
    padding: 0.75rem 1rem;
  }

  .site-logo {
    font-size: 1.25rem;
  }

  /* Show hamburger button on mobile */
  .hamburger-menu-toggle {
    display: flex;
  }

  /* Hide menu by default on mobile */
  .header-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: #334155;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 0;
    margin: 0;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  /* Show menu when hamburger is active */
  .header-menu.menu-open {
    max-height: 500px;
    padding: 1rem 0;
  }

  .header-menu li {
    width: 100%;
    margin: 0;
    border-bottom: 1px solid #475569;
  }

  .header-menu li:last-child {
    border-bottom: none;
  }

  .floating-header a.header-link,
  .floating-header .header-link,
  .floating-header a.button.header-link,
  .floating-header .header-menu a,
  .floating-header .header-menu a.button,
  .floating-header .header-menu a.button--primary {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    text-align: left;
    border-radius: 0;
    font-size: 1rem;
    color: #cbd5e1 !important;
    background-color: transparent !important;
  }

  .floating-header a.header-link:hover,
  .floating-header a.header-link:focus,
  .floating-header .header-link:hover,
  .floating-header .header-link:focus,
  .floating-header a.button.header-link:hover,
  .floating-header a.button.header-link:focus,
  .floating-header a.header-link:hover,
  .floating-header a.header-link:focus,
  .floating-header .header-menu a:hover,
  .floating-header .header-menu a:focus,
  .floating-header .header-menu a.button:hover,
  .floating-header .header-menu a.button:focus,
  .floating-header .header-menu a.button--primary:hover,
  .floating-header .header-menu a.button--primary:focus {
    background-color: #06b6d4 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-color: transparent !important;
  }

  .floating-header a.header-link:active,
  .floating-header .header-link:active,
  .floating-header a.button.header-link:active,
  .floating-header a.header-link:active,
  .floating-header .header-menu a:active,
  .floating-header .header-menu a.button:active,
  .floating-header .header-menu a.button--primary:active {
    background-color: #0891b2 !important;
    color: #ffffff !important;
    border-color: transparent !important;
  }

  .path-user-login .layout-content,
  .path-user .layout-content {
    padding-top: 2rem;
    min-height: calc(100vh - 150px);
  }

  .user-login-form,
  .user-form {
    max-width: 100%;
    padding: 1.5rem;
  }
}

/* User Account Page Styling */
.user-account-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.user-account-container {
  background: #ffffff;
}

.user-account-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.user-account-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.user-account-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Two-column layout on desktop */
@media (min-width: 769px) {
  .user-account-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
  }
}

.account-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
}

.account-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.account-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.account-detail-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.detail-label {
  font-weight: 600;
  color: #475569;
  min-width: 150px;
}

.detail-value {
  color: #1e293b;
  flex: 1;
}

.account-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.account-actions .button,
.account-actions .button--primary {
  padding: 0.75rem 1.5rem !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  text-decoration: none !important;
  display: inline-block !important;
  transition: background-color 0.2s ease !important;
  border: none !important;
  background: #06b6d4 !important;
  color: #ffffff !important;
  box-shadow: none !important;
  cursor: pointer;
}

.account-actions .button:hover,
.account-actions .button--primary:hover {
  background: #0891b2 !important;
  color: #ffffff !important;
}

@media (max-width: 768px) {
  .user-account-page {
    padding: 1rem 0.5rem;
  }

  .account-section {
    padding: 1rem;
  }

  .account-detail-item {
    flex-direction: column;
  }

  .detail-label {
    min-width: auto;
  }

  .account-actions {
    flex-direction: column;
  }

  .account-actions .button {
    width: 100%;
    text-align: center;
  }
}

