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

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header Styling */
header {
  padding: 0.5rem 2rem;
  background: linear-gradient(to right, #1f42cf, #18a1dc);
  color: white;
  position: relative;
}

.header-content {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  gap: 1rem;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Override for brand dashboard header layout */
.brand-dashboard .header-content {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 2rem !important;
}

.brand-dashboard .header-logo {
  order: 1 !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
  flex-shrink: 0 !important;
}

.brand-dashboard .header-text {
  order: 2 !important;
  flex-shrink: 0 !important;
}

.brand-dashboard .header-center {
  order: 3 !important;
  flex: 1 !important;
  text-align: center !important;
}

.brand-dashboard .header-buttons {
  order: 4 !important;
  margin-left: auto !important;
  flex-shrink: 0 !important;
}

/* Specific styling for influencers.html header logo positioning */
.influencer-dashboard .header-content {
  grid-template-columns: auto 1fr 1fr auto;
  gap: 2rem;
}

.influencer-dashboard .header-logo {
  justify-content: flex-start;
  margin-right: 0;
  padding-right: 0;
}

.influencer-dashboard .header-text {
  justify-content: flex-start;
  margin-left: 1rem;
}

.header-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.header-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.header-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

header h1 {
  font-size: 1.4rem;
  margin: 0;
  font-weight: 600;
}

header p {
  font-size: 0.9rem;
  margin: 0;
  opacity: 0.9;
}

/* Profile and Logout Button Styling */
#profile-btn, #logout-btn, #dark-mode-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-width: 100px;
  justify-content: center;
}

#profile-btn, #dark-mode-btn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#profile-btn:hover, #dark-mode-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#logout-btn {
  background: #dc3545;
  color: white;
  border: 1px solid #dc3545;
}

#logout-btn:hover {
  background: #c82333;
  border-color: #bd2130;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

#profile-btn i, #logout-btn i, #dark-mode-btn i {
  font-size: 1rem;
}

#profile-btn span, #logout-btn span, #dark-mode-btn span {
  font-weight: 500;
}

/* Responsive Design for Header */
@media (max-width: 768px) {
  .header-content {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    text-align: center;
  }
  
  .header-text {
    align-items: center;
  }
  
  .header-buttons {
    width: 100%;
    justify-content: center;
  }
  
  #profile-btn, #logout-btn {
    flex: 1;
    max-width: 150px;
  }

  /* Ensure logo isn't clipped on small mobile widths like 425px */
  .influencer-dashboard .header-logo {
    margin-left: 12px;
  }
}

/* Box Container */
.box-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 3rem 1rem;
  flex-grow: 1;
}

.box {
  background: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 2rem;
  max-width: 300px;
  text-align: center;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.box:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.box h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #1f42cf;
}

.box p {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: #666;
}

.box button {
  background: #1f42cf;
  color: white;
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease;
}

.box button:hover {
  background: #1f42cf;
}

/* Positioning Boxes */
.box-left {
  transform: translateX(-10%);
}

.box-right {
  transform: translateX(10%);
}


/* Brand Dashboard Layout */
.brand-dashboard {
  display: flex;
  flex-grow: 1;
  padding: 2rem;
  gap: 2rem;
}


/* Influencer Grid */
.influencer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  flex-grow: 1;
}

.card {
  background: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  text-align: center;
  padding: 2rem;
  font-size: 1rem;
  color: #1f42cf;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.influencer-dashboard {
  display: flex;
  flex-direction: row; /* Ensure side-by-side layout */
  padding: 20px;
  gap: 20px;
  align-items: stretch; /* Stretch items to fill container width */
}

/* Scope the narrow filter only to influencer dashboard to avoid affecting brand */
.influencer-dashboard .filter-section {
  width: 320px;
  max-height: calc(100vh - 140px);
  flex-shrink: 0;
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow-x: hidden;
  overflow-y: auto;
  order: 1;
}

/* Ensure filter section remains scrollable on larger screens to avoid clipping */
@media (min-width: 1024px) {
  .influencer-dashboard .filter-section { 
    max-height: calc(100vh - 180px); 
    overflow-y: auto; 
  }
}

/* Laptop screens - make filter section responsive and ensure campaigns visibility */
@media (min-width: 1024px) and (max-width: 1440px) {
  .influencer-dashboard {
    gap: 10px; /* Reduce gap to give more space to campaigns */
  }
  .influencer-dashboard .filter-section {
    width: 250px; /* Much narrower filter section for laptops */
    flex-shrink: 1; /* Allow it to shrink if needed */
    /* Keep filter content accessible via scroll at laptop sizes */
    max-height: calc(100vh - 180px);
    overflow-y: auto;
  }
  .campaigns-container {
    min-width: 0; /* Allow proper shrinking */
    flex: 1;
    width: calc(100% - 260px); /* Ensure it gets the remaining space */
  }
}

/* Large laptop/desktop screens - restore full filter width */
@media (min-width: 1441px) {
  .influencer-dashboard .filter-section {
    width: 320px; /* Full width for large screens */
    flex-shrink: 0; /* Don't shrink on large screens */
    /* Prevent clipping on large laptops/desktops too */
    max-height: calc(100vh - 180px);
    overflow-y: auto;
  }
  .campaigns-container {
    width: 100%; /* Full width for campaigns */
  }
}

.campaigns-container { 
  flex: 1; 
  order: 2; 
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.campaign-list { 
  flex: 1; 
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Search Bar Container */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 5px 10px;
  margin-bottom: 20px;
}

/* Dashboard-specific search container */
.dashboard-search {
  width: 100%; /* Full width by default */
  order: 0; /* Place it at the top */
}

/* For larger screens, use a row layout */
@media (max-width: 767px) {
  .influencer-dashboard { flex-direction: column; }
  .filter-section { width: 98%; max-height: none; margin: 0 auto; }
  /* Make filter options wrap nicely on small screens */
  #social-media-options, #content-categories-options, #media-type-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
  }
  .filter-option label, #social-media-options label, #content-categories-options label, #media-type-options label {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

/* Filter Section */
.filter-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #1f42cf;
  text-align: center;
}

.filter-group {
  margin-bottom: 1rem;
  grid-template-columns: repeat(5, 1fr);  /* 5 items per row */
}

.filter-group label {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  text-align: center;
  color: #1f42cf;
}

.budget-label {
  color: #1f42cf !important;
  font-weight: bold !important;
}

.input-label {
  color: #1f42cf !important;
  font-weight: 600 !important;
}

.filter-group select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

.apply-filters {
  background: #18a1dc;
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 1rem;
  width: 100%;
}

.apply-filters:hover {
  background: #1f42cf;
}

/* Campaign List - General styles */
.campaign-card {
  border: 2px solid #ddd;
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-height: 80px;
  overflow: hidden;
  box-sizing: border-box;
}

/* Influencer Dashboard specific campaign card styles */
.influencer-dashboard .campaign-card {
  padding: 8px;
  margin: 4px 0;
  min-height: 60px;
}

.campaign-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  margin-right: 12px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Influencer Dashboard specific campaign image styles */
.influencer-dashboard .campaign-image {
  width: 40px;
  height: 40px;
  margin-right: 8px;
}

.campaign-text {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.campaign-text div {
  flex: 1;
  min-width: 0;
  max-width: 150px;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Influencer Dashboard specific campaign text styles */
.influencer-dashboard .campaign-text div {
  max-width: 120px;
}

.campaign-name h3 {
  margin: 0; /* Remove default margin */
}

.brand-name {
  color: #667eea;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.campaign-description {
  color: #64748b;
  margin: 0;
  max-width: 150px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.3;
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* Influencer Dashboard specific campaign description styles */
.influencer-dashboard .campaign-description {
  max-width: 120px;
}

.blurb p {
  margin: 0;
  max-width: 150px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.3;
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Influencer Dashboard specific blurb styles */
.influencer-dashboard .blurb p {
  max-width: 120px;
}

.campaign-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.campaign-card h3 {
  font-size: 1.5rem;
  color: #1f42cf;
}

.campaign-card p {
  font-size: 1rem;
  color: #555;
}

/* Application-card styling copied from profile for exact match */
.campaigns-container {
  background: rgb(192, 192, 192);
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  padding: 1rem;
  height: 90%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  .campaigns-container {
    height: auto;
  }
}

.campaigns-container .pagination-controls {
  position: static;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}

.campaigns-container .pagination-controls button {
  min-width: 36px;
  height: 36px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.campaigns-container .pagination-controls button:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #111827;
}

.application-card {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
  margin-bottom: 1rem; /* more spacing between cards */
  cursor: pointer;
}

.application-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.application-card .campaign-header {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.application-card .campaign-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

.application-card .campaign-info { 
  flex: 1; 
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.application-card .campaign-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.4rem;
}
.application-card .campaign-description {
  color: #64748b;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  font-size: 0.9rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  max-width: 100%;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  box-sizing: border-box;
}
.application-card .campaign-meta { display: flex; gap: 1rem; flex-wrap: wrap; }
.application-card .meta-item { display: flex; align-items: center; gap: 0.4rem; color: #64748b; font-size: 0.85rem; }
.application-card .meta-item i { color: #667eea; }

.application-card .campaign-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow: visible;
}

.application-card .detail-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.application-card .detail-section h4 i { color: #667eea; }
.application-card .tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.application-card .tag { background: #e2e8f0; color: #475569; padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.75rem; font-weight: 500; }

.apply-campaign {
  background: #4caf50;
  color: white;
  border: none;
  padding: 0.7rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  align-self: flex-start;
  font-size: 1rem;
}

.apply-campaign:hover {
  background: #1f42cf;
}

#pricingContent {
  padding: 20px;
  border: 1px solid #ddd;
  background-color: white;
  border-radius: 5px;
  display: block;
  text-align: left;
}

.tier {
  margin-bottom: 20px;
}

.tier h3 {
  color: #343a40;
  margin-bottom: 10px;
}

.tier p {
  margin: 5px 0;
}

/* Search Input Styling */
.search-container input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  margin-right: 10px;
}

/* Search Button Styling */
.search-container button {
  padding: 8px 15px; /* Adds padding around the button */
  background-color: #18a1dc; /* Green background for the button */
  color: white; /* White text color */
  border: none; /* Removes the border */
  border-radius: 4px; /* Rounded corners for the button */
  font-size: 14px; /* Matches font size with the input */
  cursor: pointer; /* Shows a pointer cursor when hovered */
  transition: background-color 0.3s ease; /* Smooth transition for hover effect */
}

/* Search Button Hover Effect */
.search-container button:hover {
  background-color: #1f42cf; /* Darker green when hovered */
}

.slider-section {
  width: 100%;
  max-width: 400px;
  margin: 20px auto;
  text-align: center;
  font-family: Arial, sans-serif;
}

.slider-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

input[type="range"] {
  flex: 1;
  margin: 0 10px;
  height: 5px;
  background: #ddd;
  border-radius: 5px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #007bff;
  cursor: pointer;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #007bff;
  cursor: pointer;
}

#saved-filters-container {
  display: none; /* Hide by default */
}

/* Ensure pagination controls are centered and at the bottom of the influencer-section */
.influencer-section {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  min-height: 500px; /* adjust as needed for your grid */
  position: relative;
}


/* Responsive adjustment if needed */
@media (max-width: 600px) {
  .pagination-controls {
    margin-bottom: 10px;
  }
  
  .campaign-card {
    flex-direction: column;  /* Stack vertically on small screens */
    min-height: auto;  /* Allow natural height */
    padding: 12px;  /* Reduce padding on small screens */
  }
  
  .campaign-text {
    flex-direction: column;  /* Stack text elements vertically */
    align-items: flex-start;  /* Align to start */
    max-width: 100%;  /* Full width on small screens */
  }
  
  .campaign-text div {
    max-width: 100%;  /* Full width for text elements on small screens */
    margin-right: 0;  /* Remove right margin */
    margin-bottom: 8px;  /* Add bottom margin for spacing */
  }
}