/* Discord-like Custom Styling & Mobile Responsive UI */

/* Custom Smooth Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #1a1b1e;
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #2b2d31;
}

/* Tooltip on Discord Server Icons */
.server-icon .tooltip {
  visibility: hidden;
  position: absolute;
  left: 110%;
  top: 50%;
  transform: translateY(-50%);
  background-color: #111214;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
  pointer-events: none;
  z-index: 50;
}
.server-icon:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* Active Indicator bar for server icons */
.server-icon.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 32px;
  background-color: #fff;
  border-radius: 0 4px 4px 0;
}

/* Role button styles */
.role-btn {
  color: #949ba4;
}
.role-btn:hover {
  color: #dbdee1;
  background-color: rgba(255, 255, 255, 0.05);
}
.role-btn.active {
  background-color: #5865F2;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Speaking User Animation (Green Glowing Border) */
.user-speaking {
  box-shadow: 0 0 0 3px #23a55a !important;
  animation: pulse-speaking 1.2s infinite alternate;
}

@keyframes pulse-speaking {
  0% {
    box-shadow: 0 0 0 2px #23a55a;
  }
  100% {
    box-shadow: 0 0 0 5px rgba(35, 165, 90, 0.8), 0 0 15px rgba(35, 165, 90, 0.4);
  }
}

/* ================= MOBILE DRAWER & RESPONSIVE LAYOUT ================= */
@media (max-width: 767px) {
  #channel-sidebar {
    position: fixed;
    top: 48px; /* Below top header */
    bottom: 0;
    left: 48px; /* Beside slim left icon nav */
    width: 200px;
    max-width: calc(100vw - 60px);
    z-index: 40;
    transform: translateX(-120%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 25px rgba(0, 0, 0, 0.6);
  }

  #channel-sidebar.drawer-open {
    transform: translateX(0);
  }

  #sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: 48px;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    z-index: 35;
  }

  #sidebar-backdrop.active {
    display: block;
  }
}

@media (min-width: 768px) {
  #sidebar-backdrop {
    display: none !important;
  }
  #channel-sidebar {
    transform: none !important;
  }
}

/* ================= AVATAR FRAME & BANNER DECORATIONS ================= */
.avatar-frame-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-frame-overlay {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 118% !important;
  height: 118% !important;
  max-width: none !important;
  max-height: none !important;
  pointer-events: none !important;
  z-index: 10 !important;
  object-fit: contain !important;
}

/* Profile Banner Container with Background Photo + Foreground Frame */
.profile-banner-header {
  position: relative;
  width: 100%;
  height: 130px;
  background-size: cover;
  background-position: center;
  border-radius: 1rem 1rem 0 0;
  overflow: hidden;
}

.banner-profile-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.banner-frame-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  z-index: 5;
}

/* ================= CROWN SYSTEM (Left of Player Name) ================= */
.crown-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.3rem;
  vertical-align: middle;
  line-height: 1;
}

.crown-silver {
  filter: drop-shadow(0 0 4px rgba(226, 232, 240, 0.85));
}

.crown-gold {
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.95));
  animation: gold-pulse 2.2s ease-in-out infinite;
}

.crown-platinum {
  filter: drop-shadow(0 0 6px #38bdf8) drop-shadow(0 0 10px #ec4899);
  animation: platinum-sparkle 1.8s linear infinite;
}

@keyframes gold-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.8)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 8px rgba(245, 158, 11, 1)); }
}

@keyframes platinum-sparkle {
  0% { filter: drop-shadow(0 0 4px #38bdf8) drop-shadow(0 0 8px #ec4899); transform: scale(1); }
  50% { filter: drop-shadow(0 0 8px #f43f5e) drop-shadow(0 0 12px #38bdf8); transform: scale(1.12); }
  100% { filter: drop-shadow(0 0 4px #38bdf8) drop-shadow(0 0 8px #ec4899); transform: scale(1); }
}

/* ================= ACHIEVEMENTS (Point Record & Fish Record) ================= */
.trophy-card {
  transition: all 0.2s ease;
}
.trophy-card.unlocked {
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.25);
  border-color: rgba(251, 191, 36, 0.5) !important;
}
.trophy-card.locked {
  filter: grayscale(0.95) opacity(0.5);
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.fish-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.6rem;
}

.fish-record-card {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  padding: 0.5rem;
  text-align: center;
  transition: transform 0.15s ease;
}
.fish-record-card:hover {
  transform: translateY(-2px);
}
.fish-record-card.unlocked {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.fish-record-card.locked {
  background: rgba(15, 23, 42, 0.65);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: #64748b;
}

/* Realistic water ripples for fishing */
@keyframes water-ripple {
  0% { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(2.4); opacity: 0; }
}
.water-ripple-circle {
  animation: water-ripple 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.water-ripple-circle-delayed {
  animation: water-ripple 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
  animation-delay: 1s;
}

/* ================= MINI-GAME ANIMATIONS ================= */
/* Fishing bobber animation */
@keyframes bobber-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(8px) rotate(3deg); }
}
.bobber-floating {
  animation: bobber-float 2s ease-in-out infinite;
}

@keyframes fish-bite {
  0% { transform: translateY(0); }
  25% { transform: translateY(18px) scale(0.95); }
  50% { transform: translateY(8px); }
  75% { transform: translateY(22px) scale(0.9); }
  100% { transform: translateY(0); }
}
.bobber-biting {
  animation: fish-bite 0.5s ease-in-out infinite;
}

/* Coin pop animation */
@keyframes coin-pop {
  0% { transform: scale(1) translateY(0); opacity: 1; }
  100% { transform: scale(1.4) translateY(-25px); opacity: 0; }
}
.coin-earned-toast {
  animation: coin-pop 0.8s ease-out forwards;
}

@keyframes boss-shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  20% { transform: translate(-2px, -1px) rotate(-1deg); }
  40% { transform: translate(-3px, 0px) rotate(1deg); }
  60% { transform: translate(3px, 1px) rotate(0deg); }
  80% { transform: translate(1px, -1px) rotate(1deg); }
  100% { transform: translate(0px, 0px) rotate(0deg); }
}
.animate-shake {
  animation: boss-shake 0.2s ease-in-out;
}

/* Landscape Fullscreen Stream Mode (Otomatis & Imersif) */
.landscape-stream-mode #stream-player-box {
  height: 100% !important;
  max-height: 100% !important;
  flex: 1 1 100% !important;
}
.landscape-stream-mode #stream-details-box {
  display: none !important;
}
.landscape-stream-mode #landscape-floating-bar {
  display: flex !important;
}

/* Voice Note Player custom style */
.vn-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #5865F2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: transform 0.1s ease;
}
.vn-play-btn:active {
  transform: scale(0.95);
}

/* Waveform simulation animation */
.waveform-bar {
  width: 3px;
  background: #5865F2;
  border-radius: 2px;
  animation: wave 1s ease-in-out infinite;
}
@keyframes wave {
  0%, 100% { height: 6px; }
  50% { height: 18px; }
}

/* Post Like Button Animation */
.like-btn.liked {
  color: #f43f5e !important;
}
.like-btn.liked svg {
  fill: #f43f5e;
  stroke: #f43f5e;
  animation: heart-pop 0.3s ease;
}

@keyframes heart-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Safe Area Inset for Mobile Notch */
@supports (padding: max(0px)) {
  body {
    padding-left: min(0vmin, env(safe-area-inset-left));
    padding-right: min(0vmin, env(safe-area-inset-right));
    padding-bottom: min(0vmin, env(safe-area-inset-bottom));
  }
}

/* ================= ELEGANT SMOOTH BORDERS & ROUNDED UI ================= */
* {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.smooth-card {
  border-radius: 1.25rem !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.25);
}

.smooth-pill {
  border-radius: 9999px !important;
}

/* ================= LIGHT / WHITE THEME STYLES ================= */
html.light-theme,
body.light-theme {
  background-color: #f8fafc !important;
  color: #1e293b !important;
}

body.light-theme header {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-theme header .text-white {
  color: #0f172a !important;
}

body.light-theme #top-user-status > div {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

body.light-theme #top-user-status #top-user-name {
  color: #0f172a !important;
}

body.light-theme nav {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

body.light-theme nav .server-icon {
  background-color: #e2e8f0;
  color: #475569;
}

body.light-theme nav .server-icon:hover {
  background-color: #5865F2;
  color: #ffffff;
}

body.light-theme #channel-sidebar {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

body.light-theme #channel-sidebar .bg-discord-active {
  background-color: #e0e7ff !important;
  color: #4338ca !important;
  border: 1px solid #c7d2fe !important;
}

body.light-theme #channel-sidebar .text-gray-300 {
  color: #334155 !important;
}

body.light-theme #channel-sidebar .text-gray-400 {
  color: #64748b !important;
}

body.light-theme #channel-sidebar .hover\:bg-discord-hover:hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

body.light-theme #main-content,
body.light-theme #chat-container,
body.light-theme #stream-container,
body.light-theme #game-container,
body.light-theme #voice-container {
  background-color: #ffffff !important;
}

body.light-theme #chat-messages-container,
body.light-theme #messages-list {
  background-color: #ffffff !important;
}

body.light-theme #chat-header {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

body.light-theme #chat-header .text-white {
  color: #0f172a !important;
}

body.light-theme #chat-form-box {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

body.light-theme #chat-text-input {
  color: #0f172a !important;
}

body.light-theme #chat-text-input::placeholder {
  color: #94a3b8 !important;
}

body.light-theme #members-sidebar {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

body.light-theme #members-sidebar .text-white {
  color: #0f172a !important;
}

body.light-theme #members-sidebar .text-gray-300 {
  color: #334155 !important;
}

body.light-theme .bg-discord-channel {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #1e293b !important;
}

body.light-theme .bg-discord-sidebar {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #1e293b !important;
}

body.light-theme .bg-discord-darkest {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

body.light-theme .text-white {
  color: #0f172a !important;
}

body.light-theme .text-gray-200,
body.light-theme .text-gray-300 {
  color: #334155 !important;
}

body.light-theme .border-white\/10,
body.light-theme .border-white\/5 {
  border-color: #e2e8f0 !important;
}

body.light-theme input,
body.light-theme textarea,
body.light-theme select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.light-theme input::placeholder,
body.light-theme textarea::placeholder {
  color: #94a3b8 !important;
}

/* Modals in Light Theme */
body.light-theme #shop-modal > div,
body.light-theme #admin-modal > div,
body.light-theme #profile-modal > div,
body.light-theme #auth-overlay > div {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

body.light-theme .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Coin Rain Animation for GM Mode */
@keyframes coinDropAnim {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(105vh) rotate(360deg);
    opacity: 0;
  }
}

