/* Menu Button Hover State Fix */
.navbar-toggler:focus {
  box-shadow: none !important;
  outline: none !important;
}

/* Remove hover state when offcanvas is closed */
.navbar-toggler:not(.collapsed) {
  background-color: transparent !important;
}

/* Add transition for smooth hover effect */
.navbar-toggler {
  transition: all 0.2s ease-in-out;
}

/* Reset hover state when offcanvas is closed */
.offcanvas:not(.show) + .navbar-toggler:hover {
  background-color: transparent !important;
}

/* Player Graph Styles - Enhanced Design */
[data-controller="player-graph"] {
  overflow: auto;
  margin-bottom: 1.5rem;
  min-height: 200px;
  position: relative;
}

[data-controller="player-graph"] svg {
  display: block;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
  height: 100%;
}

/* Category color classes for player boxes */
.player-box {
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.1));
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

/* Apply background colors based on category */
.player-box.bg-primary { fill: var(--bs-primary); }
.player-box.bg-success { fill: var(--bs-success); }
.player-box.bg-info { fill: var(--bs-info); }
.player-box.bg-warning { fill: var(--bs-warning); }
.player-box.bg-danger { fill: var(--bs-danger); }
.player-box.bg-secondary { fill: var(--bs-secondary); }

/* Opacity variants */
.player-box.bg-opacity-75 { opacity: 0.85; }

.player-box:hover {
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.15));
  opacity: 0.9;
}

/* Ensure text is readable on colored backgrounds */
.player-name {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 4px;
  font-weight: 600;
  fill: #2c3e50;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.position-number {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 3px;
  fill: #5a6c7d;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  opacity: 0.9;
  text-anchor: start;
  dominant-baseline: middle;
}

.connection {
  stroke-width: 1.2;
  fill: none;
  opacity: 0.8;
  transition: all 0.3s ease;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.1));
}

.connection:hover {
  stroke-width: 1.5;
  opacity: 1;
}

.connection.winner {
  stroke: #27ae60;
  stroke-width: 1.5;
  stroke-dasharray: none;
  opacity: 0.9;
  filter: drop-shadow(2px 2px 4px rgba(39, 174, 96, 0.3));
}

.connection.winner:hover {
  stroke: #2ecc71;
  stroke-width: 2;
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .player-name {
    font-size: 6px;
  }
  
  .position-number {
    font-size: 4px;
  }
  
  [data-controller="player-graph"] svg {
    padding: 10px;
  }
  
  .player-box {
    stroke-width: 0;
  }
  
  .player-box:hover {
    stroke-width: 0;
    transform: translateY(-0.5px);
  }
  
  .connection {
    stroke-width: 1;
  }
  
  .connection:hover {
    stroke-width: 1.3;
  }
  
  .connection.winner {
    stroke-width: 1.3;
  }
  
  .connection.winner:hover {
    stroke-width: 1.8;
  }
}

.full-viewport-height {
  height: 100vh;
}

@supports (height: 100dvh) {
  .full-viewport-height {
    height: 100dvh;
  }
}

/* Profile View Styles */
.profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.profile-container h1 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.5rem;
  font-weight: 300;
}

.section {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 25px;
  padding: 25px;
  border-left: 4px solid #3498db;
}

.section h2 {
  color: #2c3e50;
  font-size: 1.4rem;
  margin-bottom: 20px;
  font-weight: 600;
  border-bottom: 2px solid #ecf0f1;
  padding-bottom: 10px;
}

.profile-field {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f8f9fa;
}

.profile-field:last-child {
  border-bottom: none;
}

.profile-field strong {
  min-width: 140px;
  color: #34495e;
  font-weight: 600;
  margin-right: 15px;
}

/* Form field styles to match show view */
.profile-field {
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.profile-field:last-child {
  border-bottom: none;
}

.profile-field-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
  display: block;
}

.profile-field-value {
  width: 100%;
  padding: 0.375rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
}

.profile-section-title {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: #343a40;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
}

/* Tennis-specific styling */
.section:nth-child(2) {
  border-left-color: #e74c3c;
}

.section:nth-child(3) {
  border-left-color: #f39c12;
}

/* Responsive design */
@media (max-width: 768px) {
  .profile-container {
    padding: 15px;
  }
  
  .profile-field {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .profile-field strong {
    min-width: auto;
    margin-bottom: 5px;
  }
}


/* User avatar styles */
.avatar-upload {
  position: relative;
  max-width: 100%;
  margin: 0 auto 2rem;
  text-align: center;
}

/* Drag and drop styles */
.avatar-upload.dragover .avatar-preview {
  border-color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.05);
  transform: scale(1.02);
}

.avatar-upload .avatar-preview {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px dashed #dee2e6;
  margin: 0 auto 1.5rem;
  background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure all child elements inherit the cursor */
.avatar-upload .avatar-preview * {
  cursor: pointer;
}

.avatar-upload .avatar-preview:hover {
  transform: translateY(-3px);
  border-color: #0d6efd;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.avatar-upload .avatar-preview:hover .avatar-edit-overlay {
  opacity: 1;
  transform: translateY(0);
}

.avatar-upload .avatar-preview:hover .default-avatar {
  transform: scale(1.1);
}

.avatar-upload .avatar-preview .default-avatar {
  color: #adb5bd;
  font-size: 3.5rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.avatar-upload .avatar-preview .avatar-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.avatar-upload .avatar-preview .avatar-edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 110, 253, 0.8);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.avatar-upload .avatar-preview .avatar-edit-overlay i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.avatar-upload .avatar-preview .avatar-edit-overlay span {
  font-size: 0.85rem;
  font-weight: 500;
}

/* Upload actions */
.upload-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 240px;
  margin: 0 auto;
}

/* Upload button */
.btn-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.5rem;
  background: #0d6efd;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(13, 110, 253, 0.2);
  width: 100%;
  text-decoration: none;
}

.btn-upload:hover {
  background: #0b5ed7;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(13, 110, 253, 0.25);
}

.btn-upload i {
  margin-right: 8px;
  font-size: 1.1em;
}

/* Remove button */
.btn-remove {
  background: transparent;
  color: #dc3545;
  border: 1px solid #dc3545;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.btn-remove:hover {
  background: rgba(220, 53, 69, 0.1);
  transform: translateY(-1px);
}

.btn-remove i {
  margin-right: 6px;
}

/* File info */
.file-info {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #6c757d;
}

.file-info .file-name {
  display: block;
  margin-top: 0.25rem;
  font-weight: 500;
  color: #495057;
  word-break: break-word;
}
  
.file-upload {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
}

.file-upload input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}

.file-info {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #6c757d;
}

.file-info .file-name {
  display: block;
  margin-top: 0.25rem;
  font-weight: 500;
  color: #495057;
  word-break: break-word;
}

/* Avatar thumbnail in navbar */
.navbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Avatar in user profile */
.profile-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
  .profile-avatar {
    width: 120px;
    height: 120px;
  }
}

/* Navbar brand logo should be fully visible */
.navbar-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Organization logos in menus and subnavbar */
.org-logo {
  object-fit: contain;
  border-radius: 0;
  display: inline-block;
}

/* Org subnavbar - mobile: show icons only */
@media (max-width: 576px) {
  .sub-navbar .nav .nav-link span {
    display: none;
  }
  .sub-navbar .nav .nav-link i {
    margin-right: 0 !important;
    font-size: 1.2rem;
    line-height: 1;
  }
  .sub-navbar .nav .nav-link {
    padding: 0.5rem 0.6rem;
  }
  .sub-navbar .nav .nav-item + .nav-item {
    margin-left: 0.25rem !important;
  }
}

.navbar, .sub-navbar {
  background-color: #fff;
}

.sub-navbar .nav .nav-link {
  color: var(--bs-body-color);
  border: 1px solid transparent;
}

.sub-navbar .nav .nav-link i {
  font-size: 1.1rem;
}

/* Navbar user dropdown harmony with subnavbar */
#userDropdown {
  border: 1px solid transparent;
  color: var(--bs-body-color);
}

#userDropdown:hover,
#userDropdown.show {
  background-color: var(--bs-light);
  border-color: #e9ecef;
}

.feed-container { margin: 0 auto; padding-top: 1rem; padding-bottom: 2rem; }
.feed-list { display: flex; flex-direction: column; gap: 1rem; }

.feed-composer .composer-textarea { border-radius: 12px; border: 1px solid #e9ecef; background: #fff; min-height: 90px; resize: vertical; }
.feed-composer .composer-textarea:focus { box-shadow: 0 0 0 0.25rem rgba(13,110,253,0.1); border-color: #b6d4fe; }
.feed-composer .composer-actions { justify-content: space-between; }

.feed-card { border: none; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.feed-header { background: #fff; border-bottom: 0; padding-top: .75rem; padding-bottom: .75rem; }
.feed-avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #0d6efd, #20c997); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5); }
.feed-avatar-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff; }
.feed-author { font-size: 0.95rem; line-height: 1.2; }
.feed-meta { font-size: 0.8rem; color: #6c757d; }
.feed-verb-badge { border: 1px solid #e9ecef; color: #6c757d; font-weight: 500; }

.feed-content { padding-top: .75rem; padding-bottom: .25rem; }
.feed-text p { font-size: 1rem; line-height: 1.6; color: #343a40; margin-bottom: .75rem; }

.feed-actions { background: #fff; border-top: 0; }
.feed-actions .btn { border-radius: 999px; padding-left: .9rem; padding-right: .9rem; }
.like-button { color: #6c757d; font-size: 1.25rem; line-height: 1; text-decoration: none; }
.like-button:hover { color: #dc3545; text-decoration: none; }
.like-button.liked { color: #dc3545; }
.likes-count {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 0.25rem;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  line-height: inherit;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  display: inline;
}
.likes-count:hover,
.likes-count:focus {
  color: #6c757d;
  text-decoration: none;
  outline: none;
  box-shadow: none;
}

/* Ensure the inner submit button of button_to looks like a link */
form.likes-count > button[type="submit"] {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: inherit;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  display: inline;
}
form.likes-count > button[type="submit"]:hover,
form.likes-count > button[type="submit"]:focus {
  color: inherit;
  text-decoration: none;
  outline: none;
  box-shadow: none;
}

.comment-line { font-size: 0.875rem; color: #495057; }
.comment-author { font-weight: 500; margin-right: 4px; }
.comment-body { color: #6c757d; }
.comment-time { color: #adb5bd; font-size: 0.75rem; margin-left: 6px; }
.comments .input-group .form-control { border-radius: 999px 0 0 999px; }
.comments .input-group .btn { border-radius: 0 999px 999px 0; }

@media (max-width: 576px) {
  .feed-avatar { width: 36px; height: 36px; }
  .feed-card { border-radius: 12px; }
  .feed-text p { font-size: .95rem; }
}
