/* ==========================================================================
   StudentJob: Companies Directory & Single Company Profile Styling
   ========================================================================== */

.companies-page-wrapper {
  padding: 3rem 0 5rem;
  background-color: var(--color-background);
}

.companies-hero {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2.5rem;
}

.companies-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-text-main);
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.companies-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.companies-search-wrapper {
  max-width: 650px;
  margin: 0 auto 3rem;
  position: relative;
}

.companies-search-form {
  display: flex;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 0.5rem 0.75rem 0.5rem 1.25rem;
  align-items: center;
  transition: all 0.2s ease;
}

.companies-search-form:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 8px 25px rgba(28, 123, 255, 0.12);
}

.companies-search-input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 1rem;
  color: var(--color-text-main);
  background: transparent;
}

.companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.company-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.company-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.company-card-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.company-card-logo {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  overflow: hidden;
  flex-shrink: 0;
}

.company-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.company-card-info {
  flex: 1;
  min-width: 0;
}

.company-card-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin: 0 0 0.25rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-card:hover .company-card-name {
  color: var(--color-primary);
}

.company-card-location {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.company-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.company-vacancies-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  background-color: #eff6ff;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
}

.company-vacancies-badge.zero {
  color: #64748b;
  background-color: #f1f5f9;
}

/* ==========================================================================
   Single Company Profile View (single-company.php)
   ========================================================================== */
.single-company-page {
  padding: 0 0 5rem;
  background: #ffffff;
}

.company-hero-banner {
  width: 100%;
  background: linear-gradient(134deg, #f2f8ff, #f8fbff);
}

.company-header-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.5rem 0 0;
  margin-bottom: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.company-header-left {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.company-profile-logo {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06), inset 0 0 0 2px #ffffff;
  box-sizing: border-box;
}

.company-profile-logo::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2.5px solid #ffffff;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  box-sizing: border-box;
}

.company-profile-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 15px;
  display: block;
  padding: 0;
  margin: 0;
}

.company-profile-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--color-text-main);
  margin: 0 0 0.5rem 0;
}

.company-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.company-profile-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.company-open-vacancies-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ==========================================================================
   Single Company Breadcrumb Styling
   ========================================================================== */
.company-breadcrumb-wrap {
  margin-top: 0.15rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.company-breadcrumb-wrap,
.company-breadcrumb-wrap *,
.single-company-breadcrumb,
.single-company-breadcrumb * {
  font-size: 0.8125rem !important; /* ~13px smaller subtle breadcrumb text */
}

.company-breadcrumb-wrap,
.single-company-breadcrumb {
  color: #64748b !important;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.company-breadcrumb-wrap a,
.single-company-breadcrumb a {
  color: #64748b !important;
  text-decoration: none !important;
  transition: color 0.15s ease;
}

.company-breadcrumb-wrap a:hover,
.single-company-breadcrumb a:hover {
  color: var(--color-primary, #1c7bff) !important;
  text-decoration: underline !important;
}

.company-breadcrumb-wrap .breadcrumb_last,
.single-company-breadcrumb .breadcrumb_last,
.company-breadcrumb-wrap span:last-child {
  color: #334155 !important;
  font-weight: 600 !important;
}

.company-breadcrumb-wrap .breadcrumb-separator {
  margin: 0 0.45rem;
  color: #94a3b8 !important;
}

/* ==========================================================================
   Company Follow Bell Button & Header Actions (Matching Reference Screenshot)
   ========================================================================== */
.btn-company-follow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  text-decoration: none;
}

.btn-company-follow:hover {
  background: #f8fafc;
  color: var(--color-primary, #1c7bff);
  border-color: #cbd5e1;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(28, 123, 255, 0.15);
}

.btn-company-follow:active {
  transform: scale(0.95);
}

.btn-company-follow.following {
  background: #1c7bff17;
  border-color: #d8b4fe;
  color: var(--color-primary, #1c7bff);
}

.btn-company-follow.following svg {
  fill: currentColor;
}

.btn-company-follow.following:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #ef4444;
}

.btn-company-follow.following:hover svg {
  fill: none;
}

.company-header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.company-header-actions .btn-company-follow {
  width: auto !important;
  height: auto !important;
  min-height: 38px !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px !important;
  gap: 0.45rem !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1.4 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.company-header-actions .btn-company-follow:hover {
  background: #f8fafc !important;
  color: var(--color-primary, #1c7bff) !important;
  border-color: var(--color-primary, #1c7bff) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(28, 123, 255, 0.15) !important;
}

.company-header-actions .btn-company-follow:active {
  transform: translateY(0) !important;
}

.company-header-actions .btn-company-follow.following {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  color: var(--color-primary, #1c7bff) !important;
}

.company-header-actions .btn-company-follow.following:hover {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #ef4444 !important;
}

.company-header-actions .btn-company-follow svg {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  transition: transform 0.2s ease, fill 0.2s ease;
}

.company-header-actions .btn-company-follow:hover svg {
  transform: rotate(-8deg);
}

.company-header-actions .btn-company-follow .follow-btn-text {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

@media (max-width: 768px) {
  .company-header-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.75rem;
  }
  .company-header-left {
    flex-direction: column;
    align-items: flex-start;
  }
  .company-header-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 1rem;
  }
  .companies-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Single Company 2-Column Layout (Matching & Improving Reference Screenshot)
   ========================================================================== */
.single-company-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 2rem;
  align-items: start;
  margin-top: 2rem;
  margin-bottom: 4rem;
}

.company-main-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.company-sidebar-column {
  min-width: 0;
}

.company-content-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.company-content-card:hover {
  box-shadow: none;
}

.company-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0;
  border-bottom: none;
}

.company-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text-main, #0b264b);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.company-card-title .title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #1c7bff17;
  color: var(--color-primary, #1c7bff);
}

.company-card-badge {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.company-desc-text {
  font-size: 0.98rem;
  line-height: 1.85;
  color: #334155;
}

.company-desc-text p {
  margin-bottom: 1rem;
}

.company-desc-text p:last-child {
  margin-bottom: 0;
}

/* Photo Gallery Grid */
.company-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.company-gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.company-gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.company-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  display: block;
}

.company-gallery-item:hover img {
  transform: scale(1.06);
}

.company-gallery-item .gallery-zoom-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: opacity 0.2s ease;
}

.company-gallery-item:hover .gallery-zoom-overlay {
  opacity: 1;
}

/* YouTube Video Responsive Wrapper */
.company-video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #000000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.company-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Sidebar Overview Card */
.company-overview-card {
  position: sticky;
  top: 1.5rem;
  background: #f8fafc;
  border: none;
  border-radius: 14px;
  padding: 1.85rem 2rem;
  box-shadow: none;
}

.single-company-page .company-header-card,
.single-company-page .company-content-card,
.single-company-page .company-overview-card {
  border: none !important;
}

.company-overview-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-main, #0f172a);
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.company-overview-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.overview-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #f8fafc;
}

.overview-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.overview-label {
  color: #64748b;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.overview-label svg {
  color: #94a3b8;
  flex-shrink: 0;
}

.overview-value {
  color: #0f172a;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.overview-value a {
  color: var(--color-primary, #1c7bff);
  text-decoration: none;
  transition: color 0.15s ease;
}

.overview-value a:hover {
  text-decoration: underline;
  color: #6d28d9;
}

/* Social Networks Box */
.company-social-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f1f5f9;
}

.company-social-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 0.85rem;
}

.company-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.social-circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.social-circle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
  color: #ffffff;
}

.social-circle-btn.facebook { background: #1877f2; }
.social-circle-btn.twitter { background: #0f1419; }
.social-circle-btn.linkedin { background: #0a66c2; }
.social-circle-btn.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

/* Quick Edit Button */
.btn-edit-company-profile {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--color-primary, #1c7bff);
  color: var(--color-primary, #1c7bff);
  background: transparent;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-edit-company-profile:hover {
  background: var(--color-primary, #1c7bff);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(28, 123, 255, 0.25);
}

/* Lightbox Modal */
.company-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.company-lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: lightboxZoom 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lightboxZoom {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lightbox-close-btn {
  position: absolute;
  top: 20px;
  right: 25px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.08);
}

.lightbox-prev-btn { left: 25px; }
.lightbox-next-btn { right: 25px; }

.lightbox-counter {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.88rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 14px;
  border-radius: 20px;
}

@media (max-width: 1024px) {
  .single-company-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .company-overview-card {
    position: static;
  }
}
