/**
 * Zeichenzähler & Wortzähler Plugin PRO Styles
 * Optimiert für WordPress mit erweiterten Features
 */

.zeichenzaehler-container {
  --zz-primary: #2791f6;
  --zz-primary-dark: #1e6bd1;
  --zz-accent: #CC1414;
  --zz-accent-dark: #ab077f;
  --zz-success: #28a745;
  --zz-success-dark: #218838;
  --zz-info: #17a2b8;
  --zz-text: #333;
  --zz-bg: #fff;
  --zz-border: 1px solid var(--zz-primary);
  --zz-radius: 8px;
  --zz-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}



.zeichenzaehler-title {
  text-align: center;
  color: var(--zz-text);
  font-size: 1.85rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--zz-primary), var(--zz-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* Sprachauswahl */
.zeichenzaehler-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.zeichenzaehler-language-switch {
  display: flex;
  gap: 0.5rem;
  background: #f5f5f5;
  padding: 0.3rem;
  border-radius: var(--zz-radius);
}

.lang-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  color: var(--zz-text);
}

.lang-btn:hover {
  background: rgba(39, 145, 246, 0.1);
}

.lang-btn.active {
  background: var(--zz-primary);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Textarea */
.zeichenzaehler-textarea {
  padding: 1.25rem;
  width: 100%;
  max-width: 100%;
  min-height: 220px;
  border-radius: var(--zz-radius);
  border: 2px solid #e0e0e0;
  margin-bottom: 1rem;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.3s ease;
  box-shadow: var(--zz-shadow);
}

.zeichenzaehler-textarea:focus {
  outline: none;
  border-color: var(--zz-primary);
  box-shadow: 0 0 0 4px rgba(39, 145, 246, 0.15);
}

/* Lesezeit Anzeige */
.zeichenzaehler-reading-time {
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: var(--zz-radius);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  box-shadow: var(--zz-shadow);
}

.reading-time-icon {
  font-size: 1.3rem;
  margin-right: 0.5rem;
}

#reading-time-display strong {
  color: var(--zz-primary);
  font-weight: 700;
}

/* Button Container */
.zeichenzaehler-button-container {
  text-align: center;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.zeichenzaehler-button {
  border: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-radius: var(--zz-radius);
  transition: all 0.25s ease;
  font-size: 1rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-clear {
  background: linear-gradient(135deg, var(--zz-accent), var(--zz-accent-dark));
}

.btn-export {
  background: linear-gradient(135deg, var(--zz-success), var(--zz-success-dark));
}

.btn-custom {
  background: linear-gradient(135deg, var(--zz-info), #138496);
}

.zeichenzaehler-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.zeichenzaehler-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Modal */
.zz-modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.zz-modal-content {
  background-color: var(--zz-bg);
  padding: 2rem;
  border-radius: var(--zz-radius);
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.zz-modal-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 1.8rem;
  cursor: pointer;
  color: #999;
  transition: color 0.2s;
}

.zz-modal-close:hover {
  color: var(--zz-accent);
}

.zz-modal-content h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--zz-text);
  font-size: 1.5rem;
}

.zz-modal-content input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: var(--zz-radius);
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.zz-modal-content input:focus {
  outline: none;
  border-color: var(--zz-primary);
}

/* Ergebnisse */
.zeichenzaehler-results {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
}

#zeichenzaehler-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
  justify-content: center;
}

#zeichenzaehler-list li {
  text-align: left;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  padding: 0.85rem 1.1rem;
  border: 2px solid #e9ecef;
  border-radius: var(--zz-radius);
  width: calc(33.333% - 0.5rem);
  box-sizing: border-box;
  font-size: 0.95rem;
  color: var(--zz-text);
  transition: all 0.2s ease;
  list-style: none !important;
  margin: 0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#zeichenzaehler-list li:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
  border-color: var(--zz-primary);
}

#zeichenzaehler-list li::before {
  content: none !important;
}

#zeichenzaehler-list .count {
  color: var(--zz-accent);
  font-weight: 700;
  font-size: 1.15rem;
  margin-left: auto;
  padding-left: 0.75rem;
}

/* Custom Zeichen */
#zeichenzaehler-list li[data-type="custom"] {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-color: var(--zz-info);
}

.remove-custom {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0 0 0.5rem;
  margin-left: 0.5rem;
  transition: transform 0.2s;
}

.remove-custom:hover {
  transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 900px) {
  #zeichenzaehler-list li {
    width: calc(50% - 0.375rem);
  }
}

@media (max-width: 600px) {
  .zeichenzaehler-container {
    margin: 1rem auto;
    padding: 0 0.75rem;
  }
  
  .zeichenzaehler-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .zeichenzaehler-language-switch {
    flex-direction: column;
    width: 100%;
  }
  
  .lang-btn {
    width: 100%;
  }
  
  .zeichenzaehler-textarea {
    min-height: 180px;
    font-size: 0.95rem;
    padding: 1rem;
  }
  
  .zeichenzaehler-button-container {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .zeichenzaehler-button {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }
  
  #zeichenzaehler-list li {
    width: 100%;
    font-size: 0.9rem;
  }
  
  .zz-modal-content {
    padding: 1.5rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .zeichenzaehler-container {
    --zz-text: #e0e0e0;
    --zz-bg: #1a1a1a;
  }
  
  .zeichenzaehler-textarea {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border-color: #444;
  }
  
  .zeichenzaehler-reading-time {
    background: linear-gradient(135deg, #2a2a2a, #333);
  }
  
  #zeichenzaehler-list li {
    background: linear-gradient(135deg, #2a2a2a, #333);
    color: #e0e0e0;
    border-color: #444;
  }
  
  #zeichenzaehler-list li[data-type="custom"] {
    background: linear-gradient(135deg, #1a3a4a, #2a4a5a);
  }
  
  .zz-modal-content {
    background-color: #2a2a2a;
  }
  
  .zz-modal-content input {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border-color: #444;
  }
  
  .zeichenzaehler-language-switch {
    background: #333;
  }
}

/* Print Styles */
@media print {
  .zeichenzaehler-button-container,
  .zeichenzaehler-controls {
    display: none;
  }
}