/* Ulepszony styl dla bloku lokalizacji z modalem na całą stronę */

/* Wspólne zmienne dla wszystkich bloków K3e */
:root {
  --k3e-primary-color: #2271b1;
  --k3e-primary-hover: #135e96;
  --k3e-secondary-color: #f0f0f1;
  --k3e-text-color: #1d2327;
  --k3e-text-light: #646970;
  --k3e-border-color: #c3c4c7;
  --k3e-background-light: #f6f7f8;
  --k3e-card-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  --k3e-transition-speed: 0.3s;
  --k3e-location-color: #3498db;
  --k3e-header-bg: #f8f9fa;
  --k3e-modal-overlay: rgba(0, 0, 0, 0.7);
}

/* Główny kontener dla wszystkich bloków K3e */
.pro-k3e-block {
  margin: 0 0 10px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: var(--k3e-text-color);
  width: 100%;
}

/* Nagłówek bloku */
.pro-k3e-block-header {
  background-color: var(--k3e-header-bg);
  padding: 8px 10px;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border: 1px solid var(--k3e-border-color);
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pro-k3e-block-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.pro-k3e-block-header .header-icon {
  color: var(--k3e-location-color);
  margin-right: 6px;
  font-size: 16px;
}

/* Zawartość bloku */
.pro-k3e-block-content {
  background-color: #fff;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  box-shadow: var(--k3e-card-shadow);
  border: 1px solid var(--k3e-border-color);
  padding: 10px;
  display: block;
}

/* Szczegóły lokalizacji */
.pro-k3e-location-details {
  display: flex;
  flex-direction: column;
}

.pro-k3e-location-current {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all var(--k3e-transition-speed);
  padding: 5px;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.pro-k3e-location-current:hover {
  background-color: var(--k3e-background-light);
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.pro-k3e-location-current:after {
  content: "\f347";
  font-family: dashicons;
  position: absolute;
  right: 8px;
  font-size: 18px;
  color: var(--k3e-location-color);
  opacity: 0.6;
}

.pro-k3e-location-current:hover:after {
  opacity: 1;
}

.location-image {
  width: 45px;
  height: 45px;
  border-radius: 6px;
  overflow: hidden;
  margin-right: 10px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--k3e-location-color);
}

.location-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.pro-k3e-location-current:hover .location-image img {
  transform: scale(1.1);
}

.location-info {
  flex: 1;
  padding-right: 25px; /* Dla ikony strzałki */
}

.location-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--k3e-location-color);
}

/* Modal wyboru lokalizacji - w wersji na całą stronę */
.pro-k3e-location-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
}

.location-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--k3e-modal-overlay);
  animation: fadeIn 0.3s ease-out;
  z-index: 1;
}

.location-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease-out;
  z-index: 2;
}

/* Obsługa modala dla ekranów mobilnych */
@media (max-width: 768px) {
  .location-modal-content {
    width: 95%;
    max-height: 90vh;
  }
}

/* Animacje modala */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideIn {
  from { transform: translate(-50%, -45%); opacity: 0; }
  to { transform: translate(-50%, -50%); opacity: 1; }
}

.location-modal-header {
  padding: 12px 15px;
  border-bottom: 1px solid var(--k3e-border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--k3e-header-bg);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.location-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--k3e-location-color);
}

.location-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--k3e-text-light);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.location-modal-close:hover {
  color: #e74c3c;
  transform: scale(1.1);
}

.location-modal-body {
  padding: 15px;
  overflow-y: auto;
}

/* Grid lokalizacji */
.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.location-item {
  border: 1px solid var(--k3e-border-color);
  border-radius: 6px;
  transition: all var(--k3e-transition-speed);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.location-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-color: var(--k3e-location-color);
}

.location-item-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.location-active {
  border-color: var(--k3e-location-color);
  background-color: rgba(52, 152, 219, 0.05);
}

.location-active::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--k3e-location-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z' fill='white'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.location-item-thumbnail {
  height: 120px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.location-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.location-item:hover .location-item-thumbnail img {
  transform: scale(1.05);
}

.location-item-details {
  padding: 10px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, #fff, #f9f9f9);
}

.location-item-title {
  margin: 0 0 5px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--k3e-location-color);
}

.location-item-excerpt {
  font-size: 12px;
  color: var(--k3e-text-light);
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.location-item-requirements {
  font-size: 11px;
  color: var(--k3e-text-light);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--k3e-secondary-color);
}

.location-cost, .location-level {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
}

.cost-label, .level-label {
  font-weight: normal;
}

.cost-value, .level-value {
  font-weight: 600;
  color: var(--k3e-text-color);
}

.location-empty {
  text-align: center;
  padding: 25px 15px;
  color: var(--k3e-text-light);
  background-color: var(--k3e-background-light);
  border-radius: 6px;
}

/* Wiadomość o błędzie */
.pro-k3e-block-location-error {
  background-color: #f8d7da;
  color: #721c24;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #f5c6cb;
  margin: 8px 0;
  font-size: 12px;
}

/* Poprawki dla dashicons */
.pro-k3e-block .dashicons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  font-size: inherit;
  vertical-align: middle;
}

/* Notyfikacje */
.pro-k3e-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #333;
  color: white;
  padding: 12px 15px;
  border-radius: 6px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
  z-index: 999999;
  font-size: 14px;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
}

.pro-k3e-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.pro-k3e-notification.success {
  background-color: #27ae60;
}

.pro-k3e-notification.error {
  background-color: #e74c3c;
}

.pro-k3e-notification.warning {
  background-color: #f39c12;
}