/* KOVA AI WIDGET CSS */
:root {
  --kova-primary: #FF2D00;
  --kova-dark: #1a1a1a;
  --kova-bg: #0f0f0f;
  --kova-text: #ffffff;
  --kova-gray: #888888;
}

/* LAUNCHER */
.kova-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, var(--kova-primary) 0%, #ff4520 100%);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4), 0 0 0 1px rgba(255,255,255,0.1);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 9999;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4), 0 0 0 1px rgba(255,255,255,0.1); }
  50% { box-shadow: 0 4px 25px rgba(255, 107, 53, 0.6), 0 0 0 1px rgba(255,255,255,0.2); }
}

.kova-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6);
}

.kova-launcher.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.kova-avatar {
  width: 32px;
  height: 32px;
  background: white;
  color: var(--kova-primary);
  border-radius: 50%;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.kova-label {
  font-weight: 600;
  font-size: 16px;
}

/* WINDOW */
.kova-window {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 380px;
  height: 600px;
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(51, 51, 51, 0.8);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 9999;
  font-family: 'Inter', sans-serif;
}

.kova-window.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* HEADER - RULE 17 Identity */
.kova-header {
  padding: 20px;
  background: var(--kova-dark);
  border-bottom: 1px solid #333;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.kova-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: white;
}

.kova-role {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--kova-primary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kova-powered {
  margin: 4px 0 0;
  font-size: 10px;
  color: var(--kova-gray);
}

.kova-close {
  background: none;
  border: none;
  color: var(--kova-gray);
  font-size: 24px;
  cursor: pointer;
}

/* MESSAGES */
.kova-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kova-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.kova-model {
  align-self: flex-start;
  background: var(--kova-dark);
  color: #ddd;
  border: 1px solid #333;
}

.kova-user {
  align-self: flex-end;
  background: var(--kova-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

/* INPUT */
.kova-input-area {
  padding: 16px;
  background: var(--kova-dark);
  border-top: 1px solid #333;
  border-radius: 0 0 16px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.kova-input-area textarea {
  flex: 1;
  background: #000;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px;
  color: white;
  resize: none;
  height: 40px;
  font-family: inherit;
}

.kova-input-area textarea:focus {
  outline: none;
  border-color: var(--kova-primary);
}

.kova-input-area textarea:disabled {
  opacity: 0.5; 
  cursor: not-allowed;
}

.kova-input-area button {
  background: var(--kova-primary);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kova-input-area button:disabled {
  background: #444;
  cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .kova-window {
    width: 100%;
    height: 100dvh; /* Modern mobile viewport support */
    bottom: 0;
    right: 0;
    border-radius: 0;
    border: none;
  }
  
  .kova-header {
    border-radius: 0;
    padding-top: env(safe-area-inset-top, 20px); /* Notch support */
  }
  
  .kova-input-area {
    border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom, 20px); /* Home bar support */
  }
}
