/**
 * Ephemeral Media Messaging Styles
 * Pay-per-view media with auto-delete functionality
 */

/* Media Upload Container */
.media-upload-container {
  margin-bottom: 12px;
}

.select-media-btn {
  padding: 10px 16px;
  background: linear-gradient(135deg, #6CB4EE, #4A90E2);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.select-media-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 180, 238, 0.4);
}

/* Media Upload Panel */
.media-upload-panel {
  background: rgba(75, 0, 130, 0.2);
  border: 1px solid rgba(255, 105, 180, 0.3);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.media-preview-container {
  position: relative;
  width: 100%;
  max-width: 150px;
  margin: 0 auto 10px;
}

.media-preview-image,
.media-preview-video {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.remove-media-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 0, 0, 0.8);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.remove-media-btn:hover {
  background: rgba(255, 0, 0, 1);
  transform: scale(1.1);
}

/* Media Upload Options */
.media-upload-options {
  text-align: left;
}

.media-file-info {
  color: rgba(230, 230, 250, 0.7);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.media-upload-options label {
  display: block;
  color: rgba(230, 230, 250, 0.9);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  margin-top: 8px;
}

.media-price-select {
  width: 100%;
  padding: 8px;
  background: rgba(26, 0, 51, 0.6);
  color: #E6E6FA;
  border: 1px solid rgba(255, 105, 180, 0.3);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* View Mode Options */
.view-mode-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.view-mode-option {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background: rgba(26, 0, 51, 0.4);
  border: 2px solid rgba(255, 105, 180, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-mode-option:hover {
  border-color: rgba(255, 105, 180, 0.5);
  background: rgba(26, 0, 51, 0.6);
}

.view-mode-option input[type="radio"] {
  margin-right: 12px;
  cursor: pointer;
}

.view-mode-option input[type="radio"]:checked + .view-mode-label {
  color: #FFD700;
}

.view-mode-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.view-mode-icon {
  font-size: 1rem;
  margin-right: 6px;
}

.view-mode-label strong {
  font-size: 0.9rem;
  color: #E6E6FA;
}

.view-mode-label small {
  font-size: 0.75rem;
  color: rgba(230, 230, 250, 0.6);
}

.send-media-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #FF1493, #9370DB);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.send-media-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 20, 147, 0.4);
}

.send-media-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Media Messages */
.media-message {
  max-width: 350px;
}

.media-message .media-preview-container {
  position: relative;
  width: 300px;
  height: 300px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 8px;
}

.media-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumbnail.blurred {
  filter: blur(20px);
}

.media-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.media-message.locked .media-overlay {
  opacity: 1;
}

.media-message.unlocked:hover .media-overlay {
  opacity: 1;
}

.media-overlay i {
  font-size: 2rem;
}

.unlock-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.unlock-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #2d1810;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.unlock-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
}

/* Media Info */
.media-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(230, 230, 250, 0.7);
}

.media-badge {
  background: linear-gradient(135deg, rgba(108, 180, 238, 0.3), rgba(74, 144, 226, 0.3));
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6CB4EE;
  border: 1px solid rgba(108, 180, 238, 0.4);
}

/* Media Viewer Modal */
.media-viewer-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.media-viewer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

.media-viewer-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-viewer-image,
.media-viewer-video {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.media-viewer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  z-index: 2;
  transition: all 0.2s ease;
}

.media-viewer-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Countdown Timer */
.countdown-timer {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #FF4500, #FF6347);
  color: white;
  padding: 16px 32px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  z-index: 2;
  box-shadow: 0 4px 16px rgba(255, 69, 0, 0.5);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.05);
  }
}

#countdownSeconds {
  font-size: 1.5rem;
  font-weight: 900;
  color: #FFD700;
}

/* Responsive */
@media (max-width: 768px) {
  .media-message .media-preview-container {
    width: 250px;
    height: 250px;
  }

  .media-preview-container {
    max-width: 250px;
  }

  .countdown-timer {
    font-size: 0.9rem;
    padding: 12px 20px;
  }

  #countdownSeconds {
    font-size: 1.2rem;
  }
}
