/* styles.css */

/* Reset and basic styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Fira Sans', 'Droid Sans', 'Helvetica', Arial, sans-serif;
}

body {
  background-color: #f5f5f7;
  color: #1c1c1e;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

h1 {
  font-weight: 600;
  font-size: 24px;
}

/* Item List */
#item-list {
  list-style: none;
  margin-bottom: 20px;
}

.item-card {
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15);
}

.item-card.expired {
  background-color: #fdecea;
  color: #d93025;
}

.item-card span {
  margin-bottom: 5px;
}

.item-card button {
  align-self: flex-end;
  background-color: transparent;
  border: none;
  color: #007aff;
  font-size: 16px;
  cursor: pointer;
}

.item-card button:hover {
  text-decoration: underline;
}

/* Add Item Form */
#add-item-form {
  display: flex;
  flex-direction: column;
}

#add-item-form input,
#add-item-form button, form input {
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #c7c7cc;
  font-size: 16px;
}

#add-item-form button {
  background-color: #007aff;
  color: #ffffff;
  border: none;
  cursor: pointer;
}

#add-item-form button:hover {
  background-color: #005bb5;
}

/* Add styles for forms */
form {
    max-width: 400px;
    margin: 0 auto;
}

form input {
    width: 100%;
    margin-bottom: 15px;
}

form button {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #c7c7cc;
    font-size: 16px;
    background-color: #007aff;
    color: #ffffff;
    border: none;
    cursor: pointer;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 12px;
}

#close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

#close-modal:hover,
#close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Item Actions */
.item-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.item-actions button {
    margin-left: 10px;
    padding: 5px 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.item-actions button:first-child {
    background-color: #28a745; /* Green for Edit */
    color: #ffffff;
}

.item-actions button:last-child {
    background-color: #dc3545; /* Red for Delete */
    color: #ffffff;
}

.item-actions button:hover {
    opacity: 0.8;
}

