/* WorkTogetherAI - Custom Component Styles */

/* ============================================
   Toast Notifications
   (Layout & animations handled by toast.js via Tailwind;
    these rules add the accent border per type)
   ============================================ */
.toast-success { border-left: 3px solid #22c55e; }
.toast-error   { border-left: 3px solid #ef4444; }
.toast-warning { border-left: 3px solid #f59e0b; }
.toast-info    { border-left: 3px solid #3b82f6; }

/* ============================================
   File Upload Component
   ============================================ */
.file-upload-zone {
  border: 2px dashed rgba(75, 127, 175, 0.3);
  border-radius: 1rem;
  padding: 3rem 2rem;
  text-align: center;
  background: rgba(75, 127, 175, 0.05);
  transition: all 0.3s ease;
  cursor: pointer;
}

.file-upload-zone:hover {
  border-color: rgba(75, 127, 175, 0.6);
  background: rgba(75, 127, 175, 0.1);
}

/* File Preview List */
.file-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
}

.file-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 0.375rem;
  background: rgba(75, 127, 175, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4B7FAF;
}

.file-item-info {
  flex: 1;
  min-width: 0;
}

.file-item-name {
  color: white;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-size {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

.file-item-remove {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s ease;
}

.file-item-remove:hover {
  color: #ef4444;
}

/* Upload Progress */
.file-item-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.file-item-progress-bar {
  height: 100%;
  background: #4B7FAF;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ============================================
   Dashboard Sidebar
   ============================================ */
.sidebar {
  width: 280px;
  min-height: 100vh;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
  padding: 1rem 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.sidebar-link.active {
  background: rgba(75, 127, 175, 0.1);
  color: #4B7FAF;
  border-left-color: #4B7FAF;
}

.sidebar-link-icon {
  width: 20px;
  height: 20px;
}

.sidebar-section {
  padding: 1rem 1.5rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   Dashboard Main Content
   ============================================ */
.main-content {
  margin-left: 280px;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* ============================================
   Stats Cards
   ============================================ */
.stat-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: rgba(75, 127, 175, 0.3);
  transform: translateY(-4px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.stat-icon-accent,
.stat-icon-accent-alt {
  background: rgba(75, 127, 175, 0.2);
  color: #4B7FAF;
}

.stat-icon-green {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.stat-icon-blue {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  line-height: 1;
}

.stat-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.stat-change-up {
  color: #22c55e;
}

.stat-change-down {
  color: #ef4444;
}

/* ============================================
   Role Toggle Switch
   ============================================ */
.role-toggle {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 0.25rem;
}

.role-toggle-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-toggle-btn.active {
  background: #4B7FAF;
  color: white;
}

/* ============================================
   Job Cards
   ============================================ */
.job-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.job-card:hover {
  border-color: rgba(75, 127, 175, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(75, 127, 175, 0.15);
}

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.job-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
}

.job-card-bounty {
  background: #4B7FAF;
  color: white;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
}

.job-card-description {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.job-card-tag {
  background: rgba(75, 127, 175, 0.15);
  color: #6a9bc5;
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
}

.job-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8125rem;
}

.job-card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ============================================
   List View Layout
   ============================================ */
.list-view-card {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
}

.list-view-card:hover {
  transform: translateY(-2px);
}

.list-view-card .job-card-header {
  flex-shrink: 0;
  margin-bottom: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 200px;
  max-width: 260px;
}

.list-view-card .job-card-title {
  font-size: 1rem;
}

.list-view-card .job-card-description {
  flex: 1;
  margin-bottom: 0;
  -webkit-line-clamp: 1;
  min-width: 0;
}

.list-view-card .job-card-tags {
  flex-shrink: 0;
  margin-bottom: 0;
  gap: 0.375rem;
}

.list-view-card .job-card-meta {
  flex-shrink: 0;
  margin-left: auto;
  gap: 0.75rem;
}

/* Hide description on small screens in list mode */
@media (max-width: 768px) {
  .list-view-card {
    flex-wrap: wrap;
  }
  .list-view-card .job-card-header {
    min-width: auto;
    max-width: none;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .list-view-card .job-card-description {
    display: none !important;
  }
}

/* ============================================
   Layout Toggle Buttons
   ============================================ */
.layout-btn {
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.layout-btn:hover {
  color: rgba(255, 255, 255, 0.7);
}

.layout-btn.active {
  color: white;
  background: rgba(75, 127, 175, 0.3);
}

/* ============================================
   Data Table
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table td {
  padding: 1rem;
  color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-draft {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.status-active,
.status-in-progress {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.status-completed {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.status-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* ============================================
   Form Styles
   ============================================ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  font-size: 0.875rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: white;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #4B7FAF;
  box-shadow: 0 0 0 3px rgba(75, 127, 175, 0.2);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234B7FAF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  padding-right: 3rem;
  color: white;
}

.form-select option {
  background: #141414;
  color: white;
}

.form-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  appearance: none;
  transition: all 0.2s ease;
}

.form-checkbox:checked {
  background: #4B7FAF;
  border-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M5 13l4 4L19 7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.75rem;
}

/* ============================================
   Tag Input
   ============================================ */
.tag-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  min-height: 48px;
}

.tag-input-container:focus-within {
  border-color: #4B7FAF;
  box-shadow: 0 0 0 3px rgba(75, 127, 175, 0.2);
}

.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: rgba(75, 127, 175, 0.2);
  border: 1px solid rgba(75, 127, 175, 0.3);
  border-radius: 9999px;
  color: #6a9bc5;
  font-size: 0.875rem;
}

.tag-item-remove {
  background: none;
  border: none;
  color: #6a9bc5;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tag-item-remove:hover {
  color: #ef4444;
}

.tag-input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  color: white;
  outline: none;
  padding: 0.25rem;
}

.tag-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   Search & Filters
   ============================================ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.search-bar:focus-within {
  border-color: #4B7FAF;
  box-shadow: 0 0 0 3px rgba(75, 127, 175, 0.2);
}

.search-bar-icon {
  color: rgba(255, 255, 255, 0.4);
}

.search-bar-input {
  flex: 1;
  border: none;
  background: transparent;
  color: white;
  font-size: 1rem;
  outline: none;
}

.search-bar-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.filter-dropdown {
  position: relative;
}

.filter-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  min-width: 200px;
  background: rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.filter-dropdown.active .filter-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.filter-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-dropdown-item:hover {
  background: rgba(75, 127, 175, 0.1);
  color: white;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  color: rgba(255, 255, 255, 0.2);
}

.empty-state-title {
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state-text {
  color: rgba(255, 255, 255, 0.5);
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  #toast-container {
    left: 1rem;
    right: 1rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}
