/**
 * PWD Leaks Table Styles
 * Responsive table styling for leak displays
 */

.pwd-leaks-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
}

.pwd-leaks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pwd-leaks-table thead {
  background-color: #0199CC;
}

.pwd-leaks-table th {
  padding: 12px 8px;
  text-align: left;
  font-weight: 900;
  color: #FFFFFF;
  border-bottom: 2px solid #ddd;
  /* white-space: nowrap; */
}

.pwd-leaks-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.pwd-leaks-table .pwd-leak-card-content .pwd-leaks-status-separator {
  margin: 5px 0;
}

/* Actions column button styling */
.pwd-leaks-table .pwd-leak-card-content[data-label="Actions"] {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pwd-leaks-table .pwd-leak-card-content[data-label="Actions"] .btn {
  display: inline-block;
  text-decoration: none;
  padding: 8px 16px;
  transition: opacity 0.2s ease;
}

.pwd-leaks-table .pwd-leak-card-content[data-label="Actions"] .btn:hover {
  opacity: 0.9;
}

.pwd-leaks-table .pwd-leak-card-content[data-label="Actions"] .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Mobile responsive for actions */
@media screen and (max-width: 768px) {
  .pwd-leaks-table .pwd-leak-card-content[data-label="Actions"] {
    flex-direction: column;
    gap: 8px;
  }
  
  .pwd-leaks-table .pwd-leak-card-content[data-label="Actions"] .btn {
    width: 100%;
    text-align: center;
  }
}

.pwd-leaks-table tbody tr:nth-child(even) {
  background-color: #ededed;
}

.pwd-leaks-table tbody tr:last-child td {
  border-bottom: none;
}

.pwd-leaks-map-link,
.pwd-leaks-update-link {
  color: #0073aa;
  text-decoration: none;
  font-weight: 500;
}

.pwd-leaks-map-link:hover,
.pwd-leaks-update-link:hover {
  color: #005177;
  text-decoration: underline;
}

/* Hide collapsible header on desktop */
.pwd-leak-card-header {
  display: none;
}

/* Responsive styles for mobile devices */
@media screen and (max-width: 768px) {
  .pwd-leaks-table-wrapper {
    overflow-x: visible;
  }

  .pwd-leaks-table,
  .pwd-leaks-table thead,
  .pwd-leaks-table tbody,
  .pwd-leaks-table th,
  .pwd-leaks-table td,
  .pwd-leaks-table tr {
    display: block;
  }

  .pwd-leaks-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .pwd-leaks-table tr.pwd-leak-card {
    border: 1px solid #ddd;
    margin-bottom: 15px;
    padding: 0;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
  }

  /* Collapsed header - always visible on mobile */
  .pwd-leak-card-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    width: 100%;
    border: none;
  }

  .pwd-leak-card-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
  }

  .pwd-leak-card-city {
    font-weight: 600;
    font-size: 16px;
    color: #333;
  }

  .pwd-leak-card-datetime {
    font-size: 14px;
    color: #666;
  }

  .pwd-leak-card-toggle {
    background: none;
    border: none;
    font-size: 24px;
    color: #0199CC;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    flex-shrink: 0;
  }

  .pwd-leak-card-toggle:focus {
    outline: 2px solid #0199CC;
    outline-offset: 2px;
    border-radius: 4px;
  }

  .pwd-leak-card-toggle-icon {
    display: block;
    transition: transform 0.3s ease;
    line-height: 1;
  }

  .pwd-leak-card[aria-expanded="true"] .pwd-leak-card-toggle-icon {
    transform: rotate(45deg);
  }

  /* Card content cells - hidden by default, shown when expanded */
  .pwd-leak-card-content {
    display: none !important;
    border: none;
    border-bottom: 1px solid #eee;
    padding: 10px 15px;
    text-align: left;
    flex-direction: column;
  }

  .pwd-leak-card[aria-expanded="true"] .pwd-leak-card-content {
    display: flex !important;
  }

  .pwd-leak-card-content:last-child {
    border-bottom: none;
  }

  /* Label styling - displayed above value */
  .pwd-leak-card-content:before {
    content: attr(data-label);
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* Value styling */
  .pwd-leak-card-content {
    font-size: 15px;
    color: #555;
  }
}

/* Tablet styles */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .pwd-leaks-table {
    font-size: 13px;
  }

  .pwd-leaks-table th,
  .pwd-leaks-table td {
    padding: 8px 6px;
  }
}

/* Modal Styles for Internal Comments */
.pwd-leaks-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwd-leaks-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.pwd-leaks-modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  z-index: 10001;
}

.pwd-leaks-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.pwd-leaks-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.pwd-leaks-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.pwd-leaks-modal-close:hover {
  color: #000;
}

.pwd-leaks-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.pwd-leaks-comments-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.6;
  color: #333;
}

.pwd-leaks-view-comments {
  color: #0199CC;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.pwd-leaks-view-comments:hover {
  color: #0177a3;
  text-decoration: underline;
}

/* Mobile modal adjustments */
@media screen and (max-width: 768px) {
  .pwd-leaks-modal-content {
    width: 95%;
    max-height: 90vh;
    margin: 20px;
  }

  .pwd-leaks-modal-header {
    padding: 15px;
  }

  .pwd-leaks-modal-header h3 {
    font-size: 18px;
  }

  .pwd-leaks-modal-body {
    padding: 15px;
  }
}

#gform_confirmation_wrapper_25 {
  background-color: #93FFA5;
  padding: 1rem;

}

.gform_confirmation_message_25 {
    color: #082654;
    font-weight: 900;
}

/* Copy Link Button */
.pwd-leaks-copy-link {
  white-space: nowrap;
}

.pwd-leaks-copy-link.copied {
  background-color: #10b981 !important;
  border-color: #10b981 !important;
}

.pwd-leaks-copy-link:disabled {
  opacity: 0.7;
  cursor: wait;
}