body {
    height: 100dvh;
    margin: 0;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    background: white;
    box-sizing: border-box;
    overflow: hidden;
}

.blob-bg {
  background-color: white;
  background-image: 
    radial-gradient(at 10% 10%, rgba(0, 80, 250, 0.3) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(5, 71, 170, 0.445) 0px, transparent 80%);
}

.update-warning {
  color: orange;
  background: #fcfcfc;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 500;
  margin-bottom: 16px;
  margin-top: 8px;
  display: block;
  box-shadow: 0 2px 8px rgba(255, 214, 0, 0.07);
}

.update-warning a {
  color: #1976d2;
  text-decoration: underline;
}

.update-warning span {
  margin-right: 8px;
  vertical-align: middle;
}

.container {
    height: calc(100dvh - 48px);
    display: flex;
    flex-direction:column;
    justify-content: center;
    
}

.container.web-mode {
    width: min(500px, calc(100vw - 48px));
}

.container.login {
    padding-inline: 30px;
}

h2,
h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

h4 {
    margin-top: 0;
    margin-bottom: 6px;
}

h5 {
    margin-top: 6px;
    margin-bottom: 6px;
}

h5:first-child {
    margin-top: 0;
}

#info {
    margin-bottom: 12px;
}

.preview {
    margin-bottom: 12px;
    flex: 1 1 auto;
    max-height: 80vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    align-content: start;
}

.preview-uploaded {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.date-group {
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.photo-uploaded {
    display: flex;
    gap: 16px;
    align-items: center;
}

.photo-uploaded img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    vertical-align: top;
}

.preview img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.photo-uploaded img {
    width: 80px;
}

.photo-wrapper {
    width: 100%;
    height: 0;
    padding-bottom: calc(100% * 4 / 3);
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(238, 238, 238, 0.3);
}

.badge-container {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.badge {
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 6px;
    font-weight: 600;
    color: #fff;
    backdrop-filter: blur(4px);
}

.badge-danger {
    background: rgba(220, 38, 38, 0.6);
}

.badge-success {
    background: rgba(34, 197, 94, 0.6);
}

.buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-buttons {
    margin-top: auto;
}

button {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid gray;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 16px;
    cursor: pointer;
}

#pickPhotoBtn.web-mode {
    padding: 20px;
}

button.navigation {
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    white-space: nowrap;
}

button.control {
    padding: 8px;
    font-size: 14px;
    border: none;
    color: white;
    transition: all 0.2s ease;
}

button.control.send {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

button.control.cancel {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

button.control.send:hover {
  transform: translateY(-1px);
}

button.control.cancel:hover {
  transform: translateY(-1px);
}

button.control:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

button.control.send:disabled,
button.control.cancel:disabled {
  opacity: 0.5;
  filter: grayscale(0.2);
  cursor: not-allowed;
}

button.control.abort {
  background: linear-gradient(135deg, #ff9800, #f97316);
}

button.control.abort:hover { transform: translateY(-1px); }

button.del {
    padding: 4px 5px;
    position: absolute;
    right: 6px;
    bottom: 6px;
    font-size: 12px;
    line-height: 1;
    border: none;
}

.status {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 12px;
}

.header {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
}

.header-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.header-select {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

select {
    position: relative;
    display: inline-block;
    padding: 8px 36px 8px 12px;

    font-size: 16px;
    border-radius: 6px;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background: white;
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

.form-group {
    margin-bottom: 16px;
}
.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
}

.error {
    color: red;
    padding: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.status-uploaded { color: green; }
.status-sending { color: orange; }
.status-notUploaded { color: red; }

/* Spinner overlay shown when a photo is marked as pending upload */
.spinner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.18);
  border-radius: 8px;
  pointer-events: none;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid rgba(255,255,255,0.85);
  border-top-color: rgba(255,255,255,0.18);
  border-radius: 50%;
  animation: spinner-rotate 1s linear infinite;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}
