/* Upload Button */
.upload-button {
  display: inline-block; /* Changed to inline-block for better button styling */
  margin: 20px auto;
  padding: 8px 14px; /* Matched with .btn padding */
  background: #D3B67F; /* Primary button background */
  color: #fff; /* Primary button text color */
  border: 1px solid rgba(255,255,255,.3); /* Primary button border */
  border-radius: 10px; /* Matched with .btn border-radius */
  cursor: pointer;
  font-size: 14px;
  font-weight: 600; /* Matched with .btn font-weight */
  transition: .2s ease; /* Matched with .btn transition */
}

.upload-button:hover {
  background: #E5C890; /* Primary button hover background */
  transform: translateY(-2px); /* Primary button hover effect */
}

/* Upload Modal */
.upload-modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0, 0, 0, 0.7); /* Black w/ opacity */
  justify-content: center;
  align-items: flex-start;
  padding: 20px 16px;
}

.upload-modal-content {
  background: var(--card); /* Matched with theme card background */
  margin: 20px auto;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.1); /* Matched with theme card border */
  width: 100%;
  max-width: 600px;
  border-radius: 16px; /* Matched with theme card border-radius */
  position: relative;
  text-align: center;
  color: var(--text); /* Matched with theme text color */
  box-shadow: 0 20px 60px rgba(0,0,0,.5); /* Matched with theme card shadow */
}

/* 移动端上传模态框优化 */
@media (max-width: 900px){
  .upload-modal-content {
    padding: 20px;
    margin: 16px auto;
  }
  
  .drop-area {
    padding: 30px 20px;
  }
  
  .file-preview-item {
    width: 80px;
    height: 80px;
  }
  
  .upload-button, .start-upload-button, .manage-button {
    padding: 12px 20px;
    font-size: 16px;
  }
  
  .gallery-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .gallery-action-buttons {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }
  
  .gallery-action-buttons button {
    width: 100%;
  }
}

/* Close Button */
.close-button {
  color: var(--muted); /* Adjusted to theme muted color */
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: var(--primary); /* Adjusted to theme primary color */
  text-decoration: none;
  cursor: pointer;
}

/* Drop Area */
.drop-area {
  border: 2px dashed var(--muted); /* Adjusted to theme muted color */
  border-radius: 10px;
  padding: 50px;
  text-align: center;
  margin-top: 20px;
  cursor: pointer;
  color: var(--muted); /* Adjusted to theme muted color */
}

.drop-area.highlight {
  border-color: var(--primary); /* Adjusted to theme primary color */
  background-color: rgba(110, 231, 255, 0.1); /* Light primary background */
}

/* File Previews */
.file-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  justify-content: center;
}

.file-preview-item {
  position: relative;
  width: 100px;
  height: 100px;
  border: 1px solid rgba(255,255,255,.1); /* Adjusted to theme border */
  border-radius: 5px;
  overflow: hidden;
}

.file-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview-item .remove-file {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(0, 0, 0, 0.6); /* Darker background for visibility */
  color: #fff; /* White text for contrast */
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
}

/* Upload Progress */
.upload-progress-container {
  width: 100%;
  background-color: rgba(255,255,255,.1); /* Light background for container */
  border-radius: 5px;
  margin-top: 20px;
  display: none; /* Hidden by default */
}

.upload-progress-bar {
  width: 0%;
  height: 20px;
  background-color: var(--primary); /* Adjusted to theme primary color */
  border-radius: 5px;
  text-align: center;
  color: #fff; /* White text for contrast */
  line-height: 20px;
}

.upload-progress-text {
  margin-left: 10px;
  font-weight: bold;
}

/* Start Upload Button */
.start-upload-button {
  display: inline-block; /* Changed to inline-block for better button styling */
  margin: 20px auto 0;
  padding: 8px 14px; /* Matched with .btn padding */
  background: #D3B67F; /* Primary button background */
  color: #fff; /* Primary button text color */
  border: 1px solid rgba(255,255,255,.3); /* Primary button border */
  border-radius: 10px; /* Matched with .btn border-radius */
  cursor: pointer;
  font-size: 14px;
  font-weight: 600; /* Matched with .btn font-weight */
  transition: .2s ease; /* Matched with .btn transition */
}

.start-upload-button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  border-color: transparent; /* Adjust disabled border */
}

.start-upload-button:hover:not(:disabled) {
  background: #E5C890; /* Primary button hover background */
  transform: translateY(-2px); /* Primary button hover effect */
}

.manage-button{
  display:inline-block;
  margin:20px auto;
  padding:8px 14px;
  background:#d87f7f;
  color:#fff;
  border:1px solid rgba(255,255,255,.3);
  border-radius:10px;
  cursor:pointer;
  font-size:14px;
  font-weight:600;
  transition:.2s ease;
}
.manage-button:hover{
  background:#e08f8f;
  transform:translateY(-2px);
}

.gallery-item{
  position:relative; /* to position delete icon */
}
.delete-icon{
  position:absolute;
  top:8px;
  right:8px;
  background:rgba(0,0,0,.6);
  color:#fff;
  width:24px;
  height:24px;
  line-height:24px;
  text-align:center;
  border-radius:50%;
  cursor:pointer;
  font-size:18px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.gallery-header h1 {
  margin: 0;
}

.gallery-action-buttons {
  display: flex;
  gap: 10px;
}
.upload-progress-container{display:none!important;}