/* ============================================
   COMPREHENSIVE BUTTON, TAB & LINK FIXES
   Ensures all interactive elements work properly
   ============================================ */

/* ============================================
   GENERAL INTERACTIVE ELEMENT FIXES
   ============================================ */

/* Ensure all buttons have proper cursor */
button:not(:disabled),
.btn:not(:disabled),
[role="button"]:not(:disabled),
[type="button"]:not(:disabled),
[type="submit"]:not(:disabled) {
  cursor: pointer;
  pointer-events: auto;
}

/* Ensure all links are clickable */
a:not(.disabled),
.nav-link:not(.disabled) {
  cursor: pointer;
  pointer-events: auto;
}

/* Tab buttons should always be clickable */
.main-tab-btn,
.chat-sub-tab-btn,
.social-tab-btn,
[role="tab"] {
  cursor: pointer;
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
}

/* ============================================
   COMMUNITY PAGE SPECIFIC FIXES
   ============================================ */

/* Main tab navigation */
.community-main-tabs {
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.main-tab-btn {
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.3s ease;
}

.main-tab-btn:hover {
  opacity: 0.9;
}

.main-tab-btn:active {
  transform: scale(0.98);
}

/* Social view tabs */
.social-view-tabs button,
.group-tabs button {
  cursor: pointer;
  pointer-events: auto;
}

/* Chat sub-tabs */
.chat-sub-tab-btn {
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.3s ease;
}

/* ============================================
   PROFILE AND ACTION BUTTONS
   ============================================ */

/* Edit Profile Button */
#edit-profile-btn {
  cursor: pointer;
  pointer-events: auto;
}

/* Create Post Buttons */
#create-post-text-btn,
[data-action="create-photo-post"],
[data-action="create-poll-post"],
[data-action="create-garage-post"] {
  cursor: pointer;
  pointer-events: auto;
}

/* Create Group Button */
#create-group-btn {
  cursor: pointer;
  pointer-events: auto;
}

/* Logout Button */
#logout-btn {
  cursor: pointer;
  pointer-events: auto;
}

/* ============================================
   NAVIGATION LINKS
   ============================================ */

.nav-links {
  pointer-events: auto;
}

.nav-link {
  cursor: pointer;
  pointer-events: auto;
  position: relative;
}

.nav-link:hover {
  opacity: 0.9;
}

/* ============================================
   CARDS AND CLICKABLE ELEMENTS
   ============================================ */

/* Group cards */
.group-card,
.friend-card,
.forum-category-card,
.chat-room-card {
  cursor: pointer;
  pointer-events: auto;
}

/* View buttons */
.view-group-btn,
.join-group-btn,
.add-friend-btn {
  cursor: pointer;
  pointer-events: auto;
}

/* ============================================
   MODAL ELEMENTS
   ============================================ */

.modal-overlay {
  pointer-events: auto;
}

.modal-content {
  pointer-events: auto;
}

.close-modal,
.modal-close-btn {
  cursor: pointer;
  pointer-events: auto;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

input:not(:disabled),
textarea:not(:disabled),
select:not(:disabled) {
  cursor: text;
  pointer-events: auto;
}

select:not(:disabled) {
  cursor: pointer;
}

/* ============================================
   DROPDOWN AND MENU ELEMENTS
   ============================================ */

.dropdown-toggle {
  cursor: pointer;
  pointer-events: auto;
}

.dropdown-menu {
  pointer-events: auto;
}

.dropdown-menu a,
.dropdown-menu button {
  cursor: pointer;
  pointer-events: auto;
}

/* ============================================
   MARKETPLACE ELEMENTS
   ============================================ */

.listing-card {
  cursor: pointer;
  pointer-events: auto;
}

.filter-btn,
.clear-filters-btn {
  cursor: pointer;
  pointer-events: auto;
}

/* Create Listing Button */
#create-listing-btn,
.marketplace-create-btn {
  cursor: pointer;
  pointer-events: auto;
}

/* ============================================
   CHAT ELEMENTS
   ============================================ */

#send-chat-message-btn,
.send-message-btn {
  cursor: pointer;
  pointer-events: auto;
}

.chat-room-item {
  cursor: pointer;
  pointer-events: auto;
}

/* ============================================
   FORUM ELEMENTS
   ============================================ */

#create-thread-btn,
.create-thread-btn {
  cursor: pointer;
  pointer-events: auto;
}

.thread-card,
.forum-post {
  cursor: pointer;
  pointer-events: auto;
}

/* ============================================
   ACCESSIBILITY - FOCUS STATES
   ============================================ */

button:focus-visible,
.btn:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

[data-theme="dark"] button:focus-visible,
[data-theme="dark"] .btn:focus-visible,
[data-theme="dark"] a:focus-visible,
[data-theme="dark"] [role="button"]:focus-visible,
[data-theme="dark"] [role="tab"]:focus-visible {
  outline-color: #9f7aea;
}

/* ============================================
   PREVENT DOUBLE-TAP ZOOM ON MOBILE
   ============================================ */

@media (max-width: 768px) {
  button,
  .btn,
  a,
  [role="button"] {
    touch-action: manipulation;
  }
}

/* ============================================
   ENSURE NO OVERLAY BLOCKING
   ============================================ */

/* Make sure no pseudo-elements block clicks */
.main-tab-btn::before,
.main-tab-btn::after,
.btn::before,
.btn::after,
.nav-link::before {
  pointer-events: none;
}

/* Only allow pointer events on the active indicator */
.nav-link.active::after {
  pointer-events: none;
}

/* ============================================
   ACTIVE/PRESSED STATES
   ============================================ */

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.main-tab-btn:active {
  transform: scale(0.98);
}

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

.btn.loading {
  cursor: wait;
  opacity: 0.7;
}

.btn.loading:hover {
  transform: none;
}
