/*-- ----------------------------------------
   Names : 1. Ahmad Aboud | ID : 214586562
           2. Zahra Halabi| ID : 316351063
   Class :         Software 50/5 
----------------------------------------*/
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0; padding: 0;
  background: linear-gradient(135deg, #fdfbfb, #ebedee);
  color: #333;
}

/* ----------------------------------------
   Dark-mode toggle effect
---------------------------------------- */
body.fancy-effect {
  background: linear-gradient(135deg, #333, #111);
  color: #FF7043;
}
body.fancy-effect .container { background: #444; }
body.fancy-effect footer        { color: #aaa; }

/* ----------------------------------------
   Centered container styling
---------------------------------------- */
.container {
  max-width: 960px;
  margin: 30px auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* ----------------------------------------
   Main heading
---------------------------------------- */
h1 {
  text-align: center;
  color: #FF7043;
  margin-bottom: 20px;
}

/* ----------------------------------------
   Controls (search input + buttons)
---------------------------------------- */
.controls {
  display: flex; flex-wrap: wrap; gap:12px;
  justify-content: center; margin-bottom:20px;
}
.controls input,
.controls button {
  padding:10px 14px;
  font-size:14px;
  border:1px solid #ccc;
  border-radius:6px;
  transition:.2s;
}
.controls input:focus {
  border-color:#FF7043;
  outline:none;
}
.controls button {
  background:#FF7043;
  color:#fff;
  border:none;
  cursor:pointer;
}
.controls button:hover {
  background:#E64A19;
}

/* ----------------------------------------
   Contact counter text
---------------------------------------- */
#contactCounter {
  text-align:center;
  font-weight:bold;
  margin-bottom:15px;
}

/* ----------------------------------------
   Header row (flex/grid for UL)
---------------------------------------- */
.contact-header {
  display: grid;
  grid-template-columns: 1fr 3fr 3fr 1.5fr;
  list-style: none;
  padding: 0;
  margin: 1rem 0 .5rem;
  background: #FF7043;
  color: #fff;
  font-weight: bold;
}
.contact-header li {
  padding: 10px;
}

/* ----------------------------------------
   Contact list items
---------------------------------------- */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-list li {
  display: grid;
  grid-template-columns: 1fr 3fr 3fr 1.5fr;
  align-items: center;
  background: #fff;
  border-radius: 6px;
  padding: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  gap: 0.5rem;
}
.contact-list li img {
  width:40px; height:40px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid #FF7043;
}
.contact-list li .name,
.contact-list li .phone,
.contact-list li .actions {
  padding:5px;
}

/* Highlight on hover (added/removed via JS) */
.contact-list li.hovered {
  background-color: #e3f2fd;
}

/* Action buttons inside each item */
.contact-list li .actions {
  display:flex;
  gap:0.5rem;
}
.contact-list li .actions button {
  background:none;
  border:none;
  font-size:18px;
  cursor:pointer;
  transition: color 0.2s;
}
.contact-list li .actions button:hover {
  color: #FF7043;
}

/* ----------------------------------------
   No-contacts message
---------------------------------------- */
#noContactsMsg {
  text-align:center;
  font-style:italic;
  margin-top:20px;
}

/* ----------------------------------------
   Popup form overlay
---------------------------------------- */
.popup {
  position:fixed;
  top:0; left:0;
  width:100%; height:100%;
  background:rgba(0,0,0,0.4);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1000;
}
.popup form {
  background:#fff;
  padding:20px;
  border-radius:8px;
  width:90%; max-width:320px;
  display:flex; flex-direction:column; gap:10px;
  box-shadow:0 6px 18px rgba(0,0,0,0.15);
}
.popup input,
.popup textarea {
  padding:8px 10px;
  font-size:14px;
  border:1px solid #ccc;
  border-radius:4px;
}
.popup-buttons {
  display:flex;
  justify-content:space-between;
  margin-top:8px;
}
.popup-buttons button {
  padding:8px 12px;
  border:none;
  border-radius:4px;
  cursor:pointer;
  font-weight:bold;
}
.popup-buttons button[type="submit"] {
  background:#FF7043;
  color:#fff;
}
.popup-buttons button[type="button"] {
  background:#ccc;
}
.popup-buttons button:hover {
  opacity:0.9;
}

/* ----------------------------------------
   Utility: hide elements
---------------------------------------- */
.hidden {
  display:none;
}

/* ----------------------------------------
   Footer styling
---------------------------------------- */
footer {
  text-align:center;
  font-size:14px;
  color:#666;
  margin-top:30px;
}

/* ----------------------------------------
   Responsive adjustments (mobile)
---------------------------------------- */
@media (max-width:600px) {
  .contact-list li {
    grid-template-columns: 1fr;
    gap:8px;
  }
  .contact-list li .actions {
    justify-self:center;
  }
}

