/* AI Smart Marketplace - Modern Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #8b5cf6;
  --accent: #ec4899;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #1e293b;
  --dark-light: #334155;
  --gray: #64748b;
  --gray-light: #f1f5f9;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

main {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  margin: 15px;
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Header & Navigation */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  margin-bottom: 0;
  position: relative;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

nav {
  padding: 0.8rem 0;
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand a {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: -0.5px;
  transition: transform 0.3s ease;
}

.nav-brand a:hover {
  transform: scale(1.05);
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-menu li a {
  color: var(--dark);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  font-size: 0.95rem;
}

.nav-menu li a:hover {
  background: var(--gradient-primary);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Alerts */
.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Forms */
.auth-form {
  max-width: 500px;
  margin: 50px auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 40px;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark);
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--gray-light);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--white);
  color: var(--dark);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--gradient-primary);
  color: var(--white);
  text-decoration: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--gradient-primary);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 40px 20px;
  background: var(--gradient-primary);
  border-radius: 24px;
  margin-bottom: 30px;
  color: var(--white);
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  font-weight: 800;
  letter-spacing: -1px;
  position: relative;
  z-index: 1;
  text-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 24px;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  font-weight: 300;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
  flex-shrink: 0;
}

.feature {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.feature h3 {
  margin-bottom: 15px;
  color: #007bff;
}

/* Dashboard */
.dashboard-section {
  width: 100%;
  padding: 20px 0;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-card h3 {
  font-size: 2rem;
  color: #007bff;
  margin-bottom: 10px;
}

.dashboard-actions {
  margin-top: 30px;
}

.dashboard-actions .btn {
  margin-right: 10px;
}

/* Tables */
.table {
  width: 100%;
  background: #fff;
  border-collapse: collapse;
  margin-top: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table thead {
  background-color: #f8f9fa;
}

.table th,
.table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.table th {
  font-weight: 600;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

/* Chat Interface */
.chat-container {
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(100vh - 200px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  border: 2px solid var(--gray-light);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  background: linear-gradient(to bottom, #f8fafc, #ffffff);
  scroll-behavior: smooth;
  min-height: 0;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: var(--gray-light);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

.message {
  margin-bottom: 20px;
  padding: 16px 20px;
  border-radius: 18px;
  animation: slideIn 0.3s ease;
  max-width: 75%;
  word-wrap: break-word;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-user {
  background: var(--gradient-primary);
  color: var(--white);
  margin-left: auto;
  border-bottom-right-radius: 4px;
  box-shadow: var(--shadow);
}

.message-assistant {
  background: var(--gray-light);
  color: var(--dark);
  margin-right: auto;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.chat-input-container {
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid var(--gray-light);
  border-radius: 16px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--white);
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Recommendations */
.recommendations-container {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #ddd;
}

.recommendation-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #007bff;
}

.recommendation-card h4 {
  margin-bottom: 10px;
  color: #007bff;
}

.recommendation-card p {
  margin-bottom: 10px;
}

/* Footer */
footer {
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 15px;
  margin-top: auto;
  flex-shrink: 0;
}

/* Conversations List */
.conversations-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.conversation-item {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.conversation-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.conversation-item h3 {
  margin-bottom: 12px;
  color: var(--dark);
  font-size: 1.25rem;
  font-weight: 700;
}

.conversation-item p {
  margin-bottom: 8px;
  color: var(--gray);
  font-size: 0.95rem;
}

.conversation-item .btn {
  margin-top: 12px;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-menu {
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .features {
    grid-template-columns: 1fr;
  }
}
