.cmc-photo-upload-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 15px;
  box-sizing: border-box;
  width: 100%;
}

.cmc-photo-upload-modal.active {
  opacity: 1;
  visibility: visible;
}

.cmc-photo-upload-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-sizing: border-box;
}

.cmc-photo-upload-modal.active .cmc-photo-upload-content {
  transform: scale(1);
}

.cmc-photo-upload-header {
  padding: 15px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.cmc-photo-upload-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.cmc-photo-upload-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #999;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  flex-shrink: 0;
}

.cmc-photo-upload-close:hover {
  background: #f5f5f5;
}

.cmc-photo-upload-body {
  padding: 15px;
  box-sizing: border-box;
}

.cmc-photo-upload-preview {
  text-align: center;
  margin-bottom: 15px;
}

.cmc-photo-preview-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #f0f0f0;
  margin: 0 auto 10px;
  max-width: 100%;
  height: auto;
}

.cmc-photo-upload-form {
  margin-top: 15px;
}

.cmc-form-group {
  margin-bottom: 15px;
}

.cmc-form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
  font-size: 14px;
}

.cmc-file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
}

.cmc-file-input {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.cmc-file-input-button {
  display: block;
  width: 100%;
  padding: 12px 15px;
  background: #f8f9fa;
  border: 2px dashed #ddd;
  border-radius: 8px;
  text-align: center;
  color: #666;
  font-weight: 500;
  transition: all 0.2s;
  box-sizing: border-box;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.cmc-file-input-button:hover {
  background: #f0f1f2;
  border-color: #ccc;
}

.cmc-file-input-button.cmc-has-file {
  background: #f0f8ff;
  border-color: #7a27ff;
  color: #7a27ff;
}

.cmc-photo-upload-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.cmc-btn {
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  flex: 1;
  min-width: 100px;
  box-sizing: border-box;
  font-size: 14px;
}

.cmc-btn-primary {
  background: #7a27ff;
  color: white;
}

.cmc-btn-primary:hover {
  background: #6a20e5;
}

.cmc-btn-secondary {
  background: #f8f9fa;
  color: #666;
  border: 1px solid #ddd;
}

.cmc-btn-secondary:hover {
  background: #f0f1f2;
}

.cmc-loading {
  display: none;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
}

.cmc-loading.active {
  display: block;
}

.cmc-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #7a27ff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.cmc-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 100001;
  transition: transform 0.3s ease;
  max-width: 90%;
  box-sizing: border-box;
  text-align: center;
}

.cmc-notification.show {
  transform: translateX(-50%) translateY(0);
}

.cmc-notification.success {
  background: #4caf50;
}

.cmc-notification.error {
  background: #f44336;
}

/* Responsive adjustments for the modal */
@media (max-width: 768px) {
  .cmc-photo-upload-content {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 100vh;
  }
  
  .cmc-photo-upload-header {
    padding: 12px;
  }
  
  .cmc-photo-upload-title {
    font-size: 16px;
  }
  
  .cmc-photo-upload-body {
    padding: 12px;
  }
  
  .cmc-photo-preview-img {
    width: 100px;
    height: 100px;
  }
  
  .cmc-btn {
    min-width: 80px;
    padding: 8px 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .cmc-photo-upload-content {
    border-radius: 0;
    height: 100vh;
    max-height: 100vh;
  }
  
  .cmc-photo-upload-header {
    padding: 10px;
  }
  
  .cmc-photo-upload-title {
    font-size: 15px;
  }
  
  .cmc-photo-upload-body {
    padding: 10px;
  }
  
  .cmc-photo-preview-img {
    width: 80px;
    height: 80px;
  }
  
  .cmc-form-group {
    margin-bottom: 12px;
  }
  
  .cmc-photo-upload-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .cmc-btn {
    width: 100%;
  }
  
  .cmc-notification {
    left: 10px;
    right: 10px;
    max-width: calc(100% - 20px);
    transform: translateY(-120%);
    font-size: 13px;
  }
  
  .cmc-notification.show {
    transform: translateY(0);
  }
}