@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&family=Quicksand:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Pacifico&display=swap');

/* Google Fonts direct @font-face rules */
/* vietnamese */
@font-face {
  font-family: 'Dancing Script';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/dancingscript/v28/If2cXTr6YS-zF4S-kcSWSVi_sxjsohD9F50Ruu7BMSo3Rep8hNX6plRPjLo.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Dancing Script';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/dancingscript/v28/If2cXTr6YS-zF4S-kcSWSVi_sxjsohD9F50Ruu7BMSo3ROp8hNX6plRPjLo.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Dancing Script';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/dancingscript/v28/If2cXTr6YS-zF4S-kcSWSVi_sxjsohD9F50Ruu7BMSo3Sup8hNX6plRP.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Great Vibes';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/greatvibes/v20/RWmMoKWR9v4ksMfaWd_JN9XIiaQoDmlrMlY.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Great Vibes';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/greatvibes/v20/RWmMoKWR9v4ksMfaWd_JN9XBiaQoDmlrMlY.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: 'Great Vibes';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/greatvibes/v20/RWmMoKWR9v4ksMfaWd_JN9XJiaQoDmlrMlY.woff2) format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* vietnamese */
@font-face {
  font-family: 'Great Vibes';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/greatvibes/v20/RWmMoKWR9v4ksMfaWd_JN9XKiaQoDmlrMlY.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Great Vibes';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/greatvibes/v20/RWmMoKWR9v4ksMfaWd_JN9XLiaQoDmlrMlY.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Great Vibes';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/greatvibes/v20/RWmMoKWR9v4ksMfaWd_JN9XFiaQoDmlr.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Pacifico';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/pacifico/v22/FwZY7-Qmy14u9lezJ-6H6MmBp0u-.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Pacifico';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/pacifico/v22/FwZY7-Qmy14u9lezJ-6D6MmBp0u-zK4.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
  font-family: 'Pacifico';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/pacifico/v22/FwZY7-Qmy14u9lezJ-6I6MmBp0u-zK4.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Pacifico';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/pacifico/v22/FwZY7-Qmy14u9lezJ-6J6MmBp0u-zK4.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Pacifico';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/pacifico/v22/FwZY7-Qmy14u9lezJ-6H6MmBp0u-.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
  font-family: 'Satisfy';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/satisfy/v22/rP2Hp2yn6lkG50LoCZOIHTWEBlw.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Debug border for layout visualization */
.debug-border {
  border: none !important;
}

.video-container {
  max-width: 500px;
  width: 100%;
  margin: 80px auto 0 auto;
  box-sizing: border-box;
  background: black;
}

.video-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
}

.video-content-container {
  position: relative !important;
  width: 100%;
  height: 200px;
  overflow: hidden;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

.video-thumbnail {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  border-radius: 8px;
  background: black;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  color: white;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  padding: 10px;
  z-index: 10;
}

#my-video1 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  margin: auto !important;
  z-index: 2;
  background: #000;
  border-radius: 8px;
}

.video-wrapper {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: auto;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-wrapper iframe,
[id^="videoIframe"] {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  background: black;
  border-radius: 8px;
  z-index: 11;
}

.countdown, .countdown-timer {
  position: absolute !important;
  top: 10px !important;
  right: 20px !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 18px !important;
  font-weight: 300 !important;
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  z-index: 20 !important;
  display: none;
  pointer-events: none;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.5) !important;
  letter-spacing: 0.5px !important;
  line-height: 1.2 !important;
  min-width: 20px !important;
  text-align: center !important;
}

.video-info {
  position: relative;
  z-index: 2;
  background: rgba(0,0,0,0.7);
  margin-top: 12px;
  padding: 8px 12px 8px 12px;
  border-radius: 0 0 8px 8px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

@media (max-width: 600px) {
  .video-container {
    max-width: 100vw;
    width: 100vw;
    margin: 80px 0 0 0;
    padding: 0;
  }
  .video-card {
    max-width: 100vw;
    width: 100vw;
    border-radius: 0;
  }
  .video-content-container {
    height: 190px;
  }
  .video-thumbnail, .video-wrapper, #my-video1 {
    border-radius: 0;
  }
  .video-info {
    border-radius: 0 0 8px 8px;
    padding: 8px 6px 8px 6px;
  }
}

body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 0;
background-color: black;
color: white;
overflow-x: hidden;
overflow-y: auto;
/* Hide scrollbar for Webkit browsers */
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none;  /* IE and Edge */
-webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
}
body::-webkit-scrollbar {
width: 0 !important;
height: 0 !important;
display: none !important;
background: transparent !important;
}
html {
overflow-x: hidden;
overflow-y: auto;
scrollbar-width: none;
-ms-overflow-style: none;
-webkit-overflow-scrolling: touch;
}
html::-webkit-scrollbar {
width: 0 !important;
height: 0 !important;
display: none !important;
background: transparent !important;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 6px 0 2px 0;
  text-align: center;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 1000;
  overflow: hidden;
  margin-bottom: 3px;
}

header::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 3px;
background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
0%, 100% { transform: translateX(-100%); }
50% { transform: translateX(100%); }
}

h1 {
margin: -1px 0 0 0;
font-size: 5em;
font-weight: 400;
font-family: 'Long Cang', 'Noto Serif SC', serif;
text-shadow: 0 2px 8px #a8325a88, 2px 2px 4px rgba(0,0,0,0.18);
background: linear-gradient(45deg, #a8325a, #c44569, #ff6b9d, #b3124b);
background-size: 200% 200%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
animation: gradient-shift 3s ease infinite;
letter-spacing: 2px;
position: relative;
z-index: 1;
}

@keyframes gradient-shift {
0%, 100% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
}

/* h2 {
margin: -7px 0 0 0;
font-size: 0.7em;
font-weight: 200;
text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
color: rgba(255,255,255,0.9);
letter-spacing: 1px;
position: relative;
z-index: 1;
} */

h5 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-weight: 400;
  letter-spacing: 1px;
  color: #c0c0c0;
  font-size: 0.6em;
}

main {
padding-top: 0;
margin-top: 15% !important;
padding-bottom: 2px;
display: flex;
flex-direction: column;
align-items: center;
}

.video-card {
    position: relative;
    overflow: hidden; /* Ensures nothing escapes the card */
    box-sizing: border-box;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    border-radius: 8px;
}

.video-wrapper {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: auto;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-wrapper iframe,
[id^="videoIframe"] {
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    margin: auto;
    display: block;
    position: static;
    object-fit: contain;
    background: black;
    z-index: 11;
}

.video-info {
    position: relative;
    z-index: 2; /* Lower than .video-wrapper */
    background: rgba(0,0,0,0.7);
}

.video-thumbnail,
#my-video,
.video-wrapper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 8px;
overflow: hidden;
padding: 0;
margin: 0;
}

.video-thumbnail img {
width: 100%;
height: 100%;
object-fit: contain;
position: absolute;
top: 0;
left: 0;
display: block;
border-radius: 8px;
background: black;
}

.play-icon:hover {
background-color: rgba(0, 0, 0, 0.7);
}

#videoIframe {
width: 100%;
height: 100%;
display: block;
border: none;
object-fit: cover;
background: black;
}

[id^="my-video"] {
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    margin: auto;
    display: block;
    position: static;
    object-fit: contain;
    background: black;
    z-index: 11;
}

#my-video::-webkit-media-controls {
display: none !important;
}

#my-video::-webkit-media-controls-panel {
display: none !important;
}

#my-video::-webkit-media-controls-play-button {
display: none !important;
}

#my-video::-webkit-media-controls-start-playback-button {
display: none !important;
}

.video-title {
  font-size: 40px;
  font-weight: 600;
  margin: 0;
  color: white;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  font-family: 'ZCOOL KuaiLe', cursive, serif;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.video-duration {
  background: transparent;
  color: white;
  font-size: 1px;
  font-weight: 30;
  margin: 0 0 64px 0;
  padding: 1px 3px;
  border-radius: 12px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin-top: 0;
}


/* Responsive Styles */
@media (max-width: 600px) {
h1 {
font-size: 2.6em;
}

h2 {
font-size: 0.7em;
}

.video-title {
font-size: 14px;
}

.video-duration {
font-size: 11px;
padding: 3px 6px;
}

/* Mobile-specific video card adjustments */
.video-card {
max-width: 100%;
width: 100%;
margin: 0 auto;
padding: 0;
box-sizing: border-box;
}

.video-content-container {
height: 190px;
box-sizing: border-box;
width: 100%;
max-width: 100%;
}

.video-container {
height: 190px; /* Match the content container height */
width: 100%;
max-width: 100%;
box-sizing: border-box;
padding: 0 10px;
}

.video-thumbnail {
height: 190px; /* Match the container height */
width: 100%;
max-width: 100%;
box-sizing: border-box;
}

.video-card.iframe-active {
min-height: 310px;
width: 100%;
max-width: 100%;
box-sizing: border-box;
}

.video-card.iframe-active .video-wrapper {
min-height: 190px;
width: 100%;
max-width: 100%;
box-sizing: border-box;
}
}

@media (min-width: 601px) and (max-width: 900px) {
h1 {
font-size: 2.8em;
}

h2 {
font-size: 0.75em;
}

.video-title {
font-size: 15px;
}

.video-duration {
font-size: 11px;
}
}

@media (min-width: 901px) {
h1 {
font-size: 3.2em;
}

h2 {
font-size: 0.8em;
}

.video-title {
font-size: 17px;
}

.video-duration {
font-size: 13px;
}
}

/* When ad is playing, hide play icon but allow clicks */
.video-container.ad-playing {
cursor: pointer !important;
}

.video-container.ad-playing .play-icon {
display: none !important;
pointer-events: none !important;
z-index: -1 !important;
}

.video-container.ad-playing #my-video {
cursor: pointer !important;
z-index: 1 !important;
}

/* When ad is playing, make video fill the container properly */
.video-container.ad-playing [id^="my-video"] {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  margin: auto !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

/* Ensure video content container maintains proper height during ads */
.video-container.ad-playing .video-content-container {
  height: 200px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

html, body {
height: 100%;
margin: 0;
padding: 0;
overflow-x: hidden !important;
overflow-y: auto !important;
}

.no-scrollbar {
overflow-y: auto;
-webkit-overflow-scrolling: touch;
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none;  /* IE and Edge */
}
.no-scrollbar::-webkit-scrollbar {
width: 0 !important;
height: 0 !important;
display: none !important;
background: transparent !important;
}

/* Loading spinner styles */
.loading-spinner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
    display: none;
}

@keyframes spin {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(360deg); }
}

/* Pink heart loading icon */
.loading-flower {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    z-index: 1000;
    display: none;
}

.loading-flower::before {
    content: '❤️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    animation: heart-pulse 1.5s ease-in-out infinite;
    filter: hue-rotate(300deg) saturate(1.5) brightness(1.2);
}

@keyframes heart-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.crossed-roses {
  width: 80px;
  height: 90px;
  margin: 0 auto 0 auto;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 0;
  animation: breeze 4s ease-in-out infinite alternate;
}

.crossed-roses svg {
  display: block;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.crossed-roses text {
  line-height: 1;
}

@keyframes breeze {
  0%   { transform: rotate(-3deg); }
  50%  { transform: rotate(3deg); }
  100% { transform: rotate(-3deg); }
}

.floating-return {
  position: fixed;
  bottom: 16px;
  left: 12px;
  background: #fff;
  color: #c44569;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 3px 8px;
  font-family: inherit;
  font-size: 0.8em;
  cursor: pointer;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s, color 0.2s;
}
.floating-return span:first-child {
  font-size: 1em !important;
}
.floating-return:hover {
  background: #ffe0ec;
  color: #a8325a;
}

body, .no-scrollbar {
  /* padding-top: 60px; */
}

/* Floating Search UI - Updated */
#floating-search-container {
  z-index: 9999 !important;
  position: fixed !important;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 0;
  gap: 0;
}

/* Slide Toggle Button */
.slide-toggle-btn {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0 12px 12px 0;
  width: 1px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  margin-right: 0;
  z-index: 10002;
  position: relative;
  backdrop-filter: blur(5px);
}

.slide-toggle-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border-radius: 0 12px 12px 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.slide-toggle-btn:hover::before {
  opacity: 1;
}

.slide-toggle-btn:hover {
  background: linear-gradient(135deg, rgba(118, 75, 162, 0.9), rgba(102, 126, 234, 0.9));
  transform: translateX(1px) scale(1.02);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.slide-toggle-btn:active {
  transform: translateX(1px) scale(0.98);
  transition: all 0.1s ease;
}

.slide-toggle-btn svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  padding: 2px;
}

.slide-toggle-btn .slide-in-icon,
.slide-toggle-btn .slide-out-icon {
  stroke: white !important;
  stroke-width: 3 !important;
}

/* Slide Icons */
.slide-in-icon, .slide-out-icon {
  transition: all 0.3s ease;
}

/* Magnifier Button - Updated */
.magnifier-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  margin: 0;
  z-index: 10001;
  /* Prevent zoom on touch */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* Prevent double-tap zoom */
  -webkit-tap-highlight-color: transparent;
  /* Explicitly prevent zoom */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  /* Ensure it's treated as a button */
  appearance: none;
  -webkit-appearance: none;
  /* Add padding to increase touch target */
  padding: 8px;
  box-sizing: border-box;
}

.magnifier-btn:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.magnifier-btn:active {
  transform: scale(0.95);
}

/* Floating Search Input - Updated */
#floating-search-input {
  display: none;
  margin-left: 0;
  z-index: 10000 !important;
  position: relative !important;
  height: 28px;
  font-size: 16px;
  font-family: 'Quicksand', 'Montserrat', 'Segoe UI', 'Nunito', Arial, sans-serif;
  border-radius: 14px;
  border: 1.5px solid #667eea;
  background: #222233;
  color: #fff;
  padding: 0 12px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
  outline: none;
  transition: all 0.3s ease;
  /* Prevent zoom on input */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* Prevent double-tap zoom */
  -webkit-tap-highlight-color: transparent;
  /* Prevent iOS zoom on focus */
  font-size: 16px !important;
  -webkit-text-size-adjust: 100% !important;
  -ms-text-size-adjust: 100% !important;
  /* Disable zoom on focus */
  transform: scale(1) !important;
  -webkit-transform: scale(1) !important;
}

#floating-search-input:focus {
  border: 2px solid #764ba2;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

#floating-search-input.visible {
  display: block;
  width: 160px;
  opacity: 1;
  padding: 0 12px;
  margin-left: 0;
  height: 28px;
}

#floating-search-input::placeholder {
  color: #888fa6;
  opacity: 1;
  font-style: italic;
  font-family: 'Segoe UI', 'Nunito', 'Quicksand', 'Montserrat', 'Arial Rounded MT Bold', Arial, sans-serif;
  letter-spacing: 0.04em;
}

/* Slide Animation States */
#floating-search-container.slided-out {
  transform: translateY(-50%);
}

#floating-search-container.slided-out .magnifier-btn,
#floating-search-container.slided-out #floating-search-input {
  transform: translateX(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  width: 0;
  margin: 0;
  padding: 0;
  border: none;
  overflow: hidden;
}

#floating-search-container.slided-out .slide-in-icon {
  display: none !important;
}

#floating-search-container.slided-out .slide-out-icon {
  display: block !important;
}

/* Default states for slide icons */
.slide-out-icon {
  display: none;
}

.slide-in-icon {
  display: block;
}

/* Reset states when not slided out */
#floating-search-container:not(.slided-out) .magnifier-btn,
#floating-search-container:not(.slided-out) #floating-search-input {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0);
}

#floating-search-container:not(.slided-out) .magnifier-btn {
  width: 44px;
  height: 44px;
  margin: 0;
}

#floating-search-container:not(.slided-out) #floating-search-input {
  width: 160px;
  margin-left: 0;
  padding: 0 12px;
  height: 28px;
  border: 1.5px solid #667eea;
}

/* Add transitions for smooth sliding */
.magnifier-btn,
#floating-search-input {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  margin: 0 8px;
  display: inline-block;
}

.search-results-container {
  max-width: 600px;
  margin: 10px auto 40px auto;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.search-result-card {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.7);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  padding: 12px 16px;
  gap: 18px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
.search-result-img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  background: #222;
  flex-shrink: 0;
}
.search-result-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.search-result-title {
  font-family: 'Montserrat', 'Quicksand', 'Pacifico', 'Segoe UI', Arial, sans-serif;
  font-size: 1.2em;
  font-weight: 300;
  color: #fff;
  margin: 0;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 6px rgba(168,50,90,0.10), 0 1px 2px rgba(0,0,0,0.12);
  line-height: 1.2;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}
.search-result-time {
  font-family: 'Quicksand', 'Montserrat', 'Segoe UI', Arial, sans-serif;
  font-size: 0.98em;
  color: #ff8c42;
  margin: 0;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 4px rgba(255,140,66,0.10);
  font-weight: 300;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.search-results-title, h2 {
  font-family: 'Pacifico', 'Montserrat', 'Quicksand', 'Segoe UI', Arial, cursive, sans-serif;
  font-size: 1.6em;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.06em;
  text-shadow: 0 3px 12px #a8325a22, 0 1px 4px rgba(0,0,0,0.18);
  margin-top: 36px;
  margin-bottom: 18px;
  text-align: center;
  line-height: 1.5;
}

/* Search Content Wrapper */
.search-content-wrapper {
  margin-top: 80px;
  padding: 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Navigation Section for Tabs (used in main.html) */
.nav-section.tab-navigation {
  background: #181818;
  padding: 0 0 2px 0;
  border-bottom: 1.5px solid #333;
  display: flex;
  align-items: center;
  height: 38px;
  font-family: inherit;
  font-size: 1.1em;
  position: fixed;
  top: 60px; /* Updated to account for new header height */
  left: 0;
  width: 100vw;
  z-index: 1000;
  user-select: none;
  box-sizing: border-box;
}

/* Navigation sections with vertical centering */
.nav-section {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* Old rules - commented out, replaced by icon-section */
/*
.nav-section.left-section {
  justify-content: flex-start;
  gap: 10px;
}

.nav-section.right-section {
  justify-content: flex-end;
  gap: 10px;
}
*/

.nav-section.center-section {
  flex: 1;
  text-align: center;
}

.nav-arrow {
  color: #aaa;
  font-size: 1.2em;
  margin-left: 2px;
  margin-right: 0;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
  z-index: 2;
  flex: 0 0 auto;
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-arrow:active {
  color: #fff;
}

.nav-arrow[disabled] {
  color: #333;
  pointer-events: none;
}

.nav-arrow.hidden {
  display: none;
}

.nav-tabs-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  height: 100%;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
  scroll-behavior: smooth;
}

.nav-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.nav-tabs-wrapper {
  display: flex;
  align-items: center;
  height: 100%;
  min-width: max-content;
}

.nav-tab {
  color: #ccc;
  font-family: 'Noto Serif SC', 'Kaiti', 'STKaiti', 'KaiTi', '楷体', cursive;
  font-weight: 300;
  font-size: 1em;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.10);
  padding: 0 10px;
  cursor: pointer;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  min-width: 48px;
  justify-content: center;
  white-space: nowrap;
}

.nav-tab.active {
  background: linear-gradient(135deg, #ff6b9d, #c44569);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

/* Stylish Search Area Styles */
.stylish-search-area {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px;
}

.stylish-search-area.show {
  transform: translateY(0);
}

.search-container {
  display: flex;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 16px;
  padding: 15px 20px;
  font-family: 'Noto Serif SC', serif;
  /* Prevent zoom on input */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* Prevent double-tap zoom */
  -webkit-tap-highlight-color: transparent;
  /* Prevent iOS zoom on focus */
  font-size: 16px !important;
  -webkit-text-size-adjust: 100% !important;
  -ms-text-size-adjust: 100% !important;
  /* Disable zoom on focus */
  transform: scale(1) !important;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
}

.search-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  /* Prevent zoom on touch */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* Prevent double-tap zoom */
  -webkit-tap-highlight-color: transparent;
}

.search-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.search-button:active {
  transform: scale(0.95);
}

.slide-up-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 15px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-family: 'Noto Serif SC', serif;
  gap: 8px;
  animation: bounce 2s infinite;
}

.slide-up-indicator svg {
  animation: slideUp 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

@keyframes slideUp {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* Responsive design for search area */
@media (max-width: 768px) {
  .stylish-search-area {
    padding: 15px;
  }
  
  .search-container {
    max-width: 100%;
    border-radius: 25px;
    margin: 0 10px;
    box-sizing: border-box;
  }
  
  .search-input {
    font-size: 14px;
    padding: 12px 15px;
    width: 85%;
    box-sizing: border-box;
  }
  
  .search-button {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
  }
  
  .slide-up-indicator {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .stylish-search-area {
    padding: 8px;
  }
  
  .search-container {
    max-width: 100%;
    margin: 0 3px;
    border-radius: 18px;
    padding: 2px;
  }
  
  .search-input {
    font-size: 12px;
    padding: 8px 10px;
    width: 80%;
    min-width: 120px;
  }
  
  .search-button {
    width: 35px;
    height: 35px;
  }
  
  .slide-up-indicator {
    font-size: 9px;
    margin-top: 8px;
  }
}

@media (max-width: 360px) {
  .stylish-search-area {
    padding: 6px;
  }
  
  .search-container {
    max-width: 100%;
    margin: 0 2px;
    border-radius: 16px;
    padding: 1px;
  }
  
  .search-input {
    font-size: 11px;
    padding: 6px 8px;
    width: 75%;
    min-width: 100px;
  }
  
  .search-button {
    width: 30px;
    height: 30px;
  }
  
  .slide-up-indicator {
    font-size: 8px;
    margin-top: 6px;
  }
}

/* No Results Message Styles */
.no-results-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.no-results-content {
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s ease;
}

.no-results-icon {
  font-size: 48px;
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}

.no-results-content h3 {
  color: white;
  font-family: 'Noto Serif SC', serif;
  font-size: 24px;
  margin: 0 0 15px 0;
  font-weight: 600;
}

.no-results-content p {
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Noto Serif SC', serif;
  font-size: 16px;
  margin: 8px 0;
  line-height: 1.5;
}

.try-again-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 12px 30px;
  font-size: 16px;
  font-family: 'Noto Serif SC', serif;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.try-again-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.try-again-btn:active {
  transform: translateY(0);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Responsive design for no results message */
@media (max-width: 768px) {
  .no-results-content {
    padding: 30px 20px;
    max-width: 90%;
  }
  
  .no-results-icon {
    font-size: 36px;
  }
  
  .no-results-content h3 {
    font-size: 20px;
  }
  
  .no-results-content p {
    font-size: 14px;
  }
  
  .try-again-btn {
    padding: 10px 25px;
    font-size: 14px;
  }
}

/* Stylish Navigation Icons */
.top-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: white;
}

.top-nav-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.top-nav-icon:hover::before {
  left: 100%;
}

.top-nav-icon:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(255, 255, 255, 0.1);
}

.top-nav-icon:active {
  transform: translateY(0) scale(0.95);
  transition: all 0.1s ease;
}

.top-nav-icon svg {
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.top-nav-icon:hover svg {
  transform: scale(1.1);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* Inner icons (category and list) - perfectly centered and sized */
.top-nav-icon[href="main.html"],
.top-nav-icon[href="index.html"] {
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
}

.top-nav-icon[href="main.html"] svg,
.top-nav-icon[href="index.html"] svg {
  width: 44px;
  height: 44px;
  display: block;
}

@media (max-width: 768px) {
  .top-nav-bar {
    height: 48px;
  }
  .top-nav-icon[href="main.html"],
  .top-nav-icon[href="index.html"] {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }
  .top-nav-icon[href="main.html"] svg,
  .top-nav-icon[href="index.html"] svg {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .top-nav-bar {
    height: 40px;
  }
  .top-nav-icon[href="main.html"],
  .top-nav-icon[href="index.html"] {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
  .top-nav-icon[href="main.html"] svg,
  .top-nav-icon[href="index.html"] svg {
    width: 28px;
    height: 28px;
  }
}

/* Right inner icon (list) - same thickness as category icon */
.top-nav-icon[href="index.html"] svg rect {
  stroke-width: 2;
  stroke: white;
  fill: white;
}

/* Outer icons (farther from center) - smaller than inner icons */
#searchBtn.top-nav-icon,
#historyBtn.top-nav-icon {
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 8px;
}

#searchBtn.top-nav-icon svg,
#historyBtn.top-nav-icon svg {
  width: 22px;
  height: 22px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  /* Inner icons */
  .top-nav-icon[href="main.html"],
  .top-nav-icon[href="index.html"] {
    width: 96px;
    height: 96px;
    padding: 6px;
    /* Perfect vertical centering: nav bar is 60px, icon is 96px, so we need -18px margin to center */
    margin-top: -18px;
    margin-bottom: -18px;
  }
  
  .top-nav-icon[href="main.html"] svg,
  .top-nav-icon[href="index.html"] svg {
    width: 52px;
    height: 52px;
    stroke-width: 2.5;
  }
  
  /* Right inner icon (list) - same thickness */
  .top-nav-icon[href="index.html"] svg {
    stroke-width: 2.5;
  }
  
  /* Outer icons */
  #searchBtn.top-nav-icon,
  #historyBtn.top-nav-icon {
    width: 40px;
    height: 40px;
    padding: 6px;
  }
  
  #searchBtn.top-nav-icon svg,
  #historyBtn.top-nav-icon svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  /* Inner icons */
  .top-nav-icon[href="main.html"],
  .top-nav-icon[href="index.html"] {
    width: 90px;
    height: 90px;
    padding: 5px;
    /* Perfect vertical centering: nav bar is 55px, icon is 90px, so we need -17.5px margin to center */
    margin-top: -17.5px;
    margin-bottom: -17.5px;
  }
  
  .top-nav-icon[href="main.html"] svg,
  .top-nav-icon[href="index.html"] svg {
    width: 48px;
    height: 48px;
    stroke-width: 2.5;
  }
  
  /* Right inner icon (list) - same thickness */
  .top-nav-icon[href="index.html"] svg {
    stroke-width: 2.5;
  }
  
  /* Outer icons */
  #searchBtn.top-nav-icon,
  #historyBtn.top-nav-icon {
    width: 36px;
    height: 36px;
    padding: 5px;
  }
  
  #searchBtn.top-nav-icon svg,
  #historyBtn.top-nav-icon svg {
    width: 18px;
    height: 18px;
  }
}

/* Ensure proper vertical centering in navigation bar */
.top-nav-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 60px !important;
}

.top-nav-bar .nav-section {
  display: flex !important;
  align-items: center !important;
  justify-content: center;
  height: 100%;
}

.top-nav-bar .nav-section.center-section {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

/* Ensure all icons are vertically centered */
.top-nav-bar .top-nav-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Search Status Bar */
#search-status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  z-index: 10000;
  padding: 12px 20px;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

#search-status-bar.show {
  transform: translateY(0);
}

.search-status-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.search-status-icon {
  font-size: 20px;
  animation: pulse 1.5s ease-in-out infinite;
}

.search-status-text {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px;
  font-weight: 500;
}

.search-status-progress {
  flex: 1;
  max-width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.search-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #fff, #ff8c42);
  border-radius: 2px;
  width: 0%;
  animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

/* History Modal Styles */
#historyModal {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000000;
}

#historyModal > div {
  position: absolute;
  top: 98px;
  right: 0;
  transform: none;
  background: #222;
  border-radius: 0 0 0 12px;
  padding: 20px;
  max-width: 45%;
  max-height: 50%;
  overflow-y: auto;
  min-width: 150px;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  margin-top: 20px;
}

.history-title-main {
  color: white;
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-count-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  font-family: 'Noto Serif SC', serif;
  min-width: 20px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.history-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clear-history-btn {
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 6px;
  transition: background-color 0.2s;
}

.clear-history-btn:hover {
  background: #ff5252;
}

.history-count {
  color: #888;
  font-size: 12px;
  font-family: 'Noto Serif SC', serif;
}

#closeHistoryBtn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#closeHistoryBtn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#closeHistoryBtn:active {
  transform: scale(0.95);
}

.history-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #444;
  cursor: pointer;
  transition: background-color 0.2s;
}

.history-item:hover {
  background-color: #333;
}

.history-thumbnail {
  width: 80px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  margin-right: 12px;
  flex-shrink: 0;
}

.history-content {
  flex: 1;
  min-width: 0; /* Allow flex item to shrink below content size */
}

.history-title {
  font-weight: bold;
  margin-bottom: 6px;
  color: #fff;
  font-size: 14px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-wrap: break-word;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  max-height: 3.9em; /* 3 lines * 1.3 line-height */
}

.history-info-row {
  font-size: 10px;
  color: #aaa;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.history-info {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-info.play-count {
  color: #4CAF50;
  max-width: 70px;
}

.history-info.watch-time {
  color: #FF9800;
  max-width: 120px;
}

.history-info.time-ago {
  color: #2196F3;
  max-width: 50px;
}

.history-play-icon {
  color: #666;
  font-size: 12px;
  margin-left: 8px;
  flex-shrink: 0;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  #historyModal > div {
    top: 48px;
    right: 0;
    max-width: 47.5%;
    padding: 16px;
    min-width: 140px;
    border-radius: 12px 0 0 12px;
    max-height: 50%;
  }
  
  .history-title-main {
    font-size: 16px;
  }
  
  .history-thumbnail {
    width: 70px;
    height: 44px;
    margin-right: 10px;
  }
  
  .history-title {
    font-size: 13px;
    -webkit-line-clamp: 2;
    max-height: 2.6em; /* 2 lines * 1.3 line-height */
  }
  
  .history-info-row {
    font-size: 9px;
    gap: 6px;
  }
  
  .history-info.play-count {
    max-width: 60px;
  }
  
  .history-info.watch-time {
    max-width: 100px;
  }
  
  .history-info.time-ago {
    max-width: 45px;
  }
}

@media (max-width: 480px) {
  #historyModal > div {
    top: 40px;
    right: 0;
    max-width: 49%;
    padding: 12px;
    min-width: 130px;
    border-radius: 12px 0 0 12px;
    max-height: 50%;
  }
  
  .history-header {
    margin-bottom: 16px;
  }
  
  .history-title-main {
    font-size: 15px;
  }
  
  .clear-history-btn {
    padding: 2px 5px;
    font-size: 5px;
  }
  
  .history-item {
    padding: 10px;
  }
  
  .history-thumbnail {
    width: 60px;
    height: 38px;
    margin-right: 8px;
  }
  
  .history-title {
    font-size: 12px;
    margin-bottom: 4px;
    -webkit-line-clamp: 2;
    max-height: 2.4em; /* 2 lines * 1.2 line-height */
  }
  
  .history-info-row {
    font-size: 8px;
    gap: 4px;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .history-info {
    max-width: none !important;
    width: 100%;
  }
  
  .history-info.play-count {
    color: #4CAF50;
  }
  
  .history-info.watch-time {
    color: #FF9800;
  }
  
  .history-info.time-ago {
    color: #2196F3;
  }
  
  .history-play-icon {
    font-size: 10px;
    margin-left: 6px;
  }
}

@media (max-width: 360px) {
  #historyModal > div {
    top: 40px;
    right: 0;
    max-width: 50%;
    padding: 10px;
    min-width: 120px;
    border-radius: 12px 0 0 12px;
    max-height: 50%;
  }
  
  .history-title-main {
    font-size: 14px;
  }
  
  .clear-history-btn {
    padding: 2px 5px;
    font-size: 5px;
  }
  
  .history-item {
    padding: 8px;
  }
  
  .history-thumbnail {
    width: 50px;
    height: 32px;
    margin-right: 6px;
  }
  
  .history-title {
    font-size: 11px;
    -webkit-line-clamp: 2;
    max-height: 2.2em; /* 2 lines * 1.1 line-height */
  }
  
  .history-info-row {
    font-size: 7px;
    gap: 2px;
  }
}

/* Icon sections - equal width and perfect centering */
.nav-section.icon-section,
.top-nav-bar .nav-section.icon-section {
  width: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  gap: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.nav-section.center-section,
.top-nav-bar .nav-section.center-section {
  flex: 1 !important;
  text-align: center !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* Ensure all icons are perfectly centered within their sections */
.nav-section.icon-section .top-nav-icon,
.top-nav-bar .nav-section.icon-section .top-nav-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Override any specific icon rules to ensure perfect centering */
.nav-section.icon-section .top-nav-icon[href="index.html"],
.nav-section.icon-section .top-nav-icon[href="main.html"],
.top-nav-bar .nav-section.icon-section .top-nav-icon[href="index.html"],
.top-nav-bar .nav-section.icon-section .top-nav-icon[href="main.html"] {
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Ensure the icon content is centered */
.nav-section.icon-section .top-nav-icon .material-icons,
.top-nav-bar .nav-section.icon-section .top-nav-icon .material-icons {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Force the navigation bar to distribute space evenly */
.top-nav-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 60px !important;
  padding: 0 !important;
  gap: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Ensure each section maintains its intended width */
.top-nav-bar .nav-section.icon-section {
  flex: 0 0 60px !important;
  width: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.top-nav-bar .nav-section.center-section {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: center !important;
}

/* Responsive adjustments for icon sections */
@media (max-width: 768px) {
  .nav-section.icon-section,
  .top-nav-bar .nav-section.icon-section {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    flex: 0 0 50px !important;
  }
  
  .top-nav-bar .nav-section.icon-section {
    flex: 0 0 50px !important;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
  }
}

@media (max-width: 480px) {
  .nav-section.icon-section,
  .top-nav-bar .nav-section.icon-section {
    width: 45px !important;
    min-width: 45px !important;
    max-width: 45px !important;
    flex: 0 0 45px !important;
  }
  
  .top-nav-bar .nav-section.icon-section {
    flex: 0 0 45px !important;
    width: 45px !important;
    min-width: 45px !important;
    max-width: 45px !important;
  }
}
