@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: hsl(220, 20%, 8%);
  --bg-secondary: hsl(220, 16%, 13%);
  --bg-glass: rgba(26, 31, 41, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.25);
  
  --primary: hsl(260, 85%, 60%);
  --primary-hover: hsl(260, 85%, 55%);
  --primary-glow: rgba(139, 92, 246, 0.4);
  
  --accent: hsl(180, 80%, 45%);
  --accent-hover: hsl(180, 80%, 40%);
  
  --text-main: hsl(220, 20%, 96%);
  --text-muted: hsl(220, 12%, 65%);
  --text-dark: hsl(220, 20%, 15%);
  
  --success: hsl(142, 70%, 45%);
  --danger: hsl(350, 80%, 55%);
  --warning: hsl(45, 90%, 50%);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(20, 184, 166, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-secondary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Glassmorphism Container */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Typography & Layout */
a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, h5 {
  font-weight: 600;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--text-main) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.primary-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 15px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 25px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-accent {
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
}
.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 15px rgba(20, 184, 166, 0.3);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: hsl(350, 80%, 45%);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Navbar */
.navbar {
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(12px);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 40%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-item {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

/* Hero Section */
.hero {
  padding: 80px 40px 40px;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 20px;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 700px;
  margin: 0 auto 40px;
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto 60px;
  padding: 0 40px;
}

.stat-card {
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Grid & Cards (Requests / Offers) */
.content-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.requests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.request-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 380px;
  position: relative;
  overflow: hidden;
}

.request-image-placeholder {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
}

.request-tag {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.request-card h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.request-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.request-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.request-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: auto;
}

.request-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge.open {
  background: rgba(20, 184, 166, 0.15);
  color: var(--accent);
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.status-badge.completed {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.modal-content {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--text-main);
}

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

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* File Upload Widget */
.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-bottom: 16px;
}

.upload-dropzone:hover {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.02);
}

.upload-dropzone svg {
  margin-bottom: 12px;
  color: var(--text-muted);
}

.upload-previews {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.preview-item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  position: relative;
}

.preview-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: var(--danger);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Authentication Tabs */
.auth-tabs {
  display: flex;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-smooth);
  border-bottom: 2px solid transparent;
}

.auth-tab.active {
  color: var(--text-main);
  border-color: var(--primary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  padding: 16px 24px;
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.success {
  background: var(--success);
}
.toast.error {
  background: var(--danger);
}
.toast.info {
  background: var(--primary);
}

/* Custom view layouts */
.request-details-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.gallery-image {
  width: 100%;
  aspect-ratio: 1.3;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border-color);
  cursor: zoom-in;
}

/* Chat Component */
.chat-box {
  display: flex;
  flex-direction: column;
  height: 450px;
  margin-top: 30px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
}

.chat-bubble.sent {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.chat-bubble.received {
  align-self: flex-start;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-bottom-left-radius: 2px;
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive details */
@media (max-width: 900px) {
  .request-details-container {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .navbar {
    padding: 0 20px;
  }
  .hero h1 {
    font-size: 2.2rem;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}
