/* Tools Page Styles */

.content-box {
  background: rgba(255,255,255,0.95);
  max-width: 700px;
  width: 100%;
  margin: 40px auto;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
}

/* Tools Page Typography - Keep main title dark */
body[data-page="tools"] .content-box > h1 {
  color: #1f2937 !important;
  text-shadow: none !important;
}

/* Make "Tool-Übersicht" h2 white */
body[data-page="tools"] .tools-overview-header h2,
body[data-page="tools"] .tools-overview-title {
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important;
}

.main-centered {
  max-width: 700px;
  margin: 40px auto;
  padding: 30px;
}

/* Tools Grid Styles */
#tools-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.tool-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.tool-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #1f2937;
  line-height: 1.3;
}

.tool-description {
  color: #6b7280;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  flex-grow: 1;
}

.tool-button, .btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  line-height: 1.2;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-button:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  color: white;
  text-decoration: none;
}

/* Spezielle Klassen für längere Texte */
.tool-button.long-text {
  white-space: normal;
  word-break: break-word;
  padding: 0.5rem;
  min-height: 50px;
}

.contact-intro {
  background: #f0f9ff;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  color: #374151;
  border-left: 4px solid #0ea5e9;
}

/* Override base.css button styles for better text handling */
.btn, button, .tool-button, .tool-link, a.btn {
  white-space: normal !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  text-align: center !important;
  line-height: 1.3 !important;
  padding: 0.75rem 1rem !important;
  min-height: 48px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: white;
}

/* Specific styling for tool grid items */
#tools-container .btn,
#tools-container button,
#tools-container a {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Spezielle Styles für "Jetzt im Shop kaufen" und "In den Warenkorb" Buttons */
/* Sehr spezifische Selektoren um andere CSS zu überschreiben */
body[data-page="tools"] .btn-shop-redirect,
body[data-page="tools"] .btn-premium,
body[data-page="tools"] .btn-cart,
body[data-page="tools"] .btn-add-to-cart,
body[data-page="tools"] .add-to-cart-btn,
body[data-page="tools"] .free-download-btn,
body[data-page="tools"] button[onclick*="redirectToShop"],
body[data-page="tools"] button[onclick*="addToCart"],
body[data-page="tools"] button[onclick*="warenkorb"],
body[data-page="tools"] #tools-container a[href*="/shop/"],
body[data-page="tools"] .tool-card a[href*="/shop/"],
body[data-page="tools"] #tools-container .btn-cart,
body[data-page="tools"] #tools-container .btn-add-to-cart,
body[data-page="tools"] #tools-container .add-to-cart-btn,
body[data-page="tools"] #tools-container .free-download-btn,
body[data-page="tools"] .tool-card .btn-cart,
body[data-page="tools"] .tool-card .btn-add-to-cart,
body[data-page="tools"] .tool-card .add-to-cart-btn,
body[data-page="tools"] .tool-card .free-download-btn,
body[data-page="tools"] .shop-product-card .add-to-cart-btn,
body[data-page="tools"] .shop-product-card .free-download-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: white !important;
  border: none !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  padding: 0.6rem 1rem !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3) !important;
}

body[data-page="tools"] .btn-shop-redirect:hover,
body[data-page="tools"] .btn-premium:hover,
body[data-page="tools"] .btn-cart:hover,
body[data-page="tools"] .btn-add-to-cart:hover,
body[data-page="tools"] .add-to-cart-btn:hover,
body[data-page="tools"] .free-download-btn:hover,
body[data-page="tools"] button[onclick*="redirectToShop"]:hover,
body[data-page="tools"] button[onclick*="addToCart"]:hover,
body[data-page="tools"] button[onclick*="warenkorb"]:hover,
body[data-page="tools"] #tools-container a[href*="/shop/"]:hover,
body[data-page="tools"] .tool-card a[href*="/shop/"]:hover,
body[data-page="tools"] #tools-container .btn-cart:hover,
body[data-page="tools"] #tools-container .btn-add-to-cart:hover,
body[data-page="tools"] #tools-container .add-to-cart-btn:hover,
body[data-page="tools"] #tools-container .free-download-btn:hover,
body[data-page="tools"] .tool-card .btn-cart:hover,
body[data-page="tools"] .tool-card .btn-add-to-cart:hover,
body[data-page="tools"] .tool-card .add-to-cart-btn:hover,
body[data-page="tools"] .tool-card .free-download-btn:hover,
body[data-page="tools"] .shop-product-card .add-to-cart-btn:hover,
body[data-page="tools"] .shop-product-card .free-download-btn:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4) !important;
  color: white !important;
}

/* Icons in Shop-Buttons */
.btn-shop-redirect::before,
.btn-premium::before,
button[onclick*="redirectToShop"]::before {
  content: "🛒 ";
  margin-right: 0.3rem;
}

/* Icons in Warenkorb-Buttons */
.btn-cart::before,
.btn-add-to-cart::before,
button[onclick*="addToCart"]::before,
button[onclick*="warenkorb"]::before {
  content: "🛒 ";
  margin-right: 0.3rem;
}

/* Icons in Free-Download-Buttons */
.free-download-btn::before {
  content: "💾 ";
  margin-right: 0.3rem;
}

/* Premium Badge */
.premium-badge {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
  color: white !important;
  font-size: 0.75rem !important;
  padding: 0.2rem 0.5rem !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-left: 0.5rem !important;
  box-shadow: 0 1px 3px rgba(139, 92, 246, 0.3) !important;
}

/* Filter Buttons Container - Horizontal Layout */
#filter-buttons,
.filter-buttons,
.tools-filter,
.category-filters {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 1.5rem 0 !important;
  padding: 0 !important;
}

/* Filter Button Styles */
#filter-buttons button,
.filter-buttons button,
.tools-filter button,
.category-filters button,
.filter-btn,
button[onclick*="showAllTools"],
button[onclick*="showFreeTools"],
button[onclick*="showPremiumTools"] {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  border: none !important;
  padding: 0.6rem 1.2rem !important;
  border-radius: 25px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  min-width: 120px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
}

#filter-buttons button:hover,
.filter-buttons button:hover,
.tools-filter button:hover,
.category-filters button:hover,
.filter-btn:hover,
button[onclick*="showAllTools"]:hover,
button[onclick*="showFreeTools"]:hover,
button[onclick*="showPremiumTools"]:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

/* Active Filter Button */
#filter-buttons button.active,
.filter-buttons button.active,
.tools-filter button.active,
.category-filters button.active,
.filter-btn.active {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%) !important;
  box-shadow: 0 2px 8px rgba(72, 187, 120, 0.4) !important;
}

/* Mobile Optimierung für Filter-Buttons - kleinere Schrift damit kein Umbruch */
@media (max-width: 480px) {
  #filter-buttons button,
  .filter-buttons button,
  .tools-filter button,
  .category-filters button,
  .filter-btn,
  button[onclick*="showAllTools"],
  button[onclick*="showFreeTools"],
  button[onclick*="showPremiumTools"] {
    font-size: 0.75rem !important;
    padding: 0.4rem 0.8rem !important;
    min-width: 100px !important;
  }
}

@media (max-width: 360px) {
  #filter-buttons button,
  .filter-buttons button,
  .tools-filter button,
  .category-filters button,
  .filter-btn,
  button[onclick*="showAllTools"],
  button[onclick*="showFreeTools"],
  button[onclick*="showPremiumTools"] {
    font-size: 0.7rem !important;
    padding: 0.35rem 0.6rem !important;
    min-width: 90px !important;
  }
}

/* Mobile Optimierung für H2-Überschriften der Tool-Sektionen */
@media (max-width: 480px) {
  /* Kostenlose Tools Überschrift */
  .free-tools-title {
    font-size: 1.3rem !important;
  }
  
  /* Premium Tools Überschrift */
  .premium-tools-title {
    font-size: 1.2rem !important;
  }
}

@media (max-width: 360px) {
  /* Noch kleinere Überschriften für sehr kleine Displays */
  .free-tools-title {
    font-size: 1.1rem !important;
  }
  
  .premium-tools-title {
    font-size: 1.0rem !important;
  }
}

/* Badge Text Management - standardmäßig langen Text zeigen */
.badge-short {
  display: none;
}

.badge-full {
  display: inline;
}

/* Mobile Optimierung für die Badge-Elemente neben den Überschriften */
@media (max-width: 480px) {
  /* Zeige kurzen Text statt langen auf mobil für beide Badges */
  .free-tools-badge .badge-full,
  .premium-tools-badge .badge-full {
    display: none !important;
  }
  
  .free-tools-badge .badge-short,
  .premium-tools-badge .badge-short {
    display: inline !important;
  }
  
  .free-tools-badge,
  .premium-tools-badge {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.7rem !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 360px) {
  .free-tools-badge,
  .premium-tools-badge {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.6rem !important;
  }
}

/* Auf sehr kleinen Displays Badge verstecken falls nötig */
@media (max-width: 320px) {
  .free-tools-badge,
  .premium-tools-badge {
    display: none !important;
  }
}