/* AI Canvas - Custom Styles */

:root {
  /* Cisco-inspired color palette */
  --cisco-blue: #049FD9;
  --cisco-light-blue: #00BCEB;
  --cisco-green: #6CC04A;
  --cisco-orange: #FF9E18;
  
  /* Backgrounds */
  --bg-dark: #1E1E1E;
  --bg-card-dark: #2A2A2A;
  
  /* Borders */
  --border-color: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: pan-x pan-y;
  overflow: hidden; /* Prevent body scroll */
}

/* Prevent iOS zoom on input focus */
input, textarea, select {
  font-size: 16px !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1E1E1E;
}

::-webkit-scrollbar-thumb {
  background: #4B5563;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6B7280;
}

/* Canvas styling */
#canvas {
  min-height: 100vh;
  min-width: 100vw;
  position: relative;
}

/* Card animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slideUp 0.3s ease-out;
}

/* Card styling */
.card {
  animation: fadeIn 0.5s ease-out;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2), 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card.selected {
  border-color: var(--cisco-light-blue) !important;
  box-shadow: 0 0 0 3px rgba(0, 188, 235, 0.3);
}

.card-header {
  user-select: none;
}

/* Card type specific styles */
.card-content pre {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.4;
}

.card-content table {
  border-collapse: collapse;
}

.card-content code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
}

/* Loading spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Button hover effects */
button {
  user-select: none;
}

button:active {
  transform: scale(0.98);
}

/* Notification styles */
.notification {
  animation: slideUp 0.3s ease-out;
  pointer-events: none;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
  .card {
    width: 90vw !important;
    max-width: 350px !important;
  }
  
  header {
    flex-wrap: wrap;
  }
  
  header > div {
    flex-wrap: wrap;
  }
}

/* iPad optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
  .card {
    width: 45vw !important;
    max-width: 400px !important;
  }
}

/* Safe area insets for iOS */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Prevent text selection while dragging */
.ui-draggable-dragging {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Focus styles for accessibility */
button:focus,
input:focus {
  outline: 2px solid var(--cisco-light-blue);
  outline-offset: 2px;
}

/* Keyboard shortcut badges */
kbd {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  font-size: 11px;
}

/* Glass morphism effect for cards */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 0.5rem;
  pointer-events: none;
}

/* Pulse animation for listening indicator */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth transitions for theme switching */
body, .card, header, #canvas {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light mode adjustments */
body.light-mode {
  background-color: #F5F5F5;
  color: #1F2937;
}

body.light-mode .card {
  background-color: #FFFFFF;
  border-color: #E5E7EB;
}

body.light-mode header {
  background-color: #FFFFFF;
  border-color: #E5E7EB;
}

body.light-mode #canvas {
  background: linear-gradient(135deg, #F5F5F5 0%, #E5E7EB 100%);
}

/* Transcript ticker animation */
#current-transcript {
  transition: all 0.3s ease;
}

#current-transcript:not(:empty) {
  background: linear-gradient(90deg, transparent 0%, rgba(59, 130, 246, 0.1) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: ticker 3s linear infinite;
}

@keyframes ticker {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Pin button styles */
.pin-btn {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.pin-btn:hover {
  transform: scale(1.2);
}

/* Close button styles */
.close-btn {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.close-btn:hover {
  transform: scale(1.1) rotate(90deg);
}

/* Ensure cards don't overlap the UI */
.card {
  z-index: 10;
}

.card:hover {
  z-index: 20;
}

/* Improve touch targets for mobile */
button, .pin-btn, .close-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Hide scrollbar when not needed */
#canvas::-webkit-scrollbar {
  display: none;
}

#canvas {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Minimal UI - Bottom Controls */
#mute-btn {
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

#mute-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

#mute-btn:active {
  transform: translateY(0);
}

/* Status indicator */
#status-indicator {
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease-out;
}

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

/* Loading indicator improvements */
#loading-indicator {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
