/* ════════════════════════════════════════════════════════════
   PUBLIC/CSS/TABLE-VIEW.CSS - Table View Styles
   Organized hierarchy with clear sections and media queries
   ════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────
   1. LAYOUT & CONTAINER STYLES
   ───────────────────────────────────────────────────────── */
.table-view {
  padding: 20px;
  margin-top: 0px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.table-content {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px #0001;
  margin: 32px auto;
  max-width: 1100px;
  padding: 24px 18px 18px 18px;
}

body.table-view-active #main-content {
  overflow-y: auto !important;
}

/* ─────────────────────────────────────────────────────────
   2. FILTER CONTAINER STYLES
   ───────────────────────────────────────────────────────── */
.filter-container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
  position: sticky;
  z-index: 100;
}

.filter-mobile-toggle {
  display: none;
  width: 100%;
  padding: 15px 20px;
  background: none;
  border: none;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  border-radius: 12px;
  transition: background-color 0.2s;
}

.filter-mobile-toggle:hover {
  background-color: #f5f5f5;
}

.filter-mobile-toggle i {
  margin-right: 8px;
  color: #666;
}

.filter-content {
  padding: 0 20px 10px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-top: 10px;
}

.filter-content .filter-group {
  align-self: flex-end;
  margin-bottom: 0;
}

/* ─────────────────────────────────────────────────────────
   3. FILTER GROUP & DROPDOWN STYLES
   ───────────────────────────────────────────────────────── */
.filter-group {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}

.filter-dropdown {
  position: relative;
  width: auto;
  min-width: 200px;
}

.filter-dropdown-button {
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
  min-width: 200px;
  white-space: nowrap;
}

.filter-dropdown-button:hover {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.filter-dropdown-button:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.filter-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  right: auto;
  min-width: 100%;
  width: max-content;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.filter-dropdown-content.active {
  display: block;
}

.filter-option {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.filter-option:last-child {
  border-bottom: none;
}

.filter-option:hover {
  background-color: #f8f9fa;
}

.filter-option input[type="checkbox"] {
  margin-right: 10px;
  width: 16px;
  height: 16px;
  accent-color: #007bff;
}

.filter-option span {
  font-size: 14px;
  color: #333;
  flex: 1;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────
   4. CHECKBOX FILTER GROUPS
   ───────────────────────────────────────────────────────── */
.all-categories-group,
.only-searched-group {
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
}

.all-categories-group label,
.only-searched-group label {
  font-size: 13px;
  color: #555;
  text-align: center;
  cursor: pointer;
}

.filter-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.filter-info-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.filter-info-icon {
  font-size: 14px !important;
  color: #aaa;
  transition: color 0.2s ease;
}

.filter-info-wrapper:hover .filter-info-icon {
  color: #007bff;
}

/* CSS Tooltip box */
.filter-info-wrapper::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff !important;
  font-size: 12px !important;
  font-style: normal !important;
  font-weight: normal !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  line-height: 1.5 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  padding: 8px 11px;
  border-radius: 6px;
  white-space: normal;
  width: 230px;
  max-width: 85vw;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Tooltip arrow */
.filter-info-wrapper::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 9999;
}

.filter-info-wrapper:hover::after,
.filter-info-wrapper:hover::before {
  opacity: 1;
  visibility: visible;
}

/* ─────────────────────────────────────────────────────────
   5. ORGANIZATION SEARCH IN FILTER
   ───────────────────────────────────────────────────────── */
.org-search-group {
  position: relative;
  min-width: 250px;
  max-width: 350px;
  flex: 1 1 250px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  align-self: flex-end;
  margin-bottom: 0;
}

.org-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.org-search-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.08);
}

.org-search-results {
  position: absolute;
  top: 110%;
  right: 0;
  left: 0;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 1001;
  max-height: 260px;
  overflow-y: auto;
  min-width: 100%;
}

.org-search-result-item {
  padding: 3px 12px;
  margin: 5px 0 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 14px;
  color: #333;
  border-left: 3px solid #4CAF50;
  background: none;
}

.org-search-result-item:hover {
  background-color: #f5f5f5;
  color: #333;
}

.org-search-result-item:last-child {
  border-bottom: none;
}

.org-search-results:empty {
  border: none !important;
  box-shadow: none !important;
  background: transparent;
  min-height: 0;
  padding: 0;
}

/* Highlight effect for found organization */
.organization-item.org-highlight {
  animation: org-highlight-glow 2s ease;
  box-shadow: 0 0 0 4px #007bff55, 0 0 16px #007bff44;
  border-color: #007bff !important;
  z-index: 2;
}

@keyframes org-highlight-glow {
  0% {
    box-shadow: 0 0 0 0 #007bff00;
    border-color: #007bff;
  }
  20% {
    box-shadow: 0 0 0 8px #007bff44;
    border-color: #007bff;
  }
  80% {
    box-shadow: 0 0 0 4px #007bff55;
    border-color: #007bff;
  }
  100% {
    box-shadow: 0 0 0 0 #007bff00;
    border-color: inherit;
  }
}

/* ─────────────────────────────────────────────────────────
   6. PRINT BUTTON STYLES
   ───────────────────────────────────────────────────────── */
.print-table-btn {
  padding: 10px 16px;
  font-size: 15px;
  border-radius: 8px;
  border: 1.5px solid #e0e0e0;
  background: #fff;
  cursor: pointer;
  margin-right: 10px;
  transition: background 0.2s, border 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─────────────────────────────────────────────────────────
   7. SEGMENT & CATEGORY SECTION STYLES
   ───────────────────────────────────────────────────────── */
.segment-section {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  flex: 0 1 auto;
  min-width: calc(300px + 44px);
  flex-direction: column;
  border: 2px solid #eee;
  position: relative;
  margin-top: 15px;
  box-sizing: border-box;
  z-index: 1;
}

.segment-header {
  position: absolute;
  top: -16px;
  left: 20px;
  background: #fff;
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 2px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.segment-header h2 {
  color: #333;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.categories-grid {
  display: flex;
  flex-wrap: wrap;
  flex-grow: 1;
  overflow-y: auto;
  gap: 15px;
  padding-top: 10px;
}

.subsegment-section {
  margin: 20px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
}

.subsegment-header {
  margin-bottom: 15px;
}

.subsegment-header h3 {
  color: #444;
  margin: 0;
  font-size: 1.2em;
}

.category-section {
  margin: 0;
  padding: 5px 10px 10px 15px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  flex: 0 1 auto;
}

.category-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  text-decoration: underline;
}

.category-header h3 {
  color: #555;
  margin: 0;
  font-size: 16px;
}

.subsegment-name {
  color: #666;
  font-size: 0.9em;
  padding: 2px 8px;
  background: #e9ecef;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────────────
   8. ORGANIZATION ITEM STYLES
   ───────────────────────────────────────────────────────── */
.organizations-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.organization-item {
  position: relative;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}

.organization-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Pro Account Styling - Gold Glow */
.organization-item.pro-account {
  border: 2px solid transparent;
  background: linear-gradient(white, white) padding-box,
    linear-gradient(45deg, #FFD700, #FFA500, #FFD700) border-box;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
  position: relative;
}

.organization-item.pro-account:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.3);
}

.organization-item.pro-account .org-logo,
.organization-item.pro-account .org-name-box {
  border-radius: 4px;
}

.organization-item.pro-account .org-name-box {
  background: linear-gradient(135deg, #FFF9E6, #FFFBF0);
  border: 1px solid #FFD700 !important;
}

.organization-item.special-border-gradient {
  position: relative;
  z-index: 1;
}

.org-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.org-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 6px;
}

.org-name {
  font-size: 0.9em;
  color: #333;
  text-align: center;
  margin-top: 5px;
}

.org-name-box {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 0.8em;
  text-align: center;
  padding: 5px;
  word-break: break-word;
}

.pro-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: linear-gradient(45deg, #FFD700, #FFA500);
  color: white;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
  border: 2px solid white;
  z-index: 10;
  animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
  0% {
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
  }
  50% {
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.8);
  }
  100% {
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
  }
}

/* ─────────────────────────────────────────────────────────
   9. ERROR MESSAGE STYLES
   ───────────────────────────────────────────────────────── */
.error-message {
  background: #fff3f3;
  border: 1px solid #ffcdd2;
  color: #d32f2f;
  padding: 15px;
  border-radius: 4px;
  margin: 20px 0;
  text-align: center;
}

/* ─────────────────────────────────────────────────────────
   10. ANIMATIONS
   ───────────────────────────────────────────────────────── */
@keyframes rotating-gradient-border {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* @property (Houdini API) ile daha pürüzsüz gradyan animasyonu */
@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotating-gradient-property {
  0% {
    --gradient-angle: 0deg;
  }
  100% {
    --gradient-angle: 360deg;
  }
}

/* ═════════════════════════════════════════════════════════
   RESPONSIVE DESIGN - TABLET & DESKTOP
   ═════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────
   Tablet & Mobile: ≤ 768px
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .table-view {
    padding: 10px;
  }

  .organizations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .organization-item {
    width: 100%;
    box-sizing: border-box;
  }

  .org-link {
    width: 100%;
  }

  .org-logo {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
  }

  .org-name-box {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
  }

  /* Hide desktop filter bar */
  .filter-mobile-toggle {
    display: none !important;
  }

  .filter-container {
    display: none !important;
  }

  .filter-content {
    display: none;
    padding: 0 20px 20px 20px;
    flex-direction: column;
    align-items: stretch;
  }

  .filter-content.mobile-active {
    display: flex;
  }

  .filter-group {
    align-self: normal !important;
    min-width: auto;
    width: 100%;
    max-height: 45px !important;
    max-width: 100% !important;
  }

  .filter-dropdown-button {
    min-width: auto;
  }
}

/* ─────────────────────────────────────────────────────────
   Small Mobile: ≤ 600px
   ───────────────────────────────────────────────────────── */
@media screen and (max-width: 600px) {
  /* Adjust tooltip position to not overflow left edge */
  .filter-info-wrapper::after {
    left: 0;
    transform: translateX(-15px);
  }
  .filter-info-wrapper::before {
    left: 15px;
    transform: translateX(-50%);
  }
}

/* ═════════════════════════════════════════════════════════
   MOBILE TABLE FILTERS (BOTTOM SHEET)
   ═════════════════════════════════════════════════════════ */

.mobile-table-filters {
  font-family: var(--font-main);
}

.mobile-filter-group {
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  border: 1px solid #eee;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.mobile-segment-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 0 15px;
  background: #fff;
}

/* ─────────────────────────────────────────────────────────
   AUTH GATE (table view)
   ───────────────────────────────────────────────────────── */
.table-auth-gate {
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  text-align: center;
  color: #6b7280;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  margin-top: 4px;
  overflow: hidden;
}
.table-auth-gate p {
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.4;
  width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}
.table-auth-gate .gate-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.table-auth-gate--compact {
  flex-direction: row;
  padding: 8px 12px;
  gap: 8px;
}
.table-auth-gate--compact p {
  display: none;
}
