/* RESET & GLOBAL */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a {
  text-decoration: none;
}

html, body {
  height: 100%;
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  display: flex;
  flex-direction: column;
}

/* HEADER */
header {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  height: 90px;
  padding: 1.5rem;
  background-color: #004080;
  color: white;
  position: relative;
  z-index: 1100;
}

.hamburger {
  display: none;
  font-size: 24px;
  margin-right: 1rem;
  cursor: pointer;
}

/* LAYOUT */
.container {
  display: flex;
  flex: 1;
  width: 100%;
  position: relative;
}

/* SIDEBAR */
.sidebar {
  width: 300px;
  background-color: #f8f8f8;
  border-right: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-header {
  position: relative;
  text-align: center;
  border-bottom: 1px solid #ccc;
  height: 160px;
  overflow: hidden;
}

/* Background image with opacity using ::before */
.sidebar-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url('images/bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.6;
  z-index: 0;
}

.buet-logo {
  margin-top: 20%;
  max-width: 100px;
  height: auto;
  position: relative;
  z-index: 1;
}

.menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 0.5rem;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: #333;
  font-weight: 600;
  border-radius: 8px;
  transition: background-color 0.2s, color 0.2s;
}

.menu-item:hover,
.menu-item.active {
  background-color: #e6f0ff;
  color: #052c53;
}

.menu-item .icon {
  margin-right: 10px;
  font-size: 18px;
}

.sidebar-footer {
  font-size: 16px;
  color: #333;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
}

.sidebar-footer .bold {
  font-weight: bold;
  color: #1a237e;
}

/* MAIN CONTENT */
.main {
  flex-grow: 1;
  background-color: #e9e9e9;
  padding: 1.3rem;
  overflow-x: hidden;
}

.main h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* CARDS */
.search-card {
  margin-top: 2%;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  border: 1px solid #060404;
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.muted {
  color: #555;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

  /* Make the search card 50% wide and centered */
#search-view {
    width: 50%;
    margin: 0 auto;
  }

@media (max-width: 900px) {
  #search-view {
    width: 90%;
  }
}

/* FORMS */
.form-grid {
  display: grid;
  gap: 0.5rem;
  align-items: end;
}

/* force single-column orientation for the search form */
.column-layout {
  grid-template-columns: 1fr;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

label {
  font-weight: 700;
  color: #1f2a44;
}

select, input[type="text"], input[type="email"], input[type="tel"] {
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
  outline: none;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus, input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus {
  border-color: #0077b6;
  box-shadow: 0 0 0 3px rgba(0,119,182,0.15);
}

.welcome{
  margin-top: -2%;
  font-size: 0.8rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center; 
  margin-top: 1rem;
}

.btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 0.9rem;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.02s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: #0077b6;
  color: white;
}

.btn-primary:hover { background: #005f8a; }

.btn-ghost {
  background: #fff;
  color: #1f2a44;
  border-color: #cfd8e3;
}

.btn-ghost:hover {
  background: #f6f8fb;
}

/* ERRORS */
.error-text {
  padding: 0.75rem 0.9rem;
  background: #fff1f0;
  border: 1px solid #ffccc7;
  color: #a8071a;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 0.8rem;
}

/* TABLES */
.data-table-container {
  margin-top: 0.5rem;
  background-color: #fff;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  border: 1px solid #e6e6e6;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  margin-top: 0.8rem;
  background-color: #f7f4f489;
}

.data-table th,
.data-table td {
  border: 1px solid #e6e6e6;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  font-size: 0.8rem;
}

.data-table td.wrap {
  white-space: normal;        /* override nowrap */
  word-break: break-word;
  overflow-wrap: anywhere;
}

.data-table th {
  background-color: #f1f4f9;
  color: #1f2a44;
}

/* DOWNLOAD BUTTON */
.download-button-wrapper {
  margin-top: 0.7rem;
  text-align: center;
}

.download-button {
  display: inline-block;
  padding: 14px 14px;
  background-color: #0077b6;
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
  transition: background-color 0.3s ease, transform 0.03s;
}

.download-button:hover {
  background-color: #005f8a;
}

.download-button:active {
  transform: translateY(1px);
}

/* Make photo inside table responsive */
.table-photo {
  max-width: 150px;
  height: auto;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  display: block;
  margin: auto;
}

/* UTILS */
.hidden { display: none !important; }

/* RESPONSIVE DESIGN */

@media (max-width: 768px) {
  .hamburger {
    display: inline-block;
  }

  .container {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 90px;
    left: 0;
    height: calc(100% - 90px);
    z-index: 1000;
    width: 250px;
    background-color: #f8f8f8;
    border-right: 1px solid #ccc;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main {
    padding: 1rem;
  }

  .data-table-container {
    padding: 0.5rem;
  }

  .data-table {
    font-size: 14px;
    min-width: 100%;
  }

  .download-button {
    width: 90%;
    font-size: 15px;
    padding: 12px 0;
  }

  .menu {
    flex-direction: column;
  }

  .menu-item {
    font-size: 16px;
    justify-content: start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}


/* ---- Download Modal ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal-card {
  width: min(640px, 92vw);
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 16px 36px rgba(0,0,0,0.22);
  border: 1px solid #e6e6e6;
}
.modal-title {
  margin-bottom: 1rem;
  font-size: 1.3rem;
  text-align: center;
}
.modal-info {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-align: center;
  color: red;
}
/* labels align with the inputs and center as a block */
.modal-field label {
  width: 80%;
  margin: 0 auto 6px;
  display: block;
  font-weight: 700;
  color: #1f2a44;
}
.modal-field input {
  width: 80%;
  margin: 0 auto;
  display: block;
}

.modal-actions {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  flex-direction: row;            /* place side-by-side */
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.modal-actions .btn {
  width: 30%;
  max-width: 260px;
}

@media (max-width: 600px) {
  .modal-actions {                /* stack on small screens */
    flex-direction: column;
  }
  .modal-actions .btn {
    width: 90%;
    max-width: none;
  }
}