
/* ==========================================================================
   Basis-Layout & Globale App-Stile (Der Rahmen für das Dashboard)
   ========================================================================== */

/* Haupt-Container der App */

.gallery {
    max-width: 1400px;
    margin: auto;
    width: 100%;
}

@media (max-width: 768px) {
	.gallery {
		margin: 0px auto;
		 border-radius: 0px;
	}
}

/* Die obere Leiste (Titel + Darkmode-Button) */
.app-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 25px;
    position: relative;
}

/* Hauptüberschrift */
.app-title {
    margin: 0;
    font-size: 1.50rem;
    color: #1a202c;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Der runde Nachtmodus-Button oben rechts */
.btn-dark-mode {
    background: #e2e8f0;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    font-size: 1.1rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-dark-mode:hover {
    background: #cbd5e0;
    color: #1a202c;
}

/* ==========================================================================
   BASIS DARK MODE (Für den äußeren Rahmen)
   ========================================================================== */
.gallery.dark-mode {
    background: #1a202c;
    color: #f7fafc;
}

.gallery.dark-mode .app-top-bar {
    border-bottom-color: #2d3748;
}

.gallery.dark-mode .app-title {
    color: #ffffff;
}

.gallery.dark-mode .btn-dark-mode {
    background: #2d3748;
    color: #f7fafc;
}

.gallery.dark-mode .btn-dark-mode:hover {
    background: #4a5568;
    color: #ffffff;
}

/* ==========================================================================
   CraSy Tool-Dashboard Styles
   ========================================================================== */

/* Header & Untertitel */
.dashboard-header {
    text-align: left;
    margin-bottom: 25px;
    padding-right: 40px;
}

.app-subtitle {
    font-size: 0.95rem;
    color: #4a5568;
    margin-top: 8px;
    line-height: 1.6;
}



/* Link-Kapselung zurücksetzen */
.gallery-element {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Die einzelnen Tool-Kacheln */
.tool-dashboard-card {
    display: flex;
    align-items: center;
    gap: 20px;
}
.tool-dashboard-element {
	background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
/* Hover-Effekt: Kacheln heben sich edel an */
.tool-card-link:hover .tool-dashboard-element {
    transform: translateY(-3px);
    border-color: #3182ce;
    box-shadow: 0 10px 15px -3px rgba(49, 130, 206, 0.1), 0 4px 6px -2px rgba(49, 130, 206, 0.05);
}

.download-content {
	padding: 20px;
}

option {
    background: #fff;
    color: #999;
	text-align:left;
}

/* Bildbegrenzung im Icon-Container (Verhindert das Zerschießen) */
.dashboard-tool-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Inhalt der Kachel (Textbereich) */
.tool-card-content {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.tool-card-content h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #2d3748;
    font-weight: 700;
}

.tool-card-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #718096;
    line-height: 1.5;
}

/* Der Aktions-Link ("Jetzt zählen ➔") */
.btn-tool-go {
    align-self: flex-start;
    font-size: 0.85rem;
    font-weight: bold;
    color: #3182ce;
    margin-top: 4px;
    transition: color 0.2s ease;
}

.tool-card-link:hover .btn-tool-go {
    color: #2b6cb0;
}

/* ==========================================================================
   INTEGRIERTER NACHTMODUS (DARK MODE)
   ========================================================================== */
.gallery.dark-mode .app-subtitle {
    color: #cbd5e0;
}

.gallery.dark-mode .tool-dashboard-card {
    background: #2d3748;
    border-color: #4a5568;
}

.gallery.dark-mode .gallery-img-container {
    background: #2b6cb0;
}

.gallery.dark-mode .tool-card-content h3 {
    color: #ffffff;
}

.gallery.dark-mode .tool-card-content p {
    color: #a0aec0;
}

.gallery.dark-mode .btn-tool-go {
    color: #63b3ed;
}

.gallery.dark-mode .tool-card-link:hover .tool-dashboard-card {
    border-color: #63b3ed;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Ab Tablet / Desktop zweispaltig)
   ========================================================================== */

/* Dashboard-spezifische Header-Styles */
.dashboard-header {
    text-align: left;
    margin-bottom: 20px;
    padding-right: 40px;
}
.app-subtitle {
    font-size: 0.95rem;
    color: #4a5568;
    margin-top: 5px;
    line-height: 1.5;
}
.gallery.dark-mode .app-subtitle {
    color: #cbd5e0;
}

/* Das Grid-System */
.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
	margin-bottom: 40px;
}

/* Link-Kapselung zurücksetzen */
.tool-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}



/* Container für das Icon/Bild links */
.gallery-img-container {
    height: 300px;
    min-width: 150px;
    background: #CADBBB;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
}
.gallery.dark-mode .gallery-img-container {
    background: #2b6cb0;
}

/* Bildbegrenzung im Icon-Container */
.dashboard-tool-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Inhalt der Kachel */
.tool-card-content {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.tool-card-content h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #2d3748;
}
.gallery.dark-mode .tool-card-content h3 {
    color: #fff;
}
.tool-card-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #718096;
    line-height: 1.4;
}
.gallery.dark-mode .tool-card-content p {
    color: #a0aec0;
}

.download-item {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Der Aktions-Link unten rechts an der Kachel */
.btn-tool-go {
    align-self: flex-start;
    font-size: 0.85rem;
    font-weight: bold;
    color: #3182ce;
    margin-top: 4px;
    transition: color 0.2s ease;
}
.tool-card-link:hover .btn-tool-go {
    color: #2b6cb0;
}
.gallery.dark-mode .btn-tool-go {
    color: #63b3ed;
}

/* Dark Mode für die Kacheln selbst */
.gallery.dark-mode .tool-dashboard-card {
    background: #2d3748;
    border-color: #4a5568;
}
.gallery.dark-mode .tool-card-link:hover .tool-dashboard-card {
    border-color: #63b3ed;
}

.tools-grid {
	display: grid;
	grid-template-columns: repeat(1, 1fr);
	gap: 20px;
}

h3.download-title {
    word-break: break-word;
    padding-bottom: 20px;
	line-height: 1;
}

/* Responsive Anpassung: Ab Tablets nebeneinander (Zweispaltig) */
@media (min-width: 640px) {
    .tools-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .tool-dashboard-card {
        box-sizing: border-box;
    }
	.app-title {
		font-size: 1.75rem;
	}
	h3.download-title {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
		height: 2.1em;
		padding-bottom: 4px;
		box-sizing: border-box;
		margin: 0 0 8px 0;
		word-break: break-word;
		padding-bottom: 20px;
	}
}

/* Responsive Anpassung: Ab Tablets nebeneinander (Zweispaltig) */
@media (min-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gallery {
  display: grid;
  grid-auto-flow: column;                        /* neue Elemente kommen nach rechts */
  grid-auto-columns: clamp(140px, 18vw, 220px);  /* feste, responsive Spaltenbreite */
  gap: 10px;

  overflow-x: auto;                              /* horizontal scrollen */
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;                 /* rastet sauber ein */
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;                           /* Platz für die Scrollbar */
  
  scrollbar-color: var(--CraSyApp); 
  width: 100%;
  max-width: 100%;

  cursor: grab;
  user-select: none;          /* kein Text-Markieren beim Ziehen */
  margin-bottom: 2em;
}
.gallery.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;     /* Snap beim Ziehen aus, sonst ruckelt es */
  scroll-behavior: auto;
}
.gallery.is-dragging * {
  pointer-events: none;       /* verhindert Hover-Effekte und Klicks beim Ziehen */
}

.gallery.pattern {
	grid-auto-columns: clamp(100px, 18vw, 140px) !important;
}


-webkit-scrollbar-track {
  background: var(--CraSyApp); /* Hintergrundfarbe */
}
-webkit-scrollbar-thumb {
  background: var(--CraSyApp); /* Farbe des Schiebereglers */
}

.gallery-item {
  aspect-ratio: 4 / 3;        /* gewünschtes Verhältnis, z. B. 1 / 1, 3 / 4, 16 / 9 */
  border-radius: 10px;
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--surface, #fff);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;          /* füllt die Kachel, ohne zu verzerren */
  display: block;
}

/* Button im gleichen Format */
.gallery-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed var(--border, #E7E4DE);
  color: var(--accent, #2563EB);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.gallery-more:hover {
  background: #fff;
  border-color: var(--accent, #2563EB);
}

/* Dezente Scrollbar */
.gallery::-webkit-scrollbar { height: 6px; }
.gallery::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }