/* Reset i podstawowe style */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    sans-serif;
  line-height: 1.6;
  color: #ffecd1;
  background: #1e1e24;
  padding: 20px;
  min-height: 100vh;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #ffecd1;
  font-size: 2.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Nickname container */
.nickname-container {
  background: rgba(30, 30, 36, 0.8);
  padding: 25px;
  border-radius: 12px;
  border: 2px solid #33333d;
  margin-bottom: 25px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  backdrop-filter: blur(10px);
}

.nickname-label {
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
  color: #ffecd1;
  font-size: 1.1rem;
}

.nickname-input {
  width: 100%;
  padding: 15px 18px;
  font-size: 16px;
  border: 2px solid #33333d;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: #25252d;
  color: #ffecd1;
}

.nickname-input:focus {
  outline: none;
  border-color: #21a179;
  background: #2a2a32;
  box-shadow: 0 0 0 3px rgba(33, 161, 121, 0.3);
}

.nickname-input::placeholder {
  color: #88888d;
}

.nickname-hint {
  font-size: 14px;
  color: #c4b7a6;
  margin-top: 10px;
  font-style: italic;
}

/* Upload container */
.upload-container {
  background: rgba(30, 30, 36, 0.8);
  padding: 25px;
  border-radius: 12px;
  border: 2px solid #33333d;
  margin-bottom: 25px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  backdrop-filter: blur(10px);
}

/* File input */
.file-input-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.custom-file-input {
  display: block;
  width: 100%;
  padding: 25px;
  border: 3px dashed #33333d;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #25252d;
}

.custom-file-input:hover {
  border-color: #21a179;
  background: #2a2a32;
}

#fileInputLabel {
  display: block;
  font-weight: 600;
  font-size: 18px;
  color: #ffecd1;
  margin-bottom: 8px;
}

#fileCount {
  display: block;
  font-size: 14px;
  color: #c4b7a6;
}

/* Limit info styles */
.limit-info {
  margin-top: 15px;
  padding: 15px;
  background: #25252d;
  border-radius: 8px;
  border: 1px solid #33333d;
}

.limit-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: #c4b7a6;
}

.limit-row:last-child {
  margin-bottom: 0;
}

.limit-row span:first-child {
  color: #ffecd1;
}

.limit-ok {
  border-color: #21a179;
  background: rgba(33, 161, 121, 0.1);
}

.limit-warning {
  border-color: #ffa500;
  background: rgba(255, 165, 0, 0.1);
}

.limit-error {
  border-color: #eb5160;
  background: rgba(235, 81, 96, 0.1);
}

/* Progress bar for limits */
.limit-progress {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #33333d;
}

.limit-progress-bar {
  height: 6px;
  background: linear-gradient(90deg, #21a179, #1a8765);
  border-radius: 3px;
  margin-bottom: 5px;
  transition: width 0.3s ease;
}

.limit-progress-text {
  font-size: 12px;
  text-align: center;
  color: #c4b7a6;
}

/* File list styles */
.file-list {
  margin-top: 20px;
  max-height: 300px;
  overflow-y: auto;
  background: #25252d;
  border-radius: 8px;
  border: 1px solid #33333d;
  padding: 15px;
}

.file-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  background: #2a2a32;
  border-radius: 6px;
  border-left: 3px solid #21a179;
}

.file-list-item:last-child {
  margin-bottom: 0;
}

.file-name {
  flex: 1;
  font-size: 14px;
  color: #ffecd1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 10px;
}

.file-size {
  font-size: 12px;
  color: #c4b7a6;
  margin-right: 10px;
}

.file-delete-btn {
  background: #eb5160;
  color: #ffecd1;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.file-delete-btn:hover {
  background: #d43c4a;
  transform: scale(1.1);
}

.file-list-summary {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #33333d;
  font-size: 14px;
  color: #21a179;
  text-align: center;
  font-weight: 600;
}

/* Error box for file limits */
.error-box {
  background: rgba(235, 81, 96, 0.1);
  border: 1px solid #eb5160;
  border-radius: 8px;
  padding: 15px;
  margin-top: 10px;
}

.error-title {
  font-weight: 600;
  color: #eb5160;
  margin-bottom: 10px;
  font-size: 16px;
}

.error-item {
  color: #ffc1c7;
  margin-bottom: 5px;
  font-size: 14px;
  padding-left: 10px;
}

.error-item:last-child {
  margin-bottom: 0;
}

.error-hint {
  margin-top: 10px;
  font-size: 13px;
  color: #c4b7a6;
  font-style: italic;
  border-top: 1px solid rgba(235, 81, 96, 0.3);
  padding-top: 10px;
}

/* Buttons */
.upload-btn,
.download-btn {
  display: block;
  width: 100%;
  max-width: 600px;
  margin: 15px auto;
  padding: 18px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  color: #ffecd1;
}

.upload-btn {
  background: linear-gradient(135deg, #21a179, #1a8765);
  border: 2px solid #21a179;
}

.upload-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #1a8765, #146d51);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(33, 161, 121, 0.4);
}

.upload-btn:disabled {
  background: #33333d;
  border-color: #44444d;
  cursor: not-allowed;
  opacity: 0.7;
}

.download-btn {
  background: linear-gradient(135deg, #eb5160, #d43c4a);
  border: 2px solid #eb5160;
}

.download-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #d43c4a, #b32835);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(235, 81, 96, 0.4);
}

.download-btn:disabled {
  background: #33333d;
  border-color: #44444d;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Status messages */
.status-message {
  text-align: center;
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
  font-weight: 500;
  background: rgba(40, 40, 48, 0.8);
  border: 1px solid #33333d;
}

.status-loading {
  color: #ffecd1;
  background: rgba(33, 161, 121, 0.2);
  border-color: #21a179;
}

.status-success {
  color: #c1ffd7;
  background: rgba(33, 161, 121, 0.2);
  border-color: #21a179;
}

.status-error {
  color: #ffc1c7;
  background: rgba(235, 81, 96, 0.2);
  border-color: #eb5160;
}

/* Preview container */
.preview-container {
  max-width: 600px;
  margin: 30px auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
}

.preview-item {
  position: relative;
  background: #25252d;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  border: 1px solid #33333d;
}

.preview-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  border-color: #21a179;
}

.preview-item img,
.preview-item video {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.preview-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: #eb5160;
  color: #ffecd1;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 1px solid #d43c4a;
}

.preview-delete-btn:hover {
  background: #d43c4a;
  transform: scale(1.1);
}

/* File list item warning for large files */
.file-list-item.large-file {
  border-left-color: #ffa500;
}

.file-list-item.oversized-file {
  border-left-color: #eb5160;
}

/* File input hidden properly */
#fileInput {
  display: none;
}

/* Additional styling for better dark theme */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #25252d;
}

::-webkit-scrollbar-thumb {
  background: #21a179;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #1a8765;
}

/* Scrollbar for file list */
.file-list::-webkit-scrollbar {
  width: 6px;
}

.file-list::-webkit-scrollbar-track {
  background: #25252d;
  border-radius: 3px;
}

.file-list::-webkit-scrollbar-thumb {
  background: #21a179;
  border-radius: 3px;
}

.file-list::-webkit-scrollbar-thumb:hover {
  background: #1a8765;
}

/* Selection color */
::selection {
  background-color: #21a179;
  color: #ffecd1;
}

/* Responsywność */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  h1 {
    font-size: 2rem;
  }

  .nickname-container,
  .upload-container {
    padding: 20px;
  }

  .upload-btn,
  .download-btn {
    padding: 15px;
    font-size: 16px;
  }

  .preview-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }

  .nickname-input {
    padding: 12px 15px;
  }

  .custom-file-input {
    padding: 20px;
  }

  .preview-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Loading animation for upload button */
.upload-btn:disabled:not(:empty) {
  background: #21a179;
  position: relative;
  overflow: hidden;
}

.upload-btn:disabled:not(:empty)::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Glow effect for focused elements */
.nickname-input:focus,
.custom-file-input:hover,
.upload-btn:hover:not(:disabled),
.download-btn:hover:not(:disabled) {
  box-shadow: 0 0 15px rgba(33, 161, 121, 0.3);
}

/* Subtle border animation */
.nickname-container,
.upload-container {
  position: relative;
}

.nickname-container::before,
.upload-container::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #21a179, #eb5160, #21a179);
  border-radius: 14px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nickname-container:hover::before,
.upload-container:hover::before {
  opacity: 0.3;
}
