/* ===========================
   Bootstrap Reset & Compatibility
=========================== */
@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* ===========================
   Base Reset
=========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(to right, #f7f9fb, #eef3f8);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #2c3e50;
}

/* ===========================
   Navbar / Branding
=========================== */
.header {
  width: 100%;
  background: linear-gradient(135deg, #003366, #0059b3);
  padding: 1rem 2rem;
  color: white;
  font-weight: 600;
  font-size: 1.4rem;
  text-align: center;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
  letter-spacing: 1px;
}

/* ===========================
   Main Container
=========================== */
.container {
  background-color: white;
  padding: 3rem;
  margin-top: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  max-width: 850px;
  width: 100%;
  animation: fadeIn 0.5s ease-in-out;
}

#crudForm {
  display: flex;
  flex-direction: column;
  gap: 15px; /* Adds equal spacing between all elements */
}

#crudForm input,
#crudForm button {
  width: 100%;
}


/* Fade Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===========================
   Headings
=========================== */
h1, h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: #003366;
  font-weight: 700;
}

/* ===========================
   Form Elements
=========================== */
.form-group {
  margin-bottom: 1.2rem;
}

label {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #333;
  display: block;
}

input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: 0.3s ease;
  background-color: #f9f9f9;
}

input:focus {
  outline: none;
  border-color: #0059b3;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(0, 89, 179, 0.2);
}

/* ===========================
   Buttons
=========================== */
button, .btn-custom {
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #0059b3, #003366);
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
}

button:hover, .btn-custom:hover {
  background: linear-gradient(135deg, #003366, #00264d);
  transform: translateY(-2px);
}

/* ===========================
   Messages
=========================== */
.message {
  font-size: 0.95rem;
  text-align: center;
  margin: 0.8rem 0;
  font-weight: 600;
}

.error {
  color: #e74c3c;
}

.success {
  color: #2ecc71;
}

/* ===========================
   Links
=========================== */
a {
  text-align: center;
  display: block;
  margin-top: 1rem;
  font-weight: 500;
  text-decoration: none;
  color: #0059b3;
}

a:hover {
  text-decoration: underline;
}

/* ===========================
   Tables
=========================== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  overflow-x: auto;
  display: block;
}

th, td {
  border: 1px solid #ddd;
  padding: 0.75rem;
  text-align: left;
}

th {
  background-color: #0059b3;
  color: white;
}

tr:nth-child(even) {
  background-color: #f7f9fb;
}

.table-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.table-buttons .btn {
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}

/* ===========================
   Responsive Design
=========================== */
@media (max-width: 768px) {
  .container {
    padding: 2rem;
    margin: 1rem;
  }
  
  h1, h2 {
    font-size: 1.6rem;
  }

  table {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1.5rem;
  }

  h1, h2 {
    font-size: 1.4rem;
  }

  input, button {
    font-size: 0.95rem;
  }

  .table-buttons {
    flex-direction: column;
    gap: 0.3rem;
  }
}
