/* Reset some basic elements */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background-color: #f4f4f9;
}

.wrapper {
  max-width: 900px;
  margin: 50px auto;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

/* Header styling */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

header button {
  text-decoration: none;
  color: #fff;
  background-color: #007bff;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

header button:hover {
  background-color: #0056b3;
}

/* Table styling */
.container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

thead {
  background-color: #007bff;
  color: #fff;
}

thead td {
  padding: 10px;
  font-weight: bold;
  text-align: left;
}

tbody td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

tbody tr:nth-child(even) {
  background-color: #f4f4f9;
}

.action {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.action button {
  padding: 8px 12px;
  border: none;
  border-radius: 5px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#edit {
  background-color: #28a745;
}

#edit:hover {
  background-color: #218838;
}

#delete {
  background-color: #dc3545;
}

#delete:hover {
  background-color: #c82333;
}

/* form start */

/* Modal background styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Make modal visible when active */
.modal.active {
  opacity: 1;
  visibility: visible;
}

/* Modal container styling */
.modal-container {
  width: 90%;
  max-width: 500px;
  padding: 30px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Form group styling */
.modal .form-group {
  margin-bottom: 15px;
}

.modal label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.modal input[type="text"],
.modal input[type="tel"],
.modal input[type="email"],
.modal input[type="number"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.modal input[type="text"]:focus,
.modal input[type="tel"]:focus,
.modal input[type="email"]:focus,
.modal input[type="number"]:focus {
  border-color: #007bff;
  outline: none;
}

/* Buttons styling */

.modal .btns {
  display: flex;
  align-items: center;
  gap: 20px;
}
.modal button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.modal #create {
  background-color: #28a745;
  color: #fff;
}

.modal #clear {
  background-color: #dc3545;
  color: #fff;
  margin-left: 10px;
}

.modal #create:hover {
  background-color: #218838;
}

.modal #clear:hover {
  background-color: #c82333;
}

/* Center buttons */
.modal form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* form end */


/* loading start */
/* Loading Container */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Spinner Style */
.spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

/* Spinner Animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* loading end */

