/* Modern Organization Detail Page Styles */

/* ========================================
   CSS VARIABLES
   ======================================== */

:root {
  --color-primary: #3b82f6;
  --color-primary-dark: #2563eb;
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-900: #1e293b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* ========================================
   ORGANIZATION HEADER - MODERN DESIGN
   ======================================== */

.org-header-modern {
  background: linear-gradient(135deg, var(--color-white) 0%, var(--color-gray-50) 100%);
  border-bottom: 1px solid var(--color-gray-200);
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.back-navigation {
  margin-bottom: 1.5rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  color: var(--color-gray-500);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.back-btn:hover {
  background: var(--color-gray-50);
  border-color: var(--color-gray-300);
  color: var(--color-gray-600);
}

.org-profile {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.org-avatar {
  flex-shrink: 0;
}

.org-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 1rem;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.org-info {
  flex: 1;
  min-width: 300px;
}

.org-info h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.875rem;
}

/* ========================================
   ORGANIZATION PROFILE IN SIDEBAR
   ======================================== */
.org-profile-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.org-avatar-box {
  width: 100%;
  display: flex;
  justify-content: center;
}

.org-avatar-box img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 0.5rem;
  background: #F9FAFB;
  padding: 0.5rem;
  border: 1px solid #E5E7EB;
}

.org-name-box {
  width: 100%;
  text-align: center;
}

.org-name-box h1 {
  font-size: 1.25rem;
  margin: 0;
  color: #1e293b;
  font-weight: 700;
}

.org-type {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.org-description {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.org-stats-summary {
  display: flex;
  gap: 1.5rem;
  flex-shrink: 0;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: white;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  min-width: 80px;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

/* ========================================
   LAYOUT - SIDEBAR + MAIN CONTENT
   ======================================== */

.content-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .content-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ========================================
   SIDEBAR STYLES
   ======================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.info-card h5 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.info-value {
  font-size: 0.875rem;
  color: #1e293b;
  font-weight: 500;
}

.info-link {
  font-size: 0.875rem;
  color: #3b82f6;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
}

.info-link:hover {
  color: #2563eb;
}

.description-text {
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */

.main-content {
  background: white;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

/* ========================================
   TAB NAVIGATION
   ======================================== */

.content-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  gap: 1rem;
  flex-wrap: wrap;
}

.tab-header {
  display: flex;
  gap: 0.5rem;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  background: var(--color-white);
  border-color: #cbd5e1;
}

.tab-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.search-container {
  flex-shrink: 0;
}

.search-form {
  display: flex;
  align-items: center;
  position: relative;
}

.search-input {
  padding: 0.75rem 3rem 0.75rem 1rem;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  width: 250px;
  outline: none;
  transition: border-color 0.2s ease;
  direction: rtl;
}

.search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.5rem;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.search-btn:hover {
  background: var(--color-primary-dark);
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */

.tab-content {
  display: none;
  padding: 1.5rem;
}

.tab-content.active {
  display: block;
}

/* Quick Stats */
.quick-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: var(--color-white);
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  min-width: 80px;
  text-align: center;
}

.stat .value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.stat .label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

/* Status Filters */
.status-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  color: #64748b;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--color-white);
  border-color: #cbd5e1;
  color: #475569;
}

.filter-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

/* ========================================
   CONTENT LISTS
   ======================================== */

.content-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Item Card */
.item-card {
  background: var(--color-white);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.item-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.item-title {
  flex: 1;
}

.reference-number {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.item-title h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.item-title a {
  color: #1e293b;
  text-decoration: none;
  transition: color 0.2s ease;
}

.item-title a:hover {
  color: #3b82f6;
}

.item-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge.status-active { background: #dcfce7; color: #166534; }
.status-badge.status-closing { background: #fef3c7; color: #92400e; }
.status-badge.status-expired { background: #fee2e2; color: #991b1b; }

.time-remaining {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
}

.item-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.item-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #64748b;
}

.item-meta i {
  color: #94a3b8;
}

.item-description {
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.item-actions {
  display: flex;
  justify-content: flex-end;
}

.view-btn {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.view-btn:hover {
  background: var(--color-white);
  border-color: #3b82f6;
  color: #2563eb;
}

/* ========================================
   JOBS GRID
   ======================================== */

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

.job-card {
  background: var(--color-white);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.job-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.job-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
}

.experience-badge {
  padding: 0.25rem 0.75rem;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.job-description {
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.job-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #64748b;
}

.detail-item i {
  color: #94a3b8;
  width: 12px;
}

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

.publish-date {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ========================================
   EMPTY STATES
   ======================================== */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #cbd5e1;
}

.empty-state h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #475569;
}

.empty-state p {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ========================================
   LOADING STATES
   ======================================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-gray-200);
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.search-form.searching .search-btn {
  background: var(--color-gray-400);
  cursor: not-allowed;
}

.search-form.searching .search-btn i {
  animation: spin 1s linear infinite;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0 0 0;
  padding: 0;
  list-style: none;
}

.page-item {
  margin: 0;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  color: #64748b;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 36px;
  height: 36px;
  transition: all 0.2s ease;
}

.page-link:hover {
  background: var(--color-white);
  border-color: #cbd5e1;
  color: #475569;
}

.page-item.active .page-link {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.page-item.active .page-link:hover {
  background: #2563eb;
  border-color: #2563eb;
}

/* ========================================
   SOCIAL MEDIA LINKS
   ======================================== */

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
  align-items: center;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.03);
}

.social-links a:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.06);
}

.social-links a i {
  font-size: 1.5rem;
  line-height: 1;
}

/* Ensure brand icons are visible */
.social-links a i.fab {
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .org-profile {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .org-stats-summary {
    justify-content: center;
  }
  
  .content-tabs {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .tab-header {
    justify-content: center;
  }
  
  .search-container {
    width: 100%;
  }
  
  .search-input {
    width: 100%;
  }
  
  .quick-stats {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .jobs-grid {
    grid-template-columns: 1fr;
  }
  
  .item-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .item-status {
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
  }
  
  .status-filters {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .org-header-modern {
    padding: 1rem 0;
  }
  
  .org-avatar img {
    width: 60px;
    height: 60px;
  }
  
  .org-info h1 {
    font-size: 1.5rem;
  }
  
  .stat-item {
    padding: 0.75rem;
    min-width: 60px;
  }
  
  .stat-value {
    font-size: 1.125rem;
  }
}
