/*
 * Modern Employee Management System Stylesheet
 *
 * This CSS file provides a clean, modern, and responsive design for the employee management system.
 * It uses CSS variables for easy color scheme changes and Flexbox for flexible layouts.
 */

/* --------------------
 * 1. Global & Body Styles
 * -------------------- */

:root {
  /* Define color palette using CSS variables */
  --primary-color: #4f46e5;
  --secondary-color: #6366f1;
  --text-color: #374151;
  --bg-color: #f9fafb;
  --card-bg-color: #ffffff;
  --border-color: #e5e7eb;
  --shadow-color: rgba(0, 0, 0, 0.05);
  --button-hover-bg: #4338ca;
}

/* Apply a clean font and background to the whole page */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  box-sizing: border-box;
}

/* Basic box-sizing for all elements */
*, *::before, *::after {
  box-sizing: inherit;
}

/* --------------------
 * 2. Header and Main Container
 * -------------------- */

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 2rem;
  text-align: center;
}

/* Main content container for a sleek, centered layout */
.container {
  max-width: 960px;
  width: 100%;
  background-color: var(--card-bg-color);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 10px 15px -3px var(--shadow-color), 0 4px 6px -2px var(--shadow-color);
  text-align: center;
}

/* --------------------
 * 3. Buttons and Controls
 * -------------------- */

/* Styles for the button container */
div {
  display: flex;
  flex-wrap: wrap; /* Allows buttons to wrap on smaller screens */
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

/* Styles for the buttons themselves */
button {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
  box-shadow: 0 4px 6px -1px var(--shadow-color), 0 2px 4px -1px var(--shadow-color);
  white-space: nowrap; /* Prevents buttons from breaking lines */
}

/* Hover and active states for interactive feedback */
button:hover {
  background-color: var(--button-hover-bg);
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

/* --------------------
 * 4. Employee Details Display
 * -------------------- */

/* Container for the displayed content */
#employeesDetails {
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-top: 2rem;
  text-align: left;
  line-height: 1.6;
  white-space: pre-wrap; /* Preserve formatting from JS output */
  min-height: 100px;
}

/* Styles for specific elements that might be dynamically created */
#employeesDetails h2 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 1rem;
}

#employeesDetails p, #employeesDetails pre {
  margin: 0.5rem 0;
}

/* --------------------
 * 5. Media Queries for Responsiveness
 * -------------------- */

@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .container {
    padding: 1.5rem;
  }

  button {
    padding: 0.6rem 1.2rem;
  }

  /* Make buttons stack vertically on very small screens */
  div {
    flex-direction: column;
  }
}
