/* Reset & base */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #EEEEEE;
  color: #31345F;
}

/* Upload page layout */
body.upload-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
}

/* Files page layout */
body.files-page {
  padding: 2rem;
}

.container {
  max-width: 520px;
  width: 100%;
}

.files-page .container {
  max-width: 960px;
  margin: 0 auto;
}

/* Logo */
.logo { margin-bottom: 1.5rem; }
.upload-page .logo { width: 520px; }
.files-page .logo  { width: 100px; }

/* Headings */
h1 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.files-page h1 {
  font-size: 1.3rem;
  margin: 1rem 0 0.5rem;
  text-align: left;
}

h2 { margin-bottom: 1rem; }

/* Subtitle */
.subtitle {
  color: #6CA3BE;
  margin-bottom: 2rem;
  text-align: center;
  font-size: 0.9rem;
}

/* Links */
.back-link {
  color: #6CA3BE;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover { text-decoration: underline; }

.files-link {
  margin-top: 2rem;
  display: inline-block;
  color: #6CA3BE;
  text-decoration: none;
  font-size: 0.9rem;
}

.files-link:hover { text-decoration: underline; }

/* Form */
form { width: 100%; }
.form-group { margin-bottom: 1.2rem; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

input[type="file"] {
  width: 100%;
  padding: 0.6rem;
  border: 2px dashed #6CA3BE;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

input[type="file"]:hover { border-color: #31345F; }

textarea {
  width: 100%;
  padding: 0.6rem;
  border: 2px solid #6CA3BE;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: #31345F;
}

/* Buttons */
button {
  width: 100%;
  padding: 0.8rem;
  background: #6CA3BE;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button:hover { background: #31345F; }
button:disabled { background: #c5dce6; cursor: not-allowed; }

.copy-btn {
  padding: 4px 10px;
  border: 1px solid #6CA3BE;
  color: #31345F;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  width: auto;
}

.copy-btn:hover { background: #EEEEEE; }
.copy-btn.copied { background: #ddeef2; border-color: #6CA3BE; }

.delete-btn {
  padding: 4px 10px;
  border: 1px solid #c97a7a;
  color: #8b3a3a;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  width: auto;
  margin-left: 4px;
}

.delete-btn:hover { background: #e8d5d5; }

/* Select */
.exp-select {
  padding: 4px 6px;
  border: 1px solid #6CA3BE;
  border-radius: 6px;
  font-size: 0.75rem;
  background: #fff;
  color: #31345F;
  cursor: pointer;
}

/* Result box */
.result {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #EEEEEE;
  display: none;
}

.result.error { border-color: #c97a7a; color: #8b3a3a; }
.result.success { border-color: #6CA3BE; color: #31345F; }

/* Progress bar */
.progress-container {
  margin-top: 1rem;
  display: none;
}

.progress-bar-outer {
  width: 100%;
  height: 20px;
  background: #EEEEEE;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar-outer.waiting-dots {
  overflow: visible;
}

.progress-bar-inner {
  height: 100%;
  background: #6CA3BE;
  border-radius: 10px;
  width: 0%;
  transition: width 0.2s;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #6CA3BE;
  margin-top: 0.4rem;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

th {
  background: #31345F;
  color: #fff;
  text-align: left;
  padding: 0.7rem;
  font-size: 0.8rem;
  text-transform: uppercase;
}

td {
  padding: 0.7rem;
  border-top: 1px solid #eee;
  font-size: 0.85rem;
  vertical-align: top;
}

tr:hover td { background: #f0f4f8; }

/* Badges */
.expired { color: #8b3a3a; font-weight: 600; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-ok { background: #ddeef2; color: #31345F; }
.badge-exp { background: #e8d5d5; color: #8b3a3a; }

/* Downloads list */
.downloads-list {
  font-size: 0.75rem;
  color: #6CA3BE;
  max-height: 60px;
  overflow-y: auto;
}

.downloads-list div {
  padding: 2px 0;
  border-bottom: 1px solid #EEEEEE;
}

/* Original name under stored name */
td .orig-name {
  font-size: 0.85em;
  color: #6CA3BE;
}

/* Comment under file name */
td .file-comment {
  font-size: 0.82em;
  color: #888;
  font-style: italic;
}

/* Remaining time under expiration date */
td .remaining-time {
  font-size: 0.82em;
  color: #6CA3BE;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 3rem;
  color: #6CA3BE;
}

/* Language switcher */
.lang-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.3rem;
  z-index: 100;
}

.lang-btn {
  text-decoration: none;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: 2px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  cursor: pointer;
  user-select: none;
}

.lang-btn:hover {
  background: #fff;
  transform: scale(1.15);
}

.lang-btn.active {
  border-color: #6CA3BE;
  background: #fff;
}
