/* Basic reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f9fafb;
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 10px;
}

.container {
  width: 100%;
  max-width: 700px;
  padding: 20px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 2rem;
  color: #333;
}

h2 {
  margin-bottom: 1rem;
  color: #333;
  text-align: center;
}

label {
  display: block;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.3rem;
}

input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #007bff;
  outline: none;
}

button {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  background-color: #007bff;
  border: none;
  border-radius: 5px;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #0056b3;
}

.container-md {
  max-width: 800px;
  margin: 20px auto;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 500;
  margin-top: 20px;
  border-bottom: none;
  padding-bottom: 5px;
  color: #333;
}

.section {
  margin-top: 20px;
}

/* Checkbox Styling */
.form-check-inline {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.form-check-inline .form-check-input {
  margin-right: 8px;
}

/* Responsive Typography */
@media (max-width: 600px) {
  h1, h2 {
    font-size: 1.5rem;
  }

  button {
    font-size: 0.9rem;
    padding: 0.6rem;
  }
}


.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% {
      transform: rotate(0deg);
  }
  100% {
      transform: rotate(360deg);
  }
}

.hidden {
  display: none;
}

/* Button Group Styling */
.button-group {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.button-group .btn-primary {
  background-color: #007bff;
  border-color: #007bff;
  color: #fff;
}

.button-group .btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

.button-group .btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

/* Small Add Button Styling */
.add-button {
  color: #007bff;
  border: 1px solid #007bff;
  background-color: #fff;
  font-size: 0.9rem;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  display: block;
  margin-top: 5px;
  text-align: center;
  width: fit-content;
}

.add-button:hover {
  background-color: #e9f5ff;
  color: #0056b3;
}

.section-title {
  margin-bottom: 0.5rem;
}

/* Dynamic List Styling */
.dynamic-list {
  margin-bottom: 15px;
}

.options-row,
.additional-text-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.option-input,
.additional-text-input {
  flex: 1;
}

.options-row .btn-outline-danger,
.additional-text-row .btn-outline-danger {
  padding: 5px 10px;
  font-size: 0.9rem;
  min-width: 60px;
}

/* Container for preview sections */
.file-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  justify-content: flex-start;
}

/* Card style for each file (image or video) */
.file-card {
  width: 150px; /* Explicit width */
  height: 180px; /* Explicit height */
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden; /* Prevents content from overflowing */
  background-color: #f9f9f9;
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Common style for media elements (images/videos) */
.file-card-media {
  width: 100%; /* Take full width of the card */
  height: 100px; /* Ensures consistent media preview size */
  object-fit: cover; /* Maintains aspect ratio */
  border-bottom: 1px solid #ccc;
}

/* Card body for details */
.file-card-body {
  width: 100%; /* Explicitly match the parent's width */
  padding: 5px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden; /* Prevents content overflow */
}

/* Card subtitle for file details */
.card-subtitle {
  font-size: 12px;
  color: #555;
  text-overflow: ellipsis; /* Handles long file names */
  white-space: nowrap;
  overflow: hidden;
  width: 100%; /* Explicitly match the width of the parent */
}

/* Delete button styling */
.delete-btn {
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid #f00;
  border-radius: 4px;
  color: #f00;
  background-color: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: center;
}

.delete-btn:hover {
  background-color: #f00;
  color: #fff;
}

/* Responsive Design for File Uploads */
@media (max-width: 600px) {
  .file-card {
    width: 120px;
    height: 160px;
  }

  .file-card-media {
    height: 80px;
  }

  .delete-btn {
    font-size: 10px;
    max-width: 80%; /* Adjusted for smaller screens */
  }
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 10px;
  text-align: left;
}

.table-bordered {
  border: 1px solid #ddd;
}

.table-bordered th, .table-bordered td {
  border: 1px solid #ddd;
}

.table-striped tbody tr:nth-child(odd) {
  background-color: #f9f9f9;
}

.edit-link {
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
}

.edit-link:hover {
  text-decoration: underline;
}