/* Presentation Modal Styles */
.presentation-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.presentation-modal[aria-hidden="false"] {
  display: flex;
}

.presentation-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.presentation-modal-dialog {
  position: relative;
  width: 90vw;
  max-width: 1100px;
  height: 85vh;
  background: var(--bg-card, #161b22);
  border: 1px solid var(--border-color, #30363d);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.presentation-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #30363d);
  background: var(--bg-secondary, #0d1117);
}

.presentation-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #e6edf3);
  margin: 0;
}

.presentation-modal-actions {
  display: flex;
  gap: 8px;
}

.presentation-modal-actions .btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: transparent;
  border: 1px solid var(--border-color, #30363d);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.presentation-modal-actions .btn-icon:hover {
  background: var(--bg-hover, #21262d);
  border-color: var(--primary, #4b5cf6);
}

.presentation-modal-content {
  flex: 1;
  overflow: hidden;
  background: #0d1117;
}

.presentation-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #0d1117;
}

/* Button in chat message for showing presentation */
.presentation-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;

/* Enhanced Mobile responsiveness */
@media (max-width: 768px) {
  .presentation-modal-dialog {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
  }

  .presentation-modal-header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .presentation-modal-title {
    font-size: 14px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .presentation-modal-actions {
    gap: 4px;
  }

  .presentation-modal-actions .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .presentation-frame {
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .presentation-modal-footer {
    padding: 12px;
    flex-direction: column;
    gap: 10px;
  }

  .presentation-template-select {
    width: 100%;
  }

  .btn-regenerate {
    width: 100%;
    justify-content: center;
  }
}

/* Swipe gesture indicator */
@media (max-width: 768px) and (pointer: coarse) {
  .presentation-modal::after {
    content: "← Свайп для навигации →";
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    animation: fadeOut 3s ease forwards;
  }

  @keyframes fadeOut {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
  }
}

/* Tablet optimization */
@media (min-width: 769px) and (max-width: 1024px) {
  .presentation-modal-dialog {
    width: 95vw;
    max-width: none;
    height: 90vh;
  }
}

/* Print styles */
@media print {
  .presentation-modal {
    position: static;
    display: block !important;
  }

  .presentation-modal-backdrop {
    display: none;
  }

  .presentation-modal-dialog {
    width: 100%;
    height: auto;
    max-width: none;
    border: none;
    box-shadow: none;
  }

  .presentation-modal-header,
  .presentation-modal-footer {
    display: none;
  }

  .presentation-frame {
    height: auto;
    min-height: 100vh;
  }
}

/* Custom prompt input */
.presentation-custom-prompt {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary, #e6edf3);
  background: var(--bg-card, #161b22);
  border: 1px solid var(--border-color, #30363d);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.presentation-custom-prompt:focus {
  border-color: var(--primary, #4b5cf6);
}

.presentation-custom-prompt::placeholder {
  color: var(--text-secondary, #8b949e);
}

.presentation-modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color, #30363d);
  background: var(--bg-secondary, #0d1117);
  flex-wrap: wrap;
}

.presentation-template-select {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary, #e6edf3);
  background: var(--bg-card, #161b22);
  border: 1px solid var(--border-color, #30363d);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  min-width: 180px;
}

.btn-regenerate {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--primary, #4b5cf6);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-regenerate:hover {
  background: var(--primary-hover, #3a4bd9);
}

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

/* Cloud upload progress indicator */
.cloud-upload-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: rgba(75, 92, 246, 0.1);
  border: 1px solid rgba(75, 92, 246, 0.3);
  border-radius: 6px;
  font-size: 11px;
  color: var(--primary, #4b5cf6);
  animation: fadeIn 0.3s ease;
}

.upload-progress-bar {
  width: 60px;
  height: 4px;
  background: rgba(75, 92, 246, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4b5cf6, #7c5cff);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.upload-progress-text {
  white-space: nowrap;
  font-weight: 500;
}

/* Animated states */
.cloud-upload-progress.analyzing .upload-progress-fill {
  width: 100%;
  animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Success/error states */
.cloud-upload-progress.success {
  background: rgba(0, 210, 106, 0.1);
  border-color: rgba(0, 210, 106, 0.3);
  color: #00d26a;
}

.cloud-upload-progress.error {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.3);
  color: #ff6b6b;
}

/* Presentation ready button state */
.presentation-btn.presentation-ready {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border-color: #059669 !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.presentation-btn.presentation-ready:hover {
  background: linear-gradient(135deg, #059669, #047857) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}
