/* ============================================================================
   Modern Components - Shared Styles
   ============================================================================ */

/* Component Base Styles */
.modern-card {
  position: relative;
  padding: 1.5rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.modern-card-icon {
  width: 40px;
  height: 40px;
}

.modern-card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.modern-card-description {
  color: #b8c5d6;
  font-size: 0.95rem;
  margin: 0;
}

.modern-card-stats {
  color: #8892A6;
  font-size: 0.9rem;
  margin: 0;
}

.modern-card-glow {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  background: #1a1f3a;
  border: 1px solid rgba(0, 102, 204, 0.3);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.dropdown-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item {
  padding: 0.75rem 1rem;
  color: #c0c0c0;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: rgba(0, 102, 204, 0.2);
}

/* Accordion */
.accordion {
  margin-bottom: 0.5rem;
}

.accordion-header {
  background: rgba(0, 102, 204, 0.2);
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.accordion-header:hover {
  background: rgba(0, 102, 204, 0.3);
}

.accordion-icon {
  transition: transform 0.3s ease;
  color: #00A0E3;
  font-weight: 700;
}

.accordion-icon.expanded {
  transform: rotate(90deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1rem;
}

.accordion-content.open {
  padding: 1rem;
}

/* Modern Input */
.modern-input-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.modern-input,
.modern-textarea,
.modern-select {
  width: 100%;
  background: rgba(26, 31, 58, 0.6);
  border: 2px solid rgba(0, 102, 204, 0.4);
  border-radius: 10px;
  padding: 1rem;
  color: white;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}

.modern-textarea {
  resize: vertical;
  min-height: 120px;
}

.modern-input:focus,
.modern-textarea:focus,
.modern-select:focus {
  border-color: rgba(102, 126, 234, 0.4);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modern-input-label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  color: #8892A6;
  font-size: 1rem;
  pointer-events: none;
  transition: all 0.3s ease;
  background: #0A0E27;
  padding: 0 0.5rem;
}

.modern-input:focus + .modern-input-label,
.modern-input:not(:placeholder-shown) + .modern-input-label,
.modern-textarea:focus + .modern-input-label,
.modern-textarea:not(:placeholder-shown) + .modern-input-label,
.modern-select:focus + .modern-input-label,
.modern-select:not([value=""]) + .modern-input-label {
  top: -0.6rem;
  font-size: 0.85rem;
  color: #00d4aa;
  font-weight: 600;
}

/* Purple Button */
.purple-button {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.purple-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.purple-button.outline {
  background: transparent;
  border: 2px solid #667eea;
  color: #667eea;
  box-shadow: none;
}

.purple-button.outline:hover {
  background: rgba(102, 126, 234, 0.1);
}

/* Chat Interface */
.chat-interface {
  background: rgba(26, 31, 58, 0.3);
  border-radius: 16px;
  border: 1px solid rgba(0, 102, 204, 0.2);
  padding: 1.5rem;
  height: 600px;
  max-height: 600px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
  max-height: 100%;
}

.chat-message {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.chat-avatar.user {
  background: #0066CC;
}

.chat-avatar.assistant {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.chat-message-content {
  flex: 1;
}

.chat-message-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.chat-message-name.user {
  color: #00D4FF;
}

.chat-message-name.assistant {
  color: #667eea;
}

.chat-message-text {
  color: #c0c0c0;
  line-height: 1.6;
  font-size: 0.95rem;
}

.chat-input-box {
  background: rgba(26, 31, 58, 0.6);
  border: 2px solid rgba(0, 102, 204, 0.4);
  border-radius: 16px;
  padding: 1rem;
}

.chat-input-box:focus-within {
  border-color: rgba(102, 126, 234, 0.4);
}

.chat-input {
  width: 100%;
  background: transparent;
  border: none;
  color: white;
  font-size: 0.95rem;
  resize: none;
  outline: none;
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 60px;
}

.chat-input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-quick-actions {
  display: flex;
  gap: 0.5rem;
}

/* Animation Keyframes */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

/* Utility Classes */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.gap-1 {
  gap: 1rem;
}

.mb-1 {
  margin-bottom: 1rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

/* Modern Navigation */
.modern-nav {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 2px solid rgba(0, 102, 204, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  color: white;
}

.nav-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  padding: 0.5rem;
}

.nav-brand-text {
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.nav-items {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-item[data-dropdown]::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.5rem;
  background: transparent;
}

.nav-link {
  color: #c0c0c0;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  transition: color 0.2s;
  display: inline-block;
  cursor: pointer;
}

.nav-link:hover {
  color: white;
}

.nav-item.active .nav-link {
  color: white;
  font-weight: 600;
  border-bottom: 2px solid #00d4ff;
}

.nav-item.highlight .nav-link {
  color: #00d4ff;
  font-weight: 600;
}

.dropdown-arrow {
  font-size: 0.8em;
  margin-left: 0.25rem;
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: #1a1f3a;
  border: 1px solid rgba(0, 102, 204, 0.3);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  min-width: 180px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  padding-top: 0.5rem;
  margin-top: 0;
}

.nav-item[data-dropdown]:hover .nav-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #c0c0c0;
  text-decoration: none;
  transition: background 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-dropdown-item:last-child {
  border-bottom: none;
}

.nav-dropdown-item:hover {
  background: rgba(0, 102, 204, 0.2);
  color: white;
}

.nav-dropdown-item.active {
  background: rgba(0, 102, 204, 0.3);
  color: white;
  font-weight: 600;
}

/* ============================================================================
   Back to Top Button
   ============================================================================ */

.back-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 160, 227, 0.8), rgba(0, 212, 255, 0.8));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 160, 227, 0.4);
  box-shadow: 0 8px 24px rgba(0, 160, 227, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 32px rgba(0, 160, 227, 0.6);
  background: linear-gradient(135deg, rgba(0, 160, 227, 0.9), rgba(0, 212, 255, 0.9));
}

.back-to-top-btn svg {
  width: 24px;
  height: 24px;
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .back-to-top-btn {
    width: 48px;
    height: 48px;
    bottom: 1.5rem;
    right: 1.5rem;
  }
}
