/* EqualPay Global Styles */

:root {
  --primary-color: #4CAF50;
  --primary-hover: #3b8e3f;
  --error-color: #f44336;
  --success-color: #5cb85c;
  --text-color: #333333;
  --text-muted: #666666;
  --card-background: #ffffff;
  --section-background: #f5f5f5;
  --section-hover-bg: #f0f0f0;
  --input-bg: #ffffff;
  --input-border: #dddddd;
  --border-color: #dddddd;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --header-bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #5cbb60;
    --primary-hover: #4CAF50;
    --error-color: #f44336;
    --success-color: #5cb85c;
    --text-color: #e0e0e0;
    --text-muted: #aaaaaa;
    --card-background: #333333;
    --section-background: #222222;
    --section-hover-bg: #2a2a2a; /* Darker hover background for dark mode */
    --section-hover-dark: #303030; /* Even darker for hover in dark mode */
    --input-bg: #444444;
    --input-border: #555555;
    --border-color: #444444;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --header-bg: #333333;
    --hover-bg-dark: #303030;
  }
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  max-width: 1200px;
  margin: 0 auto;
  background-color: var(--section-background);
  color: var(--text-color);
}

body.dialog-open {
  overflow: hidden;
}

/* Dialog open state - prevent scrolling */
body.dialog-open {
  overflow: hidden !important;
  position: relative;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-hover);
}

button, .button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px var(--shadow-color);
  outline: none;
  height: 48px;
  box-sizing: border-box;
}

button:hover, .button:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 3px 8px var(--shadow-color);
}

button:active, .button:active {
  box-shadow: 0 1px 3px var(--shadow-color);
}

button:focus, .button:focus {
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

button.secondary, .button.secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

button.secondary:hover, .button.secondary:hover {
  background-color: rgba(76, 175, 80, 0.1);
}

button.danger, .button.danger {
  background-color: var(--error-color);
}

button.danger:hover, .button.danger:hover {
  background-color: #d32f2f;
}

input, select, textarea {
  padding: 12px 16px;
  border-radius: 25px;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text-color);
  width: 100%;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: all 0.2s;
  height: 48px;
  box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* Fix for inputs and form elements to ensure consistency */
input, 
select, 
textarea, 
button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: inherit;
  max-width: 100%; /* Ensure inputs don't exceed parent width */
  box-sizing: border-box;
}

.card {
  background-color: var(--card-background);
  color: var(--text-color);
  border-radius: 16px;
  box-shadow: 0 4px 16px var(--shadow-color);
  padding: 24px;
  margin-bottom: 24px;
  transition: background-color 0.2s;
}

.card:hover {
  background-color: var(--section-hover-bg);
}

/* Add a class for dark mode friendly cards that can be used by web components */
.dark-mode-card {
  background-color: var(--card-background);
  color: var(--text-color);
  border-radius: 16px;
  box-shadow: 0 4px 16px var(--shadow-color);
  padding: 24px;
  margin-bottom: 24px;
  transition: background-color 0.2s;
}

.dark-mode-card:hover {
  background-color: var(--section-hover-bg);
}

header {
  background-color: var(--header-bg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 2px 12px var(--shadow-color);
  border-radius: 0 0 16px 16px;
}

header h1 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

header nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.nav-link {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 50px;
  transition: background-color 0.3s;
  color: var(--text-color);
  text-decoration: none;
}

.nav-link:hover {
  background-color: rgba(76, 175, 80, 0.1);
  color: var(--primary-color);
}

.container {
  padding: 0 1.5rem;
}

section, .section {
  background-color: var(--section-background);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px var(--shadow-color);
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.error-message {
  background-color: rgba(244, 67, 54, 0.1);
  color: var(--error-color);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid var(--error-color);
}

.success-message {
  background-color: rgba(76, 175, 80, 0.1);
  color: var(--success-color);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid var(--success-color);
}

@media (min-width: 768px) {
  .container {
    display: flex;
  }
  
  aside {
    width: 300px;
    margin-right: 1.5rem;
  }
  
  main {
    flex: 1;
  }
  
  .card {
    padding: 32px;
  }
}

/* Form groups */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* List styles */
ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Special list item styling for app lists */
.item-list li {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-list li:hover {
  box-shadow: 0 2px 8px var(--shadow-color);
  border-color: var(--primary-color);
  background-color: var(--section-hover-bg);
}

/* Loading indicator */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  color: var(--text-color);
  opacity: 0.7;
}

.loading:after {
  content: "";
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Grid layouts */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* Utility classes */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Button groups */
.button-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  body {
    padding: 0;
  }
  
  .card, section, .section {
    border-radius: 12px;
    padding: 16px;
  }
  
  header {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  button, .button {
    width: 100%;
  }
  
  .button-group {
    flex-direction: column;
  }
}

/* Checkbox and radio customization */
input[type="checkbox"], input[type="radio"] {
  width: auto;
  height: auto;
  margin-right: 8px;
  accent-color: var(--primary-color);
}

/* Layout improvements */
.form-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 1rem;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Flexbox and Grid Layouts */
.flex-row {
  display: flex;
  flex-direction: row;
  gap: 16px;
  flex-wrap: wrap;
}

.flex-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.flex-grow {
  flex-grow: 1;
}

/* Media Queries */
@media (min-width: 768px) {
  .container {
    flex-direction: row;
  }

  aside {
    width: 300px;
    margin-right: 1em;
    flex-shrink: 0;
  }

  main {
    flex-grow: 1;
  }
}

@media (max-width: 767px) {
  .container {
    padding: 0.5em;
  }
  
  .card {
    padding: 15px;
  }
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
  .card:hover,
  .dark-mode-card:hover {
    background-color: var(--section-hover-dark);
  }
  
  .item-list li:hover {
    background-color: var(--section-hover-dark);
    border-color: var(--primary-color);
  }
  
  /* Improve button hover state in dark mode */
  button:hover, .button:hover {
    background-color: var(--primary-hover);
  }
  
  button.secondary:hover, .button.secondary:hover {
    background-color: rgba(92, 187, 96, 0.2);
  }
  
  section:hover {
    background-color: var(--section-hover-dark);
  }
  
  li:hover {
    background-color: var(--hover-bg-dark);
  }
}
