*, *:after, *:before {
  box-sizing: border-box;
}

:root {
  --c-action-primary: #2e44ff;
  --c-action-primary-accent: #e9e5ff;
  --c-action-secondary: #e5e5e5;
  --c-text-primary: #0d0f21; 
  --c-text-secondary: #6a6b76;
  --c-background-primary: #d0d1de;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--c-text-primary);
  background-color: var(--c-background-primary);	
  line-height: 1.5;
}

input, button, select, textarea {
  font: inherit;
}

.modal {
  width: 90%;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 10vh;
  margin-bottom: 10vh;
  background-color: #FFF;
  border-radius: .5rem;
  box-shadow: 0 5px 15px rgba(#000, .2); 
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem;
}

.logo-circle {
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background-color: var(--c-action-primary-accent);
  svg {
    max-width: 1.5rem;
  }
}

.btn-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .25rem;
  border: none;
  background-color: transparent;
  &:hover, &:focus {
    background-color: var(--c-action-primary-accent);
  }
}

.modal-body {
  padding: 1rem 1.5rem;
}

.modal-title {
  font-weight: 700;
}

.modal-description {
  color: var(--c-text-secondary);
}

.upload-area {
  margin-top: 1.25rem;
  border: none;
  background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='%23ccc' stroke-width='3' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
  background-color: transparent;
  padding: 3rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  &:hover, &:focus {
      background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='%232e44ff' stroke-width='3' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
      background-color: rgba(46, 68, 255, 0.05);
  }
}

/* Styles for the loading indicator in table row */
.row-loading-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 36px;
}

.row-loading-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.row-loading-dots div {
  width: 8px;
  height: 8px;
  background-color: var(--c-action-primary);
  border-radius: 50%;
  animation: row-bounce 0.8s infinite alternate;
}

.row-loading-dots div:nth-child(2) {
  animation-delay: 0.2s;
}

.row-loading-dots div:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes row-bounce {
  to {
    transform: translateY(-6px);
  }
}

/* Thumbnail placeholder during loading */
.thumbnail-placeholder {
  width: 60px;
  height: 60px;
  background-color: #f0f0f0;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background-image: url('/static/img/placeholder.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

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

/* Error indicators */
.error-icon {
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  color: #ff4d4d;
}

.error-text {
  color: #ff4d4d;
  font-size: 0.9rem;
}

.thumbnail-placeholder {
  width: 60px;
  height: 60px;
  background-color: #f0f0f0;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.thumbnail-placeholder::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% {
    left: 100%;
  }
}

.error-icon {
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
}

.error-text {
  color: #e74c3c;
}

.upload-area-icon {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  svg {
    max-height: 100%;
    max-width: 100%;
  }
}

.upload-area-title {
  margin-top: 1rem;
  display: block;
  font-weight: 700;
    color: var(--c-text-primary);
}

.upload-area-description {
    display: block;
    color: var(--c-text-secondary);
  strong {
    color: var(--c-action-primary);
    font-weight: 700;
  }
}

.modal-footer {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  justify-content: center; /* Align buttons to the center */
  [class*="btn-"] {
    margin: 0 .75rem; /* Adjusted to add margin on both sides */
  }  
}

.btn-secondary, .btn-primary {
  padding: .5rem 1rem;
  font-weight: 500;
  border: 2px solid var(--c-action-secondary);
  border-radius: .25rem;
  background-color: transparent;
}

.btn-primary {
  color: #FFF;
  background-color: var(--c-action-primary);
  border-color: var(--c-action-primary);
}

/* Add this to your styles.css file */
button.disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:not(:disabled) {
  opacity: 1;
  cursor: pointer;
}

/* Style for successful upload message */
.success-message {
  color: green;
}

/* Center the upload area description text */
.upload-area-description {
  text-align: center;
}

.upload-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #FFBABA; /* Default background for error messages */
  color: #D8000C; /* Default text color for error messages */
  border-radius: 5px;
  padding: 10px 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: none; /* Initially hidden */
  z-index: 1000; /* Ensure it appears above other content */
  max-width: 300px; /* Limit the width for readability */
  font-size: 14px; /* Adjust based on your design */
  line-height: 1.4;
  visibility: hidden; /* Initially not visible */
  opacity: 0; /* Start with it invisible for the transition */
  transition: opacity 0.5s, visibility 0.5s; /* Smooth transition for appearing and disappearing */
}

/* Styles for different message types */
.upload-message-success {
  background-color: #DFF2BF;
  color: #4F8A10;
}

.upload-message-error {
  background-color: #FFBABA;
  color: #D8000C;
}

.upload-message-info {
  background-color: #BDE5F8;
  color: #00529B;
}

/* Container to hold the loading dots */
.container {
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
}

/* Flex container to position dots inline and centered */
.flexContainer {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 60px; /* Adjust based on the total width you prefer */
}

/* Styling for the orange dot */
.ogDot {
  border-radius: 50%;
  height: 30px;
  width: 30px;
  background-color: #2e44ff;
  animation: shimmyO 0.5s linear alternate infinite;
}

/* Styling for the white dot */
.whDot {
  border-radius: 50%;
  height: 30px;
  width: 30px;
  background-color: #fff;
  animation: shimmyW 0.5s linear alternate infinite;
}

/* Animation for the orange dot */
@keyframes shimmyO {
  100% {
    transform: translateX(30px);
  }
}

/* Animation for the white dot */
@keyframes shimmyW {
  100% {
    transform: translateX(-30px);
  }
}

/* Styles for upload results table */
#uploadResultsContainer {
  margin-top: 2rem;
  padding: 0 1.5rem 1.5rem;
}

.results-title {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--c-text-primary);
  font-weight: 700;
}

.table-container {
  width: 100%;
}

#uploadResultsTable {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Set width for each column */
#uploadResultsTable th:nth-child(1),
#uploadResultsTable td:nth-child(1) {
  width: 80px;
}

#uploadResultsTable th:nth-child(2),
#uploadResultsTable td:nth-child(2) {
  width: 50%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#uploadResultsTable th:nth-child(3),
#uploadResultsTable td:nth-child(3) {
  width: 30%;
  text-align: center;
}

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

#uploadResultsTable th {
  background-color: var(--c-action-primary-accent);
  color: var(--c-text-primary);
  font-weight: 600;
}

#uploadResultsTable tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

#uploadResultsTable tr:hover {
  background-color: rgba(46, 68, 255, 0.05);
}

.result-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  margin-right: 0.5rem;
  font-size: 0.9rem;
  background-color: var(--c-action-primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-small:hover {
  background-color: #1e34ef;
}