/*Page6.css - Edit Database*/

/* Page Container */
.page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--off-white);
}

/* Header Bar */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 20px;
}

.leftlogo, .rightlogo {
  height: 55px;
  width: auto;
  flex-shrink: 0;
}

.college-name {
  color: var(--primary-red);
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 700;
  margin: 0;
  text-align: center;
  letter-spacing: -0.5px;
}

/* Navbar */
.navbar {
  background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
  padding: 0 40px;
  box-shadow: var(--shadow-sm);
}

.navbar ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  gap: 5px;
}

.navbar li {
  padding: 0;
}

.navbar a {
  display: block;
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  padding: 16px 24px;
  transition: var(--transition);
  position: relative;
}

.navbar a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background-color: var(--white);
  transition: var(--transition);
  transform: translateX(-50%);
}

.navbar a:hover::after,
.navbar a.active::after {
  width: calc(100% - 48px);
}

.navbar a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Main Content */
.email-management-container {
  flex: 1;
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.email-management-container h1 {
  text-align: center;
  color: var(--primary-red);
  margin-bottom: 40px;
  font-size: 2rem;
  font-weight: 700;
  position: relative;
  padding-bottom: 15px;
}

.email-management-container h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
  border-radius: 2px;
}

/* Search Bar */
.search-bar {
  margin-bottom: 30px;
}

.search-bar input {
  width: 100%;
  padding: 14px 20px;
  border: 2px solid var(--medium-gray);
  border-radius: var(--border-radius-xl);
  font-size: 16px;
  background-color: var(--white);
  transition: var(--transition);
}

.search-bar input:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 4px rgba(183, 32, 46, 0.1);
}

.search-bar input::placeholder {
  color: var(--dark-gray);
}

/* Grid Layout */
.departments-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 30px;
  padding: 10px;
}

/* Department Card Style */
.department-card {
  background-color: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  border-left: 5px solid var(--primary-red);
  padding: 25px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
}

.department-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.department-card h3 {
  margin: 0 0 15px 0;
  color: var(--primary-red);
  font-size: 1.15rem;
  font-weight: 600;
  border-bottom: 2px solid var(--medium-gray);
  padding-bottom: 12px;
}

.department-card ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 15px;
  flex: 1;
}

.department-card li {
  padding: 8px 0;
  border-bottom: 1px solid var(--light-gray);
  color: var(--darker-gray);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.department-card li:last-child {
  border-bottom: none;
}

.department-card li::before {
  content: '✉';
  color: var(--primary-red);
  font-size: 12px;
}

/* Actions */
.department-actions {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--light-gray);
}

.edit-btn, .delete-btn, .add-department-btn, .save-btn, .cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.edit-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: var(--white);
  flex: 1;
}

.edit-btn:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.delete-btn {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  color: var(--white);
  flex: 1;
}

.delete-btn:hover {
  background: linear-gradient(135deg, #d32f2f, #b71c1c);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.add-department-btn {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: var(--white);
  margin-bottom: 30px;
  padding: 14px 28px;
  font-size: 15px;
}

.add-department-btn:hover {
  background: linear-gradient(135deg, #1976D2, #1565C0);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

/* Edit Form */
.edit-form {
  background-color: var(--white);
  padding: 30px;
  border-radius: var(--border-radius-lg);
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
  border-left: 5px solid #2196F3;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--darker-gray);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--medium-gray);
  border-radius: var(--border-radius);
  font-size: 15px;
  transition: var(--transition);
}

.form-group input:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 4px rgba(183, 32, 46, 0.1);
}

.email-input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: center;
}

.email-input-group input {
  flex: 1;
}

.remove-email {
  background: none;
  border: none;
  color: #f44336;
  cursor: pointer;
  font-size: 18px;
  padding: 8px;
  transition: var(--transition);
  border-radius: 50%;
}

.remove-email:hover {
  background-color: rgba(244, 67, 54, 0.1);
  transform: scale(1.1);
}

.add-email {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: var(--white);
  border: none;
  padding: 10px 18px;
  border-radius: var(--border-radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: var(--transition);
}

.add-email:hover {
  background: linear-gradient(135deg, #1976D2, #1565C0);
  transform: translateY(-2px);
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

.save-btn {
  background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
  color: var(--white);
  flex: 1;
}

.save-btn:hover {
  background: linear-gradient(135deg, var(--dark-red), #6d1219);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(183, 32, 46, 0.4);
}

.cancel-btn {
  background: var(--medium-gray);
  color: var(--darker-gray);
  flex: 1;
}

.cancel-btn:hover {
  background: var(--dark-gray);
  color: var(--white);
  transform: translateY(-2px);
}

/* Footer */
footer {
  background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
  color: var(--white);
  padding: 25px 40px;
  text-align: center;
  margin-top: auto;
}

.terms {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.terms a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}

.terms a:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.footer-image {
  height: 30px;
  margin-top: 15px;
}

/* Responsive */
@media (max-width: 1024px) {
  .departments-list {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  .header-bar,
  .navbar,
  .email-management-container {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 768px) {
  .header-bar {
    flex-direction: column;
    padding: 15px;
    gap: 10px;
  }

  .college-name {
    font-size: 1.2rem;
    order: -1;
  }

  .navbar li {
    padding: 12px 16px;
  }

  .navbar a {
    padding: 12px 16px;
    font-size: 14px;
  }

  .email-management-container {
    padding: 25px 15px;
  }

  .email-management-container h1 {
    font-size: 1.6rem;
  }

  .edit-form {
    padding: 20px;
  }

  .department-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .departments-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .email-input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .remove-email {
    align-self: flex-end;
  }

  .form-actions {
    flex-direction: column;
  }
}
