/* Nestchip - Gen-Z Mobile-First Styling */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Updated Color Variables - Soft Blue Pastel Theme */
  --primary-blue: #1877F2;
  --accent-blue: #00B2FF;
  --background: #F0F6FF;
  --text-dark: #1877F2;
  --text-secondary: #555555;
  --text-light: #666666;
  --white: #FFFFFF;
  --success: #00D084;
  --error: #FF6B6B;
  --warning: #FFB800;
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.18);
  --shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  --shadow-hover: 0 12px 40px rgba(31, 38, 135, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #F0F6FF 0%, #E8F2FF 100%);
  min-height: 100vh;
  color: var(--text-dark);
  line-height: 1.6;
}

/* Glass morphism container */
.glass-container {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

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

/* Layout */
.container {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding-bottom: 80px; /* Space for bottom navigation */
}

/* Header */
.header {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  padding: 15px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-blue);
  margin: 0;
}

.header .logo {
  font-size: 28px;
  margin-right: 10px;
}

.header .user-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header .user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-blue);
}

.header .online-status {
  width: 12px;
  height: 12px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--white);
  margin-left: -15px;
  margin-bottom: -15px;
}

/* Forms */
.form-container {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 25px;
  border: 1px solid var(--glass-border);
  padding: 30px;
  box-shadow: var(--shadow);
  margin: 20px 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid transparent;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary-blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
  transform: translateY(-1px);
}

.form-control::placeholder {
  color: var(--text-secondary);
}

/* Country code selector */
.country-select-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.country-select {
  flex: 0 0 120px;
  padding: 15px 10px;
  border: 2px solid transparent;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  transition: all 0.3s ease;
  outline: none;
}

.country-select:focus {
  border-color: var(--primary-blue);
  background: var(--white);
}

.phone-input {
  flex: 1;
}

/* Buttons */
.btn {
  padding: 15px 30px;
  border: none;
  border-radius: 15px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  color: var(--white);
  box-shadow: 0 4px 15px rgba(24, 119, 242, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(24, 119, 242, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-dark);
  border: 2px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--white);
  transform: translateY(-1px);
}

.btn-full {
  width: 100%;
  margin-top: 10px;
}

.btn-icon {
  padding: 12px;
  border-radius: 12px;
  min-width: 48px;
  min-height: 48px;
}

/* Chat Interface */
.chat-container {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 25px;
  border: 1px solid var(--glass-border);
  height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.chat-header {
  padding: 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.1);
}

.chat-header .avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-blue);
}

.chat-header .info h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.chat-header .info .status {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.message {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.message.sent {
  align-items: flex-end;
}

.message.received {
  align-items: flex-start;
}

.message-bubble {
  max-width: 80%;
  padding: 12px 18px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
  word-wrap: break-word;
}

.message.sent .message-bubble {
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  color: var(--white);
  border-bottom-right-radius: 8px;
}

.message.received .message-bubble {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-dark);
  border-bottom-left-radius: 8px;
  border: 1px solid var(--glass-border);
}

.message-time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 5px;
  opacity: 0.7;
}

.message.sent .message-time {
  color: rgba(255, 255, 255, 0.8);
}

.message-image {
  max-width: 200px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.chat-input {
  padding: 20px;
  border-top: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.1);
}

.chat-input-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input-form input[type="text"] {
  flex: 1;
  padding: 12px 18px;
  border: 2px solid transparent;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.chat-input-form input[type="text"]:focus {
  border-color: var(--primary-blue);
  background: var(--white);
}

.chat-input-form button {
  padding: 12px 16px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
  color: var(--white);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-input-form button:hover {
  transform: scale(1.05);
}

/* Contact List */
.contact-list {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.contact-item {
  padding: 15px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  color: var(--text-dark);
  transition: all 0.3s ease;
  cursor: pointer;
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
}

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

.contact-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-blue);
  position: relative;
}

.contact-info {
  flex: 1;
}

.contact-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.contact-message {
  font-size: 14px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-time {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.product-card {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: var(--shadow);
}

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

.product-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
}

.product-info {
  padding: 15px;
}

.product-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-price {
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 5px;
}

.product-seller {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding: 15px 0 25px 0;
  z-index: 1000;
}

.nav-container {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 12px;
  min-width: 60px;
}

.nav-item:hover, .nav-item.active {
  color: var(--primary-blue);
  background: rgba(24, 119, 242, 0.1);
  transform: translateY(-2px);
}

.nav-item .icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.nav-item .label {
  font-size: 10px;
  font-weight: 500;
}

/* Alerts and Messages */
.alert {
  padding: 15px 20px;
  border-radius: 15px;
  margin: 15px 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: rgba(0, 208, 132, 0.2);
  color: var(--success);
  border: 1px solid rgba(0, 208, 132, 0.3);
}

.alert-error {
  background: rgba(255, 107, 107, 0.2);
  color: var(--error);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.alert-warning {
  background: rgba(255, 184, 0, 0.2);
  color: var(--warning);
  border: 1px solid rgba(255, 184, 0, 0.3);
}

/* Loading states */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(24, 119, 242, 0.2);
  border-left-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* File upload */
.file-upload {
  position: relative;
  display: inline-block;
  cursor: pointer;
  width: 100%;
}

.file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  border: 2px dashed var(--glass-border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.file-upload-label:hover {
  border-color: var(--primary-blue);
  background: rgba(24, 119, 242, 0.1);
}

.file-preview {
  margin-top: 15px;
  text-align: center;
}

.file-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 15px;
  object-fit: cover;
}

/* Profile page */
.profile-header {
  text-align: center;
  padding: 30px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 25px;
  border: 1px solid var(--glass-border);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary-blue);
  margin-bottom: 15px;
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 5px;
}

.profile-phone {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .form-container {
    padding: 20px;
    margin: 10px 0;
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .chat-container {
    height: 65vh;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 20px;
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .country-select-wrapper {
    flex-direction: column;
    gap: 10px;
  }
  
  .country-select {
    flex: none;
    width: 100%;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #1A1A2E;
    --text-dark: #FFFFFF;
    --text-secondary: #B0B0B0;
    --glass-bg: rgba(0, 0, 0, 0.25);
    --glass-border: rgba(255, 255, 255, 0.1);
  }
  
  body {
    background: linear-gradient(135deg, #1A1A2E 0%, #16213E 100%);
  }
  
  .form-control {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-dark);
  }
  
  .form-control:focus {
    background: rgba(0, 0, 0, 0.5);
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}