/*
 * Tempoll - Custom Styles
 */

/* Smooth transitions */
* {
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Hover effects for navigation */
.hover-bg:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

/* Vote options hover */
.vote-option {
  border-color: rgb(207, 217, 222) !important;
  transition: background-color 0.2s ease;
}

.vote-option:hover {
  background-color: rgba(29, 155, 240, 0.1) !important;
  border-color: rgb(29, 155, 240) !important;
}

/* Card hover effects */
.poll-card {
  transition: background-color 0.2s ease;
}

/* Poll action buttons */
.poll-action-btn {
  transition: color 0.2s ease;
}

.poll-action-btn:hover {
  color: rgb(29, 155, 240) !important;
}

/* Button improvements */
.btn {
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0a58ca 0%, #084298 100%);
  transform: translateY(-1px);
}

/* Rounded pill buttons */
.rounded-pill {
  border-radius: 50rem !important;
}

/* Avatar styles */
.avatar-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
}

/* Comments styles */
.list-group-item {
  border-color: rgba(0, 0, 0, 0.05);
}

/* Form improvements */
.form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-control.rounded-pill {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Badge improvements */
.badge {
  font-weight: 500;
}

/* Dropdown improvements */
.dropdown-menu {
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
}

.dropdown-item {
  border-radius: 0.25rem;
  margin: 0.125rem 0.25rem;
  width: calc(100% - 0.5rem);
}

.dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Nav pills improvements */
.nav-pills .nav-link {
  color: #6c757d;
  background-color: transparent;
}

.nav-pills .nav-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.nav-pills .nav-link.active {
  background-color: #0d6efd;
  color: white;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Offcanvas improvements */
.offcanvas {
  border: none;
  box-shadow: 0 0 2rem rgba(0, 0, 0, 0.1);
}

/* Alert improvements */
.alert {
  border: none;
  border-radius: 0.75rem;
}

/* Card improvements */
.card {
  border-radius: 0.75rem;
  overflow: hidden;
}

.card-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Progress bars in results */
.list-group-item.position-relative > div:first-child {
  border-radius: 0;
  transition: width 0.5s ease;
}

/* Empty state styling */
.text-center.py-5 {
  opacity: 0.8;
}

/* Link improvements */
a {
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* Collapse chevron animation */
[data-bs-toggle="collapse"] i.bi-chevron-down {
  transition: transform 0.2s ease;
  display: inline-block;
}

[data-bs-toggle="collapse"][aria-expanded="true"] i.bi-chevron-down {
  transform: rotate(180deg);
}

[data-bs-toggle="collapse"][aria-expanded="false"] i.bi-chevron-down {
  transform: rotate(0deg);
}

/* Specific rule for poll answers toggle */
#toggle_poll_answers_1[aria-expanded="true"] i.bi-chevron-down,
button[id^="toggle_poll_answers_"][aria-expanded="true"] i.bi-chevron-down {
  transform: rotate(180deg) !important;
}

/* Mobile responsive adjustments */
@media (max-width: 991.98px) {
  /* Remove main padding on mobile */
  main {
    padding: 0 !important;
  }

  /* Full width polls on mobile */
  .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
  }

  /* Adjust poll card padding for mobile */
  .poll-card > div {
    padding: 16px !important;
  }

  /* Reduce avatar size on mobile */
  .poll-card .rounded-circle {
    width: 36px !important;
    height: 36px !important;
    font-size: 13px !important;
  }

  /* Reduce gap between avatar and content */
  .poll-card .d-flex.gap-3 {
    gap: 10px !important;
  }

  /* Adjust font sizes for mobile */
  .poll-card [style*="font-size: 15px"] {
    font-size: 14px !important;
  }

  .poll-card [style*="font-size: 13px"] {
    font-size: 13px !important;
  }

  /* Reduce stats gap */
  .d-flex.gap-4 {
    gap: 1.5rem !important;
  }

  /* Remove hover effects on mobile */
  .poll-card:hover {
    background-color: transparent !important;
    cursor: default !important;
  }

  .vote-option:hover {
    background-color: transparent !important;
    border-color: rgb(207, 217, 222) !important;
  }

  /* Make dropdown full width on mobile */
  .dropdown-menu {
    width: 90vw;
    max-width: 300px;
  }

  /* Adjust offcanvas for mobile */
  .offcanvas {
    max-width: 85vw !important;
  }
}

/* Very small screens */
@media (max-width: 575.98px) {
  /* Reduce poll padding even more */
  .poll-card > div {
    padding: 14px 12px !important;
  }

  /* Reduce gap further */
  .poll-card .d-flex.gap-3 {
    gap: 8px !important;
  }

  /* Reduce avatar size further */
  .poll-card .rounded-circle {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
  }

  /* Smaller font on tiny screens */
  .poll-card [style*="font-size: 14px"] {
    font-size: 13px !important;
  }

  /* Reduce stats gap */
  .d-flex.gap-4 {
    gap: 1rem !important;
  }
}
