/* General Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0; 
  padding: 0;
  background: #f5f5f5;
  color: #333;
}

header {
  background: #031c36;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .logo {
  font-size: 20px;
  font-weight: bold;
}

nav a {
  margin: 0 10px;
  color: white;
  text-decoration: none;
}

nav .login-btn {
  background: #e67e22;
  padding: 5px 12px;
  border-radius: 5px;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 100px 20px;
  background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('library-bg.jpg') no-repeat center/cover;
  color: white;
  background: url("bookshelf2.png") no-repeat center center/cover;
}

.hero h1 {
  font-size: 40px;
}

.hero .cta {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background: #031c36;
  color: white;
  border-radius: 5px;
  text-decoration: none;
}
.hero .cta:hover {
  background-color: red;
}

section {
  padding: 40px 20px;
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.card {
  background: rgb(37, 36, 83);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  color: #ffffff;
}

.card:hover {
  background: red;
}

#categoryInfo {
  margin-top: 20px;
  font-size: 16px;
  color: #374151;
  text-align: center;
  min-height: 40px;
}

footer {
  text-align: center;
  padding: 20px;
  background: #252453;
  color: white;
}

.links {
  text-align: center;
  margin-top: 15px;
}

.links a {
  color: #2c3e50;
  text-decoration: none;
  font-size: 14px;
}

.links a:hover {
  text-decoration: underline;
}

/* Modal Styles */
.modal {
  display: none; 
  position: fixed; 
  z-index: 1000; 
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  background: white;
  margin: 10% auto;
  padding: 25px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.modal-content h2 {
  margin-bottom: 15px;
  text-align: center;
}

.modal-content input, 
.modal-content button {
  width: 100%;
  margin: 8px 0;
  padding: 12px;
  border-radius: 5px;
  border: 1px solid #ddd;
}

.modal-content button {
  background: #2c3e50;
  color: white;
  border: none;
  cursor: pointer;
}

.modal-content button:hover {
  background: #34495e;
}

.close {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 22px;
  cursor: pointer;
  color: #555;
}

.close:hover {
  color: black;
}

/* Login Page */
.login-container {
  max-width: 350px;
  margin: 80px auto;
  padding: 30px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  height: 400px;
}

.login-container h2 {
  text-align: center;
  margin-bottom: 20px;
}

.login-container input {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.login-container button {
  width: 100%;
  padding: 12px;
  background: #2c3e50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.login-container button:hover {
  background: #34495e;
}

#error-message {
  color: red;
  font-size: 14px;
  text-align: center;
  margin-top: 10px;
}

a[href^="mailto:"] {
  color: white;
}
a[href^="tel:"] {
  color: white;
}

/* Popup Styles */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup {
  background: #fff;
  padding: 20px;
  width: 300px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  position: relative;
  animation: popup-anim 0.4s ease;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 20px;
  cursor: pointer;
  color: #333;
}

@keyframes popup-anim {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.back-btn {
  background: #0077cc;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  margin: 10px 0;
}

.back-btn:hover {
  background: #005fa3;
}

/* === HAMBURGER MENU (MOBILE) === */
.menu-icon {
  display: none;
  font-size: 28px;
  cursor: pointer;
  color: white;
  flex-direction: column;
}

/* Default nav links layout (desktop) */
.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

/* Mobile styles */
@media (max-width: 768px) {
  .menu-icon {
    display: block; /* show hamburger */
  }

  .nav-links {
    position: absolute;
    top: 65px; /* Adjust depending on header height */
    right: 0;
    background: #031c36;
    flex-direction: column;
    width: 220px;
    text-align: left;
    display: none;
    padding: 15px;
    border-radius: 0 0 0 10px;
    z-index: 999;
  }

  .nav-links.active {
    display: flex; /* show when JS adds .active */
  }

  nav a {
    display: block;
    padding: 10px 0;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  nav a:last-child {
    border-bottom: none;
  }
}


/* Base layout */
#searchForm {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
  padding-top: 5%;
}

/* Input */
#searchForm input {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  border: 5px solid #031c36;
  border-radius: 100px;
  outline: none;
}

/* Select */
#searchForm select {
  padding: 10px;
  font-size: 14px;
  border: 1px solid #031c36;
  border-radius: 6px;
  background: #fff;
}

/* Button */
#searchForm button {
  padding: 10px 14px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background: #031c36;
  color: #fff;
  cursor: pointer;
}

#searchForm button:hover {
  background: red;
}

#searchForm input:focus {
  border-color: red;
}

/* 📱 Force mobile layout */
@media (max-width: 480px) {
  #searchForm {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Force input to its own line */
  #searchForm input {
    flex: 0 0 70%;
  }

  /* Center dropdown + button */
  #searchForm select,
  #searchForm button {
    margin-top: 6px;
  }
}

#resetLinkBox, #copyResetBtn {
  margin-top: 5px;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
}
#copyResetBtn {
  background: #19075c;
  color: white;
  border: none;
  cursor: pointer;
}
#copyResetBtn:hover {
  background: #a71d2a;
}


