/* --- Base Page --- */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Poppins", sans-serif;
  background: linear-gradient(to bottom, #2c2f33, #1d2366);
  color: #fff;
  overflow-x: hidden;
  transition: background 0.5s, color 0.5s; 
}

/* === DESKTOP: Custom Scrollbar === */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: linear-gradient(to bottom, #1a1d2e, #0f1123);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #818181, #858585);
  border-radius: 10px;
  border: 2px solid #1a1d2e;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #777777, #727272);
}

/* Light Mode - Desktop Scrollbar */
body.light-mode ::-webkit-scrollbar-track {
  background: linear-gradient(to bottom, #e0ebff, #fffad1);
}

body.light-mode ::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #8b6f47, #d4a574);
  border: 2px solid #e0ebff;
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #a68456, #e8c291);
}

/* --- Banner Wrapper --- */
.banner-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
}

/* --- Banner --- */
.banner {
  width: 100%;
  height: 100%;
  background: url("assets/background.jpg") no-repeat center center/cover;
  -webkit-mask: radial-gradient(circle 82px at calc(15% + 70px) 100%, transparent 0, transparent 82px, black 82px);
  mask: radial-gradient(circle 82px at calc(15% + 70px) 100%, transparent 0, transparent 82px, black 82px);
  position: relative;
  z-index: 1;
}

/* --- Profile Picture --- */
.pfp {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  position: absolute;
  bottom: -70px;
  left: 15%;
  object-fit: cover;
  z-index: 10;
}

/* --- Profile Container --- */
.profile-container {
  margin-top: 100px;
  margin-left: 15%;
  margin-right: 15%;
  background: linear-gradient(to bottom, #011c41, #343a7c);
  border-radius: 15px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  position: relative;
  z-index: 5;
  text-align: left; 
  transition: background 0.5s, color 0.5s;
  min-height: 300px
}

/* --- Profile Name --- */
.profile-name {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 1px 1px 5px rgba(0,0,0,0.7);
  margin-bottom: 25px;
  transition: color 0.5s;
}

/* --- Bio Section --- */
.bio {
  width: 100%;
  padding: 20px 0;
  cursor: pointer;
  transition: color 0.5s, text-shadow 0.5s;
  min-height: 30px;
}

.bio p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.4;
  color: #fff;
  transition: color 0.5s, text-shadow 0.5s;
}

/* --- Quote Dots --- */
.quote-dots {
  display: flex;
  justify-content: flex-start;
  margin-top: 15px;
  gap: 8px;
}

.quote-dot {
  width: 10px;
  height: 10px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}

.quote-dot.active {
  width: 25px;
  background: #fff;
}

/* --- Links Section --- */
.links {
  margin-top: 25px;
  display: flex;
  justify-content: flex-start;
}

.discord-button {
  position: absolute; 
  bottom: 40px;       
  left: 40px;       
  background: linear-gradient(135deg, #7289da, #5865f2);
  border: none;
  border-radius: 8px;
  padding: 12px 25px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
  z-index: 10;
}

.discord-button:hover {
  background: linear-gradient(135deg, #4752c4, #5865f2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

/* --- Theme Toggle Button --- */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.2);
}

.theme-toggle .icon {
  width: 45px;
  height: 45px;
  transition: opacity 0.3s ease;
  position: absolute;
}

.theme-toggle .sun {
  color: #FFD93D;
}

.theme-toggle .moon {
  color: #6C63FF;
}

body.light-mode .sun {
  opacity: 0;
}

body.light-mode .moon {
  opacity: 1;
}

body:not(.light-mode) .sun {
  opacity: 1;
}

body:not(.light-mode) .moon {
  opacity: 0;
}

/* --- Light Mode Styles --- */
body.light-mode {
  background: linear-gradient(to bottom, #69a0ff, #fff59c);
  color: #000;
}

body.light-mode .profile-container {
  background: linear-gradient(to bottom, #e0ebff, #fffad1);
  color: #000;
}

body.light-mode .profile-name {
  color: #000; 
}

body.light-mode .bio {
  color: #000;
}

body.light-mode #quote-text {
  color: #000;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6); 
}

body.light-mode .quote-dot {
  background: rgba(0, 0, 0, 0.4);
}

body.light-mode .quote-dot.active {
  background: #000;
}

body.light-mode .discord-button {
  background: linear-gradient(135deg, #69a0ff, #fff59c);
  color: #000;
  box-shadow: 0 4px 15px rgba(105, 160, 255, 0.4);
}

body.light-mode .discord-button:hover {
  background: linear-gradient(135deg, #507bcc, #fff59c);
  box-shadow: 0 6px 20px rgba(105, 160, 255, 0.5);
}

/* Fade animation */
#quote-text {
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

.fade-out {
  opacity: 0;
}

.fade-in {
  opacity: 1;
}

.gallery-description {
  font-size: 1rem;
  color: #ccc;
  margin-bottom: 20px;
  text-align: left;
  transition: color 0.5s;
}

body.light-mode .gallery-description {
  color: #555; 
}

/* --- Gallery Section --- */
.gallery-container {
  margin: 60px 15% 60px 15%;
  position: relative;
  z-index: 5;
}

.gallery-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 1px 1px 5px rgba(0,0,0,0.7);
  margin-bottom: 5px;
  text-align: left;
  transition: color 0.5s, text-shadow 0.5s;
}

body.light-mode .gallery-title {
  color: #000;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.gallery-grid {
  column-count: 3;
  column-gap: 15px;
  width: 100%;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 15px;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
  padding: 10px 15px 8px 15px;
  transition: padding 0.3s ease, background 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 50px;
}

.gallery-item:hover .gallery-item-overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 70%, transparent 100%);
  padding: 15px;
  height: 80px;
}

.gallery-item-username {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  transition: transform 0.3s ease;
  transform: translateY(18px);
}

.gallery-item:hover .gallery-item-username {
  transform: translateY(0);
}

.gallery-item-link {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  text-decoration: none;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-top: 4px;
}

.gallery-item:hover .gallery-item-link {
  opacity: 1;
}

.gallery-item-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* --- Responsive --- */
@media screen and (min-width: 1700px) {
  .gallery-grid {
    column-count: 4;
  }
}

@media screen and (max-width: 1400px) {
  .gallery-grid {
    column-count: 3;
  }
}

@media screen and (max-width: 900px) {
  .gallery-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
  }
  
  .gallery-grid {
    column-count: 2;
    column-gap: 12px;
  }
  
  .gallery-item {
    margin-bottom: 12px;
  }
}

@media screen and (max-width: 700px) {
  /* === MOBILE: Use Default System Scrollbar === */
  ::-webkit-scrollbar {
    width: auto;
    height: auto;
  }

  ::-webkit-scrollbar-track,
  ::-webkit-scrollbar-thumb {
    background: initial;
    border: none;
    border-radius: 0;
  }

  ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
  }

  /* Firefox */
  * {
    scrollbar-width: auto;
    scrollbar-color: auto auto;
  }

  body {
    -ms-overflow-style: auto;
  }

  /* Light mode mobile scrollbar */
  body.light-mode ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
  }

  body.light-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
  }

  /* --- Mobile Layout --- */
  .banner-wrapper {
    height: 220px;
  }

  .pfp {
    width: 110px;
    height: 110px;
    left: 50%;
    transform: translateX(-50%);
    bottom: -55px;
  }

  .profile-container {
    width: auto;
    margin: 90px 5% 40px 5%; 
    padding: 25px 20px;
    text-align: center;
    border-radius: 12px;
  }
  
  .gallery-description {
    text-align: center;
  }

  .gallery-container {
    margin: 50px 5% 40px 5%;
  }

  .profile-name {
    font-size: 1.6rem;
    margin-bottom: 15px;
  }

  .bio p {
    font-size: 1rem;
    line-height: 1.4;
  }

  .quote-dots {
    justify-content: center;
    margin-top: 10px;
  }

  .links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .discord-button {
    position: absolute;
    left: 50%;               
    right: auto;             
    transform: translateX(-50%); 
    bottom: 15px;            
    font-size: 0.95rem;
  }

  .banner {
    -webkit-mask: radial-gradient(circle 65px at 50% 100%, transparent 0, transparent 65px, black 65px);
    mask: radial-gradient(circle 65px at 50% 100%, transparent 0, transparent 65px, black 65px);
  }

  .gallery-title {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 20px;
  }

  body {
    font-size: 15px;
  }
}

@media screen and (max-width: 500px) {
  .gallery-grid {
    column-count: 1;
  }
}