:root {
    --bg-color: #f9f9f9;
    --bg-color2: #eecedc;
    --color3: #fde3de;
    --color4: #c1bdae;
    --color5: #a9d2c7;
    --bg-dark: #4e464c;
    --bg-dark2: #2f2a2f;
}

@font-face {
    font-family: 'Angella White';
    src: url('/static/fonts/angella_white/Angella\ White\ Personal\ Use\ Only.ttf') format('truetype');
}

body {
    background: linear-gradient(135deg, var(--bg-color), var(--bg-color2));
    background-image: url('/static/img/patcc.webp');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--color3);
    font-family: "Helvetica Neue", Arial, sans-serif;
}
.container {
    /* background: linear-gradient(60deg,rgba(78, 70, 76, 1) 0%, rgba(47, 42, 47, 1) 100%); */
    background-color: rgba(238, 206, 220, 0.6);
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    max-width: 80%;
    text-align: center;
    margin: 0 auto;    /* center horizontally */
}

h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
p { font-size: 1rem; margin-bottom: 1.5rem; color: #666; }

.footer {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--bg-dark);
}

.upload-box {
    border: 2px dashed var(--color4);
    border-radius: 1rem;
    padding: 2rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
    display: block;
    background: rgba(169, 210, 199, 0.5);
    color: var(--bg-dark);
}
.upload-box:hover { border-color: #555; }

input[type="file"] { display: none; }

.btn {
    margin-top: 1rem;
    display: inline-block;
    padding: 1.2rem 3rem;
    background: var(--color5);
    color: var(--bg-dark);
    font-weight: bold;
    font-size: large;
    border-radius: 2rem;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}
.btn:hover { 
    background: #555; 
    color: var(--color3);
}

.messages {
    margin-bottom: 1rem;
}
.messages .success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}
.messages .error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

#file-count {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: --var(--bg-dark2);
}

/* Preview gallery */
#preview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1rem;
    gap: 0.5rem;
}
.preview-item {
    position: relative;
}
.preview-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid #ccc;
}
.remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    cursor: pointer;
    line-height: 18px;
    text-align: center;
}

.big-header {
    font-family: 'Angella White';
    font-size: 5rem;
    color: var(--color5);
    margin-bottom: 2.5rem;
}

.subheader {
    font-size: 1.2rem;
    color: var(--bg-dark2);
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.4);
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
}

.stats-body {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* --- Container --- */
#upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: center;
  text-align: center;
}

#file-count {
  font-size: 1rem;
  color: #555;
}

/* --- Preview Grid --- */
#preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 900px;
}

/* --- Individual Item --- */
.preview-item {
  position: relative;
  background: #fafafa;
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.2s ease-in-out;
}

.preview-item:hover {
  border-color: #4cafef;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* --- Thumbnails --- */
.preview-item img {
  max-width: 100%;
  max-height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

/* --- Remove Button --- */
.remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #ff4d4d;
  color: white;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s;
}

.remove-btn:hover {
  background: #e60000;
}

/* --- Progress Bar --- */
.progress-bar {
  margin-top: 0.5rem;
  width: 100%;
  height: 8px;
  appearance: none;
}

.progress-bar::-webkit-progress-bar {
  background-color: #eee;
  border-radius: 6px;
}

.progress-bar::-webkit-progress-value {
  background: var(--color5);
  border-radius: 6px;
}

.progress-bar::-moz-progress-bar {
  background: var(--color5);
  border-radius: 6px;
}

.progress-bar.error::-webkit-progress-value,
.progress-bar.error::-moz-progress-bar {
  background: #ff4d4d;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
  #preview {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
  }

  .preview-item img {
    max-height: 80px;
  }
}
