/* Die Nöldeke-App Styles */
:root {
  --primary: #2c3e50;
  --secondary: #34495e;
  --accent: #f6b34e;          /* Orange vom Anmelden-Button der Website */
  --accent-dark: #e09a2e;
  --bg: #f8f9fa;
  --text: #2c3e50;
  --card-bg: #ffffff;
  --border: #e9ecef;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 70px; /* for bottom nav */
}

.app-header {
  background: var(--primary);
  color: white;
  padding: 1rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-top: 4px solid var(--accent);
  border-bottom: 4px solid var(--accent);
  position: relative;
}
.back-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  text-decoration: none;
  font-size: 1.2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.back-btn:hover { background: #f5f5f5; }
.app-header h1 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.app-header img { max-height: 60px; margin: 0.5rem auto; display: block; border-radius: 8px; }

.tiles-wrapper {
  background: url('../logo.png') center 30% / 280px no-repeat;
  background-color: #f8f9fa;
  min-height: calc(100vh - 180px);
  position: relative;
}
.tiles-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(248, 249, 250, 0.82);
  z-index: 0;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  padding: 1rem;
  position: relative;
  z-index: 1;
}
.tile {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.tiles a.tile[style*="flex"] {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 0.6rem;
  transition: transform 0.15s;
}
.tiles a.tile[style*="flex"]:hover {
  transform: translateY(-2px);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
}
.bottom-nav a {
  color: #7f8c8d;
  text-decoration: none;
  text-align: center;
  font-size: 0.875rem; /* +1px */
  flex: 1;
}
.bottom-nav a.active,
.bottom-nav a.active i {
  color: var(--accent) !important;
}
.bottom-nav a i {
  display: block;
  font-size: 1.5625rem; /* +1px */
  margin-bottom: 0.2rem;
}

.container { padding: 1rem; max-width: 800px; margin: 0 auto; }
.card { background: white; border-radius: 12px; padding: 1rem; margin-bottom: 1rem; box-shadow: 0 2px 6px rgba(0,0,0,0.06); }

/* Chat styles */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 140px); }
.messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; }
.message {
  background: white;
  border-radius: 12px;
  padding: 0.9rem;
  margin-bottom: 0.8rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  max-width: 90%;
  font-size: 1.05rem; /* größere Schrift für Nachrichten */
}
.message .meta { font-size: 0.85rem; color: #7f8c8d; margin-bottom: 0.3rem; }
.message .content { font-size: 1.05rem; line-height: 1.5; }
.message .content img { max-width: 100%; border-radius: 8px; cursor: pointer; }
.message .content a { color: var(--accent); }

.composer {
  background: #2c3e50; /* dunkelgrau wie Header */
  padding: 1rem 0.8rem 1.2rem; /* unten mehr Abstand zur Navigation */
  border-top: 1px solid #1a252f;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}
.composer textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.7rem 1rem;
  resize: none;
  font-family: inherit;
  font-size: 1.05rem; /* größere Schrift im Eingabefeld */
  min-height: 44px;
  max-height: 140px;
}
.composer button {
  background: var(--accent) !important;
  color: white !important;
  border: none !important;
  border-radius: 50% !important;
  width: 40px;
  height: 40px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Modal for images */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0; top: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  overflow: hidden;
}
.modal-content {
  margin: auto;
  display: block;
  max-width: 95%;
  max-height: 95%;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  touch-action: none;
}
.modal-close {
  position: absolute;
  top: 15px; right: 25px;
  color: white;
  font-size: 35px;
  cursor: pointer;
  z-index: 2001;
}

/* Settings */
.login-form input, .login-form button {
  width: 100%;
  padding: 0.8rem;
  margin: 0.5rem 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}
/* Buttons – Orange erzwingen */
button,
input[type="submit"],
.btn,
#logout-btn,
#push-btn,
#install-btn,
.login-form button,
.composer button {
  background-color: #f6b34e !important;
  background: #f6b34e !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer;
  font-weight: 600;
}
button:hover,
input[type="submit"]:hover,
#logout-btn:hover,
#push-btn:hover,
#install-btn:hover,
.login-form button:hover {
  background-color: #e09a2e !important;
  background: #e09a2e !important;
}
.sys-info { font-size: 0.9rem; color: #555; }
.version-tile { background: var(--primary); color: white; }

@media (max-width: 600px) {
  .tiles { grid-template-columns: 1fr 1fr; }
}
