/**
 * Provider Shout-Out System Styles
 *
 * @package PatientsFirstPAC_Components
 */

/* ==========================================================================
   Provider Section
   ========================================================================== */

.pfpac-provider-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   Filters
   ========================================================================== */

.pfpac-provider-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  align-items: center;
  background: #ffffff;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.pfpac-filter-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pfpac-search-group {
  position: relative;
  flex: 1;
  min-width: 320px;
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 11px 16px;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  min-height: 48px;
}

.pfpac-search-group:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.pfpac-search-group:focus-within {
  background: #ffffff;
  border: 1px solid #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  outline: none;
}

.pfpac-filter-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 11px 14px 11px 16px;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 48px;
}

.pfpac-filter-wrapper:hover {
  background: #e5e7eb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.pfpac-filter-wrapper:focus-within {
  background: #f9fafb;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.pfpac-filter-icon {
  color: #9ca3af;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.pfpac-search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.pfpac-search-input {
  width: 100%;
  border: none !important;
  padding: 0;
  padding-right: 32px;
  font-size: 15px;
  background: transparent;
  color: #374151;
  box-sizing: border-box;
  transition: all 0.2s ease;
  min-height: auto;
  line-height: 1.5;
  font-weight: 400;
  outline: none !important;
  box-shadow: none !important;
}

.pfpac-search-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.pfpac-search-input:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  color: #1f2937;
}

.pfpac-search-input:focus-visible {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.pfpac-filter-select {
  min-width: 180px;
  padding: 0;
  padding-right: 28px;
  border: none;
  background: transparent;
  font-size: 15px;
  color: #374151;
  cursor: pointer;
  appearance: none;
  font-weight: 500;
  line-height: 1.5;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: calc(100% - 8px) center;
  background-repeat: no-repeat;
  background-size: 12px 8px;
}

.pfpac-filter-select:focus {
  outline: none;
  color: #1f2937;
}

/* Dropdown options styling */
.pfpac-filter-select option {
  padding: 12px 16px;
  background: #ffffff;
  color: #1f2937;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  min-height: 44px;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.pfpac-filter-select option:hover,
.pfpac-filter-select option:focus,
.pfpac-filter-select option:checked {
  background: #e0f2fe;
  color: #0c4a6e;
  font-weight: 500;
}

.pfpac-filter-select option:first-child {
  font-weight: 500;
}

.pfpac-filter-select option:disabled {
  color: #9ca3af;
  font-style: italic;
  cursor: default;
}

/* ==========================================================================
   Provider Grid
   ========================================================================== */

.pfpac-provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 1400px) {
  .pfpac-provider-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) and (max-width: 1399px) {
  .pfpac-provider-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .pfpac-provider-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pfpac-provider-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .pfpac-provider-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .pfpac-filter-group {
    width: 100%;
    flex-direction: column;
    gap: 12px;
  }

  .pfpac-search-group {
    min-width: 100%;
  }

  .pfpac-filter-wrapper {
    width: 100%;
  }

  .pfpac-filter-select {
    width: 100%;
  }
}

.pfpac-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
}

.pfpac-no-providers {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   Provider Card
   ========================================================================== */

.pfpac-provider-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid #f3f4f6;
}

.pfpac-provider-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  transform: translateY(-6px);
  border-color: #e5e7eb;
}

/* Provider Image */
.pfpac-provider-image {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: transparent;
}

.pfpac-provider-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  background: transparent;
  display: block;
}

.pfpac-provider-photo.pfpac-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(105deg, #1a8cff 0%, #22c322 100%);
  object-fit: initial;
}

.pfpac-provider-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: #1f2937;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
}

/* Provider Info */
.pfpac-provider-info {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.pfpac-provider-name {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.pfpac-provider-title {
  font-size: 15px;
  color: #10b981;
  font-weight: 600;
  margin: 0;
}

.pfpac-provider-description {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Provider Tags */
.pfpac-provider-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.pfpac-tag {
  display: inline-block;
  background: #f3f4f6;
  color: #4b5563;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* Shout-Outs Count */
.pfpac-shoutouts-count {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #10b981;
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
}

.pfpac-shoutouts-count svg {
  color: #10b981;
  width: 18px;
  height: 18px;
}

/* Recent Comments */
.pfpac-recent-comments {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pfpac-comment-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.pfpac-comment-preview svg {
  color: #fbbf24;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.pfpac-comment-text {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
  font-style: italic;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.pfpac-comment-text span {
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.pfpac-comment-author {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
  margin-left: 24px;
}

/* Shout-Out Buttons (Card & Form Submit) */
.pfpac-shoutout-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px !important;
  background: linear-gradient(105deg, #1a8cff 0%, #22c322 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 16px !important;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 16px;
  box-shadow: 0 2px 6px rgba(115, 218, 156, 0.25) !important;
  min-height: auto !important;
  height: auto !important;
  line-height: 1.4 !important;
}

.pfpac-shoutout-btn:hover {
  background: linear-gradient(105deg, #1a8cff 0%, #22c322 100%) !important;
  box-shadow: 0 4px 12px rgba(115, 218, 156, 0.35) !important;
  transform: translateY(-1px);
}

.pfpac-shoutout-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(115, 218, 156, 0.25) !important;
}

.pfpac-shoutout-btn:disabled {
  background: #d1d5db !important;
  color: #9ca3af !important;
  cursor: not-allowed;
  transform: none;
  box-shadow: none !important;
}

.pfpac-shoutout-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ==========================================================================
   Submission Section
   ========================================================================== */

.pfpac-submission-section {
  max-width: 800px;
  margin: 60px auto 0;
  padding: 48px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .pfpac-submission-section {
    padding: 24px;
    margin-top: 40px;
    border-radius: 12px;
  }
}

.pfpac-section-title {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  text-align: center;
  margin: 0 0 12px;
}

.pfpac-section-subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 15px;
  margin: 0 0 32px;
}

/* ==========================================================================
   Tabs
   ========================================================================== */

.pfpac-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  border-bottom: 2px solid #f3f4f6;
}

.pfpac-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #6b7280;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: -2px;
}

.pfpac-tab:hover {
  color: var(--theme-palette-color-1, #6366f1);
}

.pfpac-tab.active {
  color: var(--theme-palette-color-1, #6366f1);
  border-bottom-color: var(--theme-palette-color-1, #6366f1);
}

.pfpac-tab svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Tab Content
   ========================================================================== */

.pfpac-tab-content {
  display: none;
}

.pfpac-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Forms
   ========================================================================== */

.pfpac-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pfpac-form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pfpac-form-group label {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  line-height: 1.4;
}

.pfpac-required {
  color: #ef4444;
  margin-left: 4px;
}

.pfpac-form input[type="text"],
.pfpac-form input[type="email"],
.pfpac-form select,
.pfpac-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
  background-color: #fff;
  line-height: 1.5;
  min-height: 50px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pfpac-form input:focus,
.pfpac-form select:focus,
.pfpac-form textarea:focus {
  outline: none;
  border-color: #9fdba9;
  box-shadow: 0 0 0 3px rgba(159, 219, 169, 0.15);
}

.pfpac-form textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.6;
}

.pfpac-form input::placeholder,
.pfpac-form textarea::placeholder {
  color: #9ca3af;
}

.pfpac-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: calc(100% - 16px) center;
  background-repeat: no-repeat;
  background-size: 12px 8px;
  padding-right: 44px;
  cursor: pointer;
}

/* Note: Submit buttons now use .pfpac-shoutout-btn class above */

/* Form Messages */
.pfpac-form-message {
  display: none;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

.pfpac-form-message.show {
  display: block;
}

.pfpac-form-message.success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.pfpac-form-message.error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .pfpac-provider-section {
    padding: 20px 16px;
  }

  .pfpac-section-title {
    font-size: 24px;
  }

  .pfpac-tabs {
    flex-direction: column;
    gap: 8px;
    border-bottom: none;
  }

  .pfpac-tab {
    width: 100%;
    justify-content: center;
    border-bottom: none;
    border-radius: 8px;
    background: #f3f4f6;
    padding: 14px 20px;
  }

  .pfpac-tab.active {
    background: linear-gradient(105deg, #1a8cff 0%, #22c322 100%);
    color: #ffffff;
  }

  .pfpac-provider-card {
    border-radius: 12px;
  }

  .pfpac-provider-image {
    height: 240px;
  }

  .pfpac-provider-info {
    padding: 20px;
  }

  .pfpac-form-group {
    gap: 8px;
  }

  .pfpac-form input[type="text"],
  .pfpac-form input[type="email"],
  .pfpac-form select,
  .pfpac-form textarea {
    font-size: 16px;
    padding: 12px 14px;
  }
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.pfpac-loading {
  pointer-events: none;
  opacity: 0.6;
}

.pfpac-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Custom Provider Type
   ========================================================================== */

.pfpac-custom-type-group {
  animation: slideDown 0.3s ease;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.pfpac-hidden {
  display: none !important;
}

.pfpac-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
