/* --- General Body & Layout --- */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #000; /* AMOLED black */
  color: #e0e0e0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* --- Navigation Bar --- */
.navbar {
  width: 100%;
  background: #111;
  border-bottom: 1px solid #333;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.navbar.scrolled {
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.navbar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 30px;
}

.navbar li {
  display: inline;
  position: relative;
}

.navbar a {
  color: #f5c0c0;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  padding: 6px 0;
  position: relative;
  transition: color 0.3s ease;
}

.navbar a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background: #f5c0c0;
  transition: width 0.3s ease;
}

.navbar a:hover {
  color: #ffdada;
}

.navbar a:hover::after {
  width: 100%;
}

/* Light Theme Navbar */
body.light-theme .navbar {
  background: #fff;
  border-bottom: 1px solid #ddd;
}

body.light-theme .navbar a {
  color: #e63946;
}

body.light-theme .navbar a:hover {
  color: #ff6b6b;
}

body.light-theme .navbar a::after {
  background: #e63946;
}

/* --- Profile Header --- */
.profile-header {
  display: flex;
  align-items: center;
  padding: 20px;
  position: relative;
  border-bottom: 1px solid #222;
  background: url("images/fish.webp") no-repeat center center;
  background-size: cover;
  color: #fff;
  overflow: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

.profile-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 0;
}

.profile-header > * {
  position: relative;
  z-index: 1;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-right: 20px;
  object-fit: cover;
}

.profile-info h1 {
  margin: 0;
  font-size: 26px;
  color: #ffffff;
  transition: color 0.4s ease;
}

.profile-info a {
  color: #4da6ff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.profile-info a:hover {
  color: #80c1ff;
  text-decoration: underline;
}

.profile-info p {
  margin: 5px 0;
  color: #aaaaaa;
  transition: color 0.4s ease;
}

/* --- Section Heading --- */
h4 {
  font-size:5px
  color: white;
  background: linear-gradient(90deg, #e63946, #ff6b6b);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 15px;
  margin: 25px 0 15px 0;
  font-weight: bold;
  transition: all 0.4s ease;
}

/* --- Gallery --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid #333;
  margin: 20px 6px;
}

.gallery img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 8px;
  transform: scale(1);      /* stable base scale */
  opacity: 1;
  transition: transform 0.4s ease, filter 0.3s ease, box-shadow 0.3s ease;
}

.gallery img.fade-in {
  opacity: 0;
  transform: scale(0.95);
  animation: fadeIn 0.8s forwards;
}

.gallery img:hover {
  transform: scale(1.1);
  filter: brightness(1.15);
  box-shadow: 0 10px 20px rgba(255,192,192,0.3);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Footer --- */
footer {
  margin-top: auto;
  padding: 15px;
  background: rgba(0,0,0,.05);
  font-size: 14px;
  color: #7f8c8d;
  text-align: center;
  transition: background 0.4s ease, color 0.4s ease;
}

body.light-theme footer {
  background: rgba(0,0,0,.1);
  color: #555;
}

/* --- Light Theme Overrides --- */
body.light-theme {
  background: #f9f9f9;
  color: #222;
}

body.light-theme h4 {
  color: #222;
}

/* --- Theme Toggle --- */
.theme-toggle {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1001;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input { display: none; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #555;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #222;
  box-shadow: 0 0 8px #f5c0c0;
}

input:checked + .slider:before {
  transform: translateX(26px);
}
/* --- Zigzag Ball Animation --- */
:root {
  --arena-w: 500px;
  --arena-h: 50px;
  --ball: 20px;
}

.arena-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 5px 0;
}

.arena {
  width: var(--arena-w);
  height: var(--arena-h);
  border: 2px solid #ff5757;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(255,255,255,0.08) inset;
  background: #111;
  border-radius: 10px;
}

body.light-theme .arena {
  border-color: #e63946;
  background: #eee;
}

.ball {
  width: var(--ball);
  height: var(--ball);
  border-radius: 50%;
  background: #ff5757;
  position: absolute;
  top: 0;
  left: 0;
  box-shadow: 0 8px 18px rgba(0,0,0,0.4);
  animation: zigN 2s linear infinite alternate;
}

body.light-theme .ball {
  background: #e63946;
}

@keyframes zigN {
  0%   { left: 0; top: 0; }
  25%  { left: 25%; top: calc(100% - var(--ball)); }
  50%  { left: 50%; top: 0; }
  75%  { left: 75%; top: calc(100% - var(--ball)); }
  100% { left: calc(100% - var(--ball)); top: 0; }
}