/* =========================================
   Frontend Styles für eifelcam
   ========================================= */

/* Global Layout */
body {
  font-family: Arial, sans-serif;
  background: #f9f9f9;
  margin: 0;
  padding: 20px;
  color: #333;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
}

footer {
  margin-top: 40px;
  font-size: 0.9em;
  color: #777;
  text-align: center;
}

/* =========================================
   Frontend Grid & Tiles
   ========================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 200px; /* Höhe einer Standardreihe */
  gap: 20px;
  margin-top: 20px;
}

.tile {
  position: relative;
  display: block;
  background: #fff;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-decoration: none;
  color: #333;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.tile img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.tile img.active {
  opacity: 1;
}

.tile .text {
  position: relative;
  margin-top: 10px;
  font-size: 14px;
  z-index: 2;
}

.tile .text h3 {
  margin: 5px 0;
  font-size: 1.1em;
}

.tile .text small {
  display: block;
  color: #555;
  font-size: 12px;
}

/* Tile Sizes */
.tile { grid-column: span 1; grid-row: span 1; }

.tile[data-size="1x2"] {
  grid-row: span 2;
}

.tile[data-size="2x1"] {
  grid-column: span 2;
}

.tile[data-size="2x2"] {
  grid-column: span 2;
  grid-row: span 2;
}

/* =========================================
   Admin Panel Tiles & Grid View
   ========================================= */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.admin-tile {
  position: relative;
  background: white;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  color: #333;
  cursor: grab;
}

.admin-tile img {
  max-width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}

.admin-tile strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.admin-tile small {
  display: block;
  color: #555;
  font-size: 12px;
  margin-bottom: 6px;
}

.admin-tile .actions {
  margin-top: 8px;
}

.admin-tile .actions button,
.admin-tile .actions a {
  display: inline-block;
  margin: 2px 4px;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
  background: #eee;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: #333;
}

.admin-tile .actions button:hover,
.admin-tile .actions a:hover {
  background: #333;
  color: #fff;
}

/* Admin Kachel-Labels */
.admin-tile::before {
  content: "ID " attr(data-id);
  position: absolute;
  top: 6px;
  left: 6px;
  background: #333;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0.85;
}

.admin-tile::after {
  content: "#" attr(data-pos);
  position: absolute;
  top: 6px;
  right: 6px;
  background: #007acc;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0.85;
}

/* =========================================
   Tile Shapes
   ========================================= */
.tile[data-shape="square"] {
  border-radius: 12px;
}

.tile[data-shape="round"] {
  border-radius: 50%;
  aspect-ratio: 1/1;
  overflow: hidden;
}

.tile[data-shape="round"] img {
  border-radius: 50%;
  object-fit: cover;
}

.tile[data-shape="triangle"] {
  width: 0;
  height: 0;
  border-left: 100px solid transparent;
  border-right: 100px solid transparent;
  border-bottom: 200px solid #f06;
  background: none !important;
  border-radius: 0;
}

.tile[data-shape="hexagon"] {
  clip-path: polygon(
    25% 0%, 75% 0%,
    100% 50%,
    75% 100%, 25% 100%,
    0% 50%
  );
}

.tile video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.tile video.active {
  opacity: 1;
}

