/* Basic reset styles */
/* ShadCN style framework */

html {
  -webkit-text-size-adjust: 100%;
  line-height: 1.15;
}

body {
  margin: 0;
  font-family: "Roboto", sans-serif;
  background-color: #ffffff;
  color: #333333;
}

main {
  display: block;
}

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
}

pre {
  font-family: monospace, monospace;
  font-size: 1em;
}

a {
  background-color: transparent;
  color: #1e88e5;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

abbr[title] {
  border-bottom: none;
  text-decoration: underline dotted;
}

b,
strong {
  font-weight: bolder;
}

code,
kbd,
samp {
  font-family: monospace, monospace;
  font-size: 1em;
}

small {
  font-size: 80%;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

img {
  border-style: none;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
  background: none;
  border: none;
  color: inherit;
}

button,
input {
  overflow: visible;
}

button,
select {
  text-transform: none;
}

[type="button"],
[type="reset"],
[type="submit"],
button {
  -webkit-appearance: button;
  cursor: pointer;
  padding: 0.5em 1em;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  background-color: #f0f0f0;
  color: #fff;
}

[type="button"]:hover,
[type="reset"]:hover,
[type="submit"]:hover,
button:hover {
  background-color: #f0f0f0;
  color: #fff;
}

[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner,
button::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring,
button:-moz-focusring {
  outline: 1px dotted ButtonText;
}

fieldset {
  padding: 0.35em 0.75em 0.625em;
  border: 1px solid #ddd;
  border-radius: 4px;
}

legend {
  box-sizing: border-box;
  color: inherit;
  display: table;
  max-width: 100%;
  padding: 0;
  white-space: normal;
  font-weight: bold;
}

/* Custom CSS with CSS Variables */
:root {
  /* Colors */
  --primary-color: #1e88e5;
  --secondary-color: #000000;
  --text-color: #333333;
  --background-color: #ffffff;
  --table-bg: #1f1f1f;
  --header-bg: var(--secondary-color);
  --header-text: var(--background-color);
  --hover-bg: #555555;
  --light-gray: #f0f0f0;
  --dark-gray: #333333;
  --border-color: #ddd;

  /* Fonts */
  --font-family: "Roboto", sans-serif;

  /* Sizing */
  --border-radius: 4px;
  --transition-speed: 0.3s;
}

body {
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--text-color);
}

/* Header */
header {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
}

header p {
  font-size: 1.2em;
}

/* Search Bar */
.search-container {
  padding: 20px;
  background-color: var(--background-color);
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-container input {
  width: 80%;
  max-width: 500px;
  padding: 12px 20px;
  font-size: 1em;
  border: 1px solid var(--border-color);
  border-radius: 25px;
  transition: box-shadow var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
  background-color: var(--light-gray);
  color: var(--dark-gray);
}

.search-container input::placeholder {
  color: #888888;
}

.search-container input:focus {
  outline: none;
  box-shadow: 0 0 10px rgba(30, 136, 229, 0.5);
  border-color: var(--primary-color);
  background-color: var(--background-color);
  color: #000000;
}

/* Section container for tables */
.section-container {
  width: 100%;
  max-width: 1000px;
  margin: 20px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--background-color);
}

.section-title {
  margin-bottom: 10px;
  font-weight: bold;
}

/* Modernized Items Table */
.items-table {
  width: 100%;
  max-width: 1000px;
  margin: 20px auto;
  border-collapse: separate;
  border-spacing: 0;
  background-color: var(--table-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.items-table:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

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

.items-table th {
  background-color: #333333;
  color: var(--background-color);
  font-weight: 500;
  border-bottom: 2px solid var(--background-color);
  position: relative;
  cursor: pointer;
}

.items-table tbody tr {
  border-bottom: 1px solid var(--background-color);
  transition: background-color var(--transition-speed) ease;
}

.items-table tbody tr:last-child {
  border-bottom: none;
}

.items-table tbody tr:hover {
  background-color: var(--hover-bg);
  cursor: pointer;
}

.items-table tbody tr td {
  color: var(--background-color);
}

/* Loading Spinner */
.loader {
  border: 8px solid #f3f3f3;
  border-top: 8px solid var(--background-color);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin: 30px auto;
  display: none;
}

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

/* Error Message */
.error-message {
  color: #ff4d4f;
  margin: 20px;
  text-align: center;
  font-size: 1.1em;
  display: none;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 1000;
}

.modal {
  background: #f9f9f9;
  color: var(--dark-gray);
  padding: 30px;
  width: 70%;
  max-width: 1200px;
  height: auto;
  max-height: 80vh;
  overflow-y: visible;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  position: relative;
  animation: fadeIn 0.3s ease;
  font-size: 1.2em;
}

.modal h2 {
  margin-bottom: 15px;
  font-size: 1.8em;
  color: var(--primary-color);
}

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

.modal-details p {
  display: table-row;
  font-size: 1.2em;
}

.modal-details p strong,
.modal-details p button.copy-btn,
.modal-details p .modal-value {
  display: table-cell;
  vertical-align: top;
  padding-right: 10px;
}

.modal-details p strong {
  white-space: nowrap;
  color: var(--primary-color);
  font-weight: bold;
}

.modal .close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  cursor: pointer;
  font-size: 1.5em;
  color: var(--background-color);
}

.modal p button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 2px 6px;
  border-radius: var(--border-radius);
  font-size: 0.9em;
}

.modal p button:hover {
  background-color: #1565c0;
}

.modal p button.copy-btn {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 20px;
  color: rgb(0, 108, 224);
  background: none;
  border: none;
  padding: 2px 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  vertical-align: top;
  margin-left: 10px;
  margin-right: 8px;
}

.modal p button.copy-btn svg {
  display: block;
  width: 16px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

.modal p button.copy-btn:hover {
  color: rgb(0, 88, 204);
}

.copy-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--background-color);
  color: rgb(0, 128, 47);
  border: 1px solid rgb(0, 128, 47);
  border-radius: var(--border-radius);
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 10;
  margin-bottom: 5px;
  display: flex;
  gap: 4px;
}

.copy-tooltip .awsui_icon {
  width: 16px;
  height: 16px;
  stroke: rgb(0, 128, 47);
  fill: none;
}

.copy-notification {
  background: #e0f3ff;
  color: #005ca9;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #005ca9;
  border-radius: var(--border-radius);
  font-weight: 500;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .items-table th,
  .items-table td {
    padding: 12px;
  }
  .items-table {
    max-width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }
  .modal {
    width: 90%;
    padding: 20px;
  }
  .search-container input {
    width: 90%;
  }
}

/* Table header sort indicators */
th.sort-asc::after {
  content: " ▲";
  font-size: 0.8em;
  position: absolute;
  right: 10px;
}

th.sort-desc::after {
  content: " ▼";
  font-size: 0.8em;
  position: absolute;
  right: 10px;
}

/* Dropdown styling inside modal */
.status-dropdown {
  position: relative;
  display: inline-block;
}

.status-trigger {
  border: 1px solid var(--primary-color);
  border-radius: 9999px;
  padding: 6px 18px 6px 12px;
  background: var(--background-color);
  cursor: pointer;
  position: relative;
  min-width: 130px;
  text-align: left;
  color: var(--primary-color);
  font-weight: bold;
}

.status-trigger:hover,
.status-trigger:focus {
  background: #b3dffb;
  color: #0d47a1;
  border-color: #b3dffb;
}

.status-trigger::after {
  content: "";
  border: 5px solid transparent;
  border-top-color: var(--primary-color);
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.status-options {
  display: none;
  position: absolute;
  right: 0;
  background: var(--background-color);
  border: 1px solid #ccc;
  border-radius: 8px;
  list-style: none;
  padding: 0;
  margin: 4px 0 0 0;
  width: 160px;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.status-options li {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--primary-color);
}

.status-options li:hover {
  background: #e0f7fa;
}

.status-dropdown.open .status-options {
  display: block;
}

/* Info button near dropdown */
.info-icon {
  margin-left: 8px;
  cursor: pointer;
  background: none;
  border: 1px solid var(--primary-color);
  border-radius: 50%;
  padding: 4px 8px;
  font-weight: bold;
  font-size: 14px;
  line-height: 14px;
  text-align: center;
  min-width: 24px;
  color: var(--primary-color);
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}

.info-icon:hover,
.info-icon:focus {
  background: #b3dffb;
  color: #fff;
  border-color: #b3dffb;
}

.info-popup {
  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  margin-top: 4px;
  background: var(--background-color);
  border: 1px solid #ccc;
  border-radius: 8px;
  list-style: none;
  padding: 10px 14px;
  width: 250px;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.info-popup.open {
  display: block;
}

.info-popup p strong {
  color: var(--primary-color);
}
