/* ============================================================
   retmetro.com — shared stylesheet
   <link rel="stylesheet" href="style.css">
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #f0f0f0;
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ---- Top left: logged in user display ---- */
#userDisplay {
  position: fixed;
  top: 10px;
  left: 10px;
  font-weight: bold;
  font-size: 16px;
  z-index: 101;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.9);
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#userDisplay img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* ---- Top right: login/register button ---- */
.toggle-login-btn {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 101;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background-color: #4CAF50;
  color: white;
  cursor: pointer;
}

/* ---- Top right: nav links (Home, Forum, etc.) ---- */
.site-actions {
  position: fixed;
  top: 20px;
  right: 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 101;
}

.site-actions a {
  color: #333;
  text-decoration: none;
  font-size: 14px;
}

.site-actions a:hover {
  text-decoration: underline;
}

/* ---- Login/signup panel ---- */
.login-container {
  position: fixed;
  top: 40px;
  right: 10px;
  background: rgba(255,255,255,0.95);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  width: 220px;
  z-index: 100;
  text-align: left;
  display: none;
}

.login-container input[type="text"],
.login-container input[type="password"],
.login-container input[type="file"] {
  width: 100%;
  padding: 6px;
  margin: 5px 0;
  border-radius: 4px;
  border: 1px solid #ccc;
  transition: 0.2s;
  box-sizing: border-box;
}

.login-container input:focus {
  border-color: #4CAF50;
  outline: none;
}

/* ---- Buttons ---- */
.btn {
  background-color: #4CAF50;
  color: white;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
  margin: 5px 0;
  width: 100%;
}

.btn:hover {
  background-color: #45a049;
}

.toggle-btn {
  background: none;
  border: none;
  color: #4CAF50;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  margin-top: 5px;
  display: block;
}

.logout-btn {
  background-color: #f44336;
  margin-top: 10px;
}

.logout-btn:hover {
  background-color: #d32f2f;
}

/* ---- Profile picture preview ---- */
#pfpPreview {
  margin: 5px 0;
}

#pfpPreview img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #4CAF50;
}

/* ---- Bottom bar ---- */
.link-box {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #445ffa;
  color: white;
  padding: 15px 20px;
  text-align: center;
  font-size: 14px;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.2);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-box a {
  color: #fff;
  text-decoration: none;
  margin: 0 10px;
  transition: color 0.2s;
}

.link-box a:hover {
  color: #ffd700;
}

.links-container {
  text-align: center;
  flex: 3;
}

.image-links {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 5px;
  padding-right: 50px;
  white-space: nowrap;
}

.image-links a {
  display: flex;
  align-items: center;
  gap: 4px;
  color: white;
  text-decoration: none;
}

.image-links img {
  width: 20px;
  height: 20px;
}

/* ---- Shake animation (used on bad login) ---- */
@keyframes shake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-5px); }
  40%  { transform: translateX(5px); }
  60%  { transform: translateX(-5px); }
  80%  { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.3s;
}

/* ==========================================================
   Shared Responsive Layout
   ========================================================== */

/* Login panel never wider than viewport */
.login-container {
  max-width: calc(100vw - 20px);
}

/* Bottom bar desktop alignment */
.link-box {
  min-height: 50px;
  height: auto;
  justify-content: space-between;
  padding: 10px 20px;
}

.links-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  flex: none;
  white-space: nowrap;
}

.site-actions {
  top: var(--nav-top, 20px);
  right: max(10px, 200px);
}

/* Mobile layout */
@media (max-width: 600px) {

  body {
    padding-bottom: 140px;
  }

  .link-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    padding: 15px 10px;
  }

  .links-container {
    position: static;
    transform: none;
    left: auto;

    display: flex;
    flex-direction: column;
    align-items: center;

    max-width: 100%;
    text-align: center;
    white-space: normal;

    gap: 6px;
    font-size: 11px;
    line-height: 1.4;
  }

  .links-container span.mobile-row {
    display: block;
    white-space: nowrap;
  }

  .image-links {
    position: static !important;
    transform: none !important;

    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;
    gap: 20px;
    padding-right: 0;
  }

  .image-links a {
    flex-direction: column;
    align-items: center;
  }

  .image-links img {
    width: 22px;
    height: 22px;
  }

  .image-links span {
    font-size: 11px;
  }
}

@media (max-width: 480px) {

  .site-actions {
    position: absolute;
    right: 10px;
    top: var(--nav-top, 60px);
  }
}