/* 
 * api.css - Modern styling for information list page
 * Created: 2025
 */

/* Main container styles */
.info-container {
  font-family: 'Noto Sans KR', sans-serif;
  color: #333;
  margin: 0 auto;
}

/* Card styling - common properties */
.info-header-card,
.search-filter-card,
.data-table-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 24px;
  margin-bottom: 24px;
  transition: all 0.3s ease;
}

.info-header-card:hover,
.search-filter-card:hover,
.data-table-card:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Header card specific styles */
.info-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-left: 4px solid #3665ab;
}

.info-title-section {
  display: flex;
  flex-direction: column;
}

.info-main-title {
  font-size: 24px;
  font-weight: 600;
  color: #212529;
  margin: 0 0 8px 0;
}

.info-count {
  font-size: 14px;
  color: #6c757d;
}

.count-highlight {
  font-style: normal;
  font-weight: 700;
  color: #3665ab;
}

.info-sort-section {
  display: flex;
  align-items: center;
}

.sort-label {
  margin-right: 10px;
  font-size: 14px;
  color: #495057;
}

/* Custom select styling */
.custom-select {
  position: relative;
  min-width: 120px;
}

.custom-select select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 8px 30px 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background-color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.custom-select select:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  border-style: solid;
  border-width: 6px 5px 0 5px;
  border-color: #6c757d transparent transparent transparent;
}

/* Search filter card styles */
.search-filter-card {
  background-color: #f8f9fa;
}

/* Institution area styles */
.institution-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  margin-bottom: 15px;
  background-color: #e9ecef;
  border-radius: 6px;
  border-left: 4px solid #3665ab;
}

.institution-area button {
  padding: 6px 12px;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.institution-area button:hover {
  background-color: #f8f9fa;
  border-color: #adb5bd;
}

.institution-area span {
  font-weight: 600;
  color: #3665ab;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-form-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 15px;
}

.search-form-row-between {
  justify-content: space-between;
}

.search-form-row-single-line {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 15px;
  width: 100%;
  overflow-x: auto;
  padding: 5px 0;
}

.search-form-row-single-line .form-group {
  flex: 0 0 auto;
}

.search-form-row-single-line .title-search-compact {
  width: auto;
  min-width: 150px;
}

.search-form-row-single-line .date-input {
  width: 110px;
}

.search-form-row-single-line .info-sort-section {
  flex: 0 0 auto;
  margin-left: 10px;
}

.search-form-row-single-line .search-button-area {
  flex: 0 0 auto;
  margin-left: auto;
}

.title-search {
  flex: 1;
  min-width: 250px;
}

.title-search-compact {
  width: 200px;
  min-width: 150px;
}

.date-input-group {
  margin-left: 0;
}

.form-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: 8px;
}

.form-group label {
  margin-right: 10px;
  font-size: 14px;
  color: #495057;
  font-weight: 500;
  white-space: nowrap;
}

.form-control {
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  flex: 1;
  min-width: 0; /* Prevents flex items from overflowing */
}

.form-control:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control::placeholder {
  color: #adb5bd;
}

/* Date range group styling */
.date-range-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  flex: 1;
  min-width: 300px;
}

.date-input {
  width: 120px;
  background-color: #fff;
  cursor: pointer;
}

.date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 5px;
  color: #6c757d;
  font-weight: 500;
  align-self: flex-end;
  margin-bottom: 8px;
  height: 38px;
}

.date-shortcuts {
  display: flex;
  gap: 8px;
  margin-left: 10px;
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-shortcut {
  background-color: #e9ecef;
  color: #495057;
}

.btn-shortcut:hover {
  background-color: #dee2e6;
}

.search-button-area {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.btn-search {
  background-color: #3665ab;
  color: white;
  padding: 10px 20px;
  min-width: 100px;
}

.btn-search:hover {
  background-color: #2a5089;
}

.search-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: middle;
}

.search-icon::before {
  content: "\1F50D";
  font-family: sans-serif;
}

/* Table styles */
.table-responsive {
  overflow-x: auto;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.info-table thead th {
  background-color: #f8f9fa;
  color: #495057;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
}

.info-table tbody tr {
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
}

.info-table tbody tr:hover {
  background-color: #f1f3f5;
}

.info-table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
}

.info-table tbody td a {
  color: #3665ab;
  text-decoration: none;
  transition: color 0.2s ease;
}

.info-table tbody td a:hover {
  color: #2a5089;
  text-decoration: underline;
}

/* No results message styling */
.info-table .no-results td {
  text-align: center;
  padding: 30px 0;
  color: #6c757d;
  font-style: italic;
}

/* Pagination styles */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.modern-pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 5px;
}

.modern-pagination li {
  display: inline-flex;
  margin: 0 2px;
}

.modern-pagination li a,
.modern-pagination li span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 4px;
  background-color: #fff;
  color: #495057;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.modern-pagination li.active a,
.modern-pagination li.active span {
  background-color: #3665ab;
  color: #fff;
  font-weight: 600;
}

.modern-pagination li a:hover,
.modern-pagination li span:hover {
  background-color: #e9ecef;
}

/* Loading background */
.loading-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .info-header-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-form-row:not(.search-form-row-single-line), .search-form-row-between:not(.search-form-row-single-line) {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .search-form-row-single-line {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px; /* Space for scrollbar */
  }

  /* Maintain horizontal layout for form groups even on small screens */
  .form-group {
    flex-direction: row;
    align-items: center;
  }

  .title-search-compact {
    min-width: 120px;
  }

  .date-input-group {
    margin-left: 0;
  }

  .info-sort-section {
    margin-left: 10px;
  }

  .date-range-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .date-separator {
    margin: 0 5px;
  }

  .date-shortcuts {
    margin-left: 10px;
  }

  .search-button-area {
    margin-left: 10px;
  }
}
