/* Custom CSS for Xiangen's AI Collaboration Hub */

:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --border-radius: 0.5rem;
  --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  --transition: all 0.15s ease-in-out;
}

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--dark-color);
  background-color: #f8f9fa;
  position: relative;
  overflow-x: hidden;
}

/* Global Video Background */
.global-video-background {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: -10;
  object-fit: cover;
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.3) 0%, rgba(0, 86, 179, 0.4) 100%);
  z-index: -9;
  pointer-events: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.display-1, .display-2, .display-3, .display-4 {
  font-weight: 700;
}

/* Navigation */
.navbar {
  box-shadow: var(--box-shadow);
  backdrop-filter: blur(10px);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
}

.navbar-nav .nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: var(--transition);
}

.navbar-nav .nav-link:hover {
  color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-nav .nav-link.active {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
}

/* Main Content */
.main-content {
  margin-top: 0; /* Remove margin since no navbar */
  min-height: 100vh;
  position: relative;
}

.content-section {
  animation: fadeIn 0.3s ease-in-out;
}

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

/* Hero Section */
.hero-section {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-video-background {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: -2;
  object-fit: cover;
  background-attachment: fixed;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.4) 0%, rgba(0, 86, 179, 0.5) 100%);
  z-index: -1;
  pointer-events: none;
}

.hero-section .container {
  position: relative;
  z-index: 1;
}

.hero-content {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  padding: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Fallback for browsers that don't support video */
@supports not (object-fit: cover) {
  .hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
  }
  
  .hero-video-background {
    display: none;
  }
}

/* Cards */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.card:hover {
  box-shadow: var(--box-shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  background-color: rgba(var(--primary-color), 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  font-weight: 600;
}

.stat-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
  border-left: 4px solid var(--primary-color);
  backdrop-filter: blur(10px);
}

.stat-card:nth-child(2) .card {
  border-left-color: var(--success-color);
}

.stat-card:nth-child(3) .card {
  border-left-color: var(--warning-color);
}

.stat-card:nth-child(4) .card {
  border-left-color: var(--info-color);
}

/* Buttons */
.btn {
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: var(--transition);
  border: none;
  padding: 0.5rem 1.5rem;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--box-shadow);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
}

/* Forms */
.form-control, .form-select {
  border-radius: var(--border-radius);
  border: 1px solid #dee2e6;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Loading Spinner */
#loading-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

/* Conversation Cards */
.conversation-card {
  transition: var(--transition);
  cursor: pointer;
}

.conversation-card:hover {
  background-color: rgba(var(--primary-color), 0.05);
}

.conversation-meta {
  font-size: 0.875rem;
  color: var(--secondary-color);
}

.conversation-tags .badge {
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

/* Research Cards */
.research-card {
  transition: var(--transition);
}

.research-card:hover {
  background-color: rgba(var(--success-color), 0.05);
}

.research-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.research-status.draft {
  color: var(--secondary-color);
}

.research-status.in-progress {
  color: var(--warning-color);
}

.research-status.completed {
  color: var(--success-color);
}

.research-status.published {
  color: var(--primary-color);
}

/* App Cards */
.app-card {
  transition: var(--transition);
  height: 100%;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--box-shadow-lg);
}

.app-card .card-img-top {
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--secondary-color);
}

.app-technologies .badge {
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
  background-color: var(--light-color);
  color: var(--dark-color);
  border: 1px solid #dee2e6;
}

.app-launch-btn {
  background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%);
  border: none;
  color: white;
  font-weight: 600;
}

.app-launch-btn:hover {
  background: linear-gradient(135deg, #146c43 0%, #0f5132 100%);
  color: white;
}

/* Guest Section */
.guest-form {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.comment-item, .request-item {
  border-left: 3px solid var(--primary-color);
  background-color: rgba(var(--primary-color), 0.05);
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.comment-meta, .request-meta {
  font-size: 0.875rem;
  color: var(--secondary-color);
}

/* Pagination */
.pagination {
  justify-content: center;
}

.page-link {
  border-radius: var(--border-radius);
  margin: 0 0.125rem;
  border: 1px solid #dee2e6;
  color: var(--primary-color);
}

.page-link:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Modals */
.modal-content {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--box-shadow-lg);
}

.modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  background-color: rgba(var(--primary-color), 0.05);
}

.modal-title {
  font-weight: 600;
}

/* Toasts */
.toast {
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.toast-header {
  font-weight: 600;
}

/* Language Selector */
#current-language {
  font-weight: 600;
  font-size: 0.875rem;
}

.dropdown-menu {
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-lg);
  border: none;
}

.dropdown-item {
  transition: var(--transition);
}

.dropdown-item:hover {
  background-color: rgba(var(--primary-color), 0.1);
  color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section {
    text-align: center;
  }
  
  .hero-section .display-4 {
    font-size: 2rem;
  }
  
  .hero-section .lead {
    font-size: 1rem;
  }
  
  .hero-section .btn-lg {
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .stat-card {
    margin-bottom: 1rem;
  }
  
  .navbar-nav {
    text-align: center;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .btn {
    font-size: 0.875rem;
  }
  
  .hero-section .display-4 {
    font-size: 1.75rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --dark-color: #f8f9fa;
    --light-color: #212529;
  }
  
  body {
    background-color: #1a1a1a;
    color: var(--dark-color);
  }
  
  .card {
    background-color: #2d2d2d;
    color: var(--dark-color);
  }
  
  .form-control, .form-select {
    background-color: #2d2d2d;
    border-color: #495057;
    color: var(--dark-color);
  }
  
  .form-control:focus, .form-select:focus {
    background-color: #2d2d2d;
    border-color: var(--primary-color);
    color: var(--dark-color);
  }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

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

.pulse {
  animation: pulse 2s infinite;
}

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

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

.shadow-sm {
  box-shadow: var(--box-shadow) !important;
}

.shadow-lg {
  box-shadow: var(--box-shadow-lg) !important;
}

.border-radius {
  border-radius: var(--border-radius) !important;
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #0056b3;
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  .pagination,
  #loading-spinner {
    display: none !important;
  }
  
  .main-content {
    margin-top: 0;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #dee2e6;
  }
  
  body {
    background-color: white !important;
    color: black !important;
  }
}
