/* Basic reset */
*{ 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  font-family: Nunito, sans-serif; 
}

body { 
  background: #f1f1f3; 
  color: #111827; 
  min-height: 100vh;
  min-width: 320px;
}

.welcome-screen {
  width: 100%;
  min-height: calc(100vh - 88px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 15px;
  background: linear-gradient(135deg, #5bdbd1 0%, #79a9d2 100%);
  color: black;
}

.welcome-inner {
  text-align: center;
  max-width: 620px;
  width: 100%;
  background: rgba(255, 255, 255, 0.169);
  border-radius: 18px;
  border: 1.5px solid #c8d9ef;
  padding: 32px;
  box-shadow: 0 12px 34px rgba(15, 41, 62, 0.1);
}

.welcome-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: inline-block;
  animation: welcome-bounce 1.5s ease-in-out infinite;
}
#startSearchBtn{
  margin-top: 20px;
}

@keyframes welcome-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (max-width: 720px) {
  .welcome-screen {
    min-height: calc(100vh - 120px);
    padding: 20px;
  }
  .welcome-inner {
    padding: 22px;
  }
}

/* Topbar */
.topbar {
  display:flex;
  gap:16px;
  align-items:center;
  justify-content:space-between;
  padding:14px 20px;
  background-color: #40e0d08a;
  border-bottom: 1px solid #e6eef7;
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  backdrop-filter: blur(6px) saturate(140%);
}
@font-face{
    src: url(../fonts/ScienceGothic-VariableFont_CTRS\,slnt\,wdth\,wght.ttf);
    font-family: ScienceGothic;
}
@font-face{
    src: url(../fonts/Nunito-VariableFont_wght.ttf);
    font-family: Nunito;
}
.brand { 
  max-width: 700px;
  min-width: 105px;
  flex: 0 0 auto;
  font-size: 1.5rem; 
  letter-spacing:0.6px; 
  color:#0b2336; 
  font-family: ScienceGothic, Nunito, sans-serif;
  line-height: 1;
  white-space: nowrap;
}
.search-wrap { 
  display:flex; 
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 40%;
  width: 40%;
  gap:8px; 
}

#searchbox { 
  width: 100%;
  min-width: 150px;
  flex:1;
  padding:8px 12px; 
  border-radius:10px; 
  border:1px solid #d0d8e6;   
}
.btn { 
  padding:8px 12px; 
  background:#0f293e; 
  color:white; 
  border:none; 
  border-radius:8px; 
  cursor:pointer; 
}
.btn:hover { 
  background-color:#4e5d6c;
  border: 1px solid #0f293e;
  font-weight: 650; 
  transition: none;
}
.btn:active { 
  background:#0a1c2e; 
}

.button-section {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
  min-width: 0;
  flex-shrink: 0;
}

.quick-actions,
.account-actions,
#authSection {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bts{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    border:none;
    min-width: 72px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 15px;
    background-color: #242732d5;
    color: turquoise;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.bts:hover{
    border: 1px solid #24273271;
    background-color: #45cfd9;
    color: #242732d5;
    font-weight: bolder;
    transition: all 0.3s ease;
}

.user-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-height: 38px;
  padding: 2px 6px;
  border-radius: 999px;
}

.user-profile .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6c63ff, #1c96f7);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-transform: uppercase;
  border: 2px solid white;
}

.user-profile .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-profile .username {
  font-size: 0.9rem;
  font-weight: bold;
  color: #0f293e;
  display: inline-block;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff46;
  border: 1px solid #1d1e1e70;
  box-shadow: 0 5px 20px rgb(13, 30, 45);
  border-radius: 10px;
  min-width: 150px;
  width: 100%;
  z-index: 20;
  padding: 10px;
}

.profile-dropdown.hidden {
  display: none;
}

.profile-dropdown .dropdown-item {
  color: #223155;
  margin-bottom: 10px;
  font-weight: 700;
}

.profile-dropdown .logout-btn {
  width: 100%;
  background: #fb5165;
  border: none;
  color: white;
  border-radius: 8px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}

.profile-dropdown .logout-btn:hover {
  background: #d62032;
}

.menu-button {
    border: none;
    background: #24273270;
    padding: 0;
    width: 37px;
    height: 37px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.menu-button:hover{
    background-color: #2cbec9;
}

.menu-icon {
    display: block;
    width: 100%;
    height: 100%;
}

.bts:focus-visible,
.btn:focus-visible,
.menu-button:focus-visible,
.user-profile:focus-visible {
  outline: 2px solid #0f293e;
  outline-offset: 2px;
}

@media screen and (max-width: 720px){
    .topbar {
        flex-wrap: wrap;
        gap: 10px 0;
        align-items: center;
        padding: 12px 14px;
    }

    .brand {
        min-width: 0;
        font-size: clamp(1rem, 5vw, 1.35rem);
    }

    .search-wrap {
        order: 3;
        flex: 1 0 100%;
        width: 100%;
        margin-right: 0;
        margin-top: 2px;
    }

    .button-section {
        flex: 1 1 auto;
        flex-shrink: 1;
        width: auto;
        margin-left: clamp(8px, 4vw, 28px);
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: clamp(4px, 1.8vw, 8px);
    }

    .quick-actions,
    .account-actions,
    #authSection {
        flex-wrap: nowrap;
        gap: clamp(4px, 1.6vw, 8px);
    }

    .button-section .bts {
        min-width: auto;
        min-height: clamp(30px, 8.2vw, 36px);
        padding-inline: clamp(6px, 2vw, 12px);
        font-size: clamp(9px, 2.3vw, 11px);
    }

    .menu-button {
        width: clamp(20px, 8.2vw, 37px);
        height: clamp(20px, 8.2vw, 37px);
    }

    /* .menu-icon {
        width: clamp(18px, 4.5vw, 100%);
        height: clamp(18px, 4.5vw, 100%);
    } */

    .user-profile {
        min-height: clamp(30px, 8.2vw, 38px);
        gap: clamp(4px, 1.4vw, 8px);
        padding-inline: clamp(3px, 1vw, 6px);
    }

    .user-profile .avatar {
        width: clamp(28px, 7vw, 34px);
        height: clamp(28px, 7vw, 34px);
    }
}

@media screen and (max-width: 620px){
    .button-section {
        margin-left: clamp(8px, 3vw, 20px);
    }

    .user-profile .username {
        display: none;
    }

    .profile-dropdown {
        min-width: 160px;
        width: auto;
    }

    #authBtn {
        min-width: 0;
        padding-inline: clamp(5px, 1.5vw, 10px);
    }
}

/* menu panel */
.menu-panel{
    position:absolute;
    top: calc(100% + 6px);
    right: 5px;
    background-color:#242732e0;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgb(134, 134, 134);
    display: none;
    z-index: 999;
}
.theme-section, .slider-section{
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content:space-between;
}
.theme-btn{
    display: flex;
    justify-content:space-between;
    gap: 8px;
    width: auto;
    height: auto;
    background-color: #c4c4c474;
    border: none;
    padding: 4px 8px;
    border-radius: 30px;
    cursor: pointer;
}
.theme-btn p{
    margin-top: 12px;
    font-size: 12px;
}
.theme-btn img{
    width: 35px;
    height: 35px;
    border: 1px solid rgba(24, 25, 26, 0.436);
    background-color: rgba(154, 240, 231, 0.447);
    border-radius: 20px;
}
.theme-btn:hover{
    background:#b6b6b6eb;
}
.theme-btn:hover img{
  background:rgba(126, 246, 234, 0.916);
}

.slider-section img{
    width: 35px;
    margin-left: 5px;
}

.slider-section input[type="range"] {
    -webkit-appearance: none;
    width: 180px;
    height: 4px;
    border-radius: 3px;
    border:none;

}
.slider-section input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    cursor: pointer;

}
#fontSlider{
    background: linear-gradient(to right, #55f7e4, #ffffff);
}
#fontSlider::-webkit-slider-thumb{
    background: #5bdfba9c;
}
#fontSlider::-webkit-slider-thumb:hover{
    background-color: #5bdfba;
}

#scrollSpeedSlider{
    background: linear-gradient(to right, #4facfe, #ffffff);
}
#scrollSpeedSlider::-webkit-slider-thumb{
    background: #4facfe9c;
}
#scrollSpeedSlider::-webkit-slider-thumb:hover{
    background-color: #4facfe;
}

/* Control buttons */
.controls-right { 
  display:flex;
  gap:8px;
  flex: 1;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.icon-btn { 
  background:#fff; 
  border:1px solid #d1e6d0; 
  border-radius:8px; 
  padding:8px 10px; 
  cursor:pointer; 
}
.icon-btn:hover{
  border:1px solid #0f293e; 
  font-weight: 1000;
}
/* Footer */
.footer { 
  background-color: rgba(41, 237, 237, 0.553);
  text-align:center; 
  padding:18px; 
  color:#0f172a; 
  font-size: 1.2rem;
  font-weight: 700;
  border: 1.3px solid white;
}


/* ---------------- DARK MODE -------------------*/

body.dark-mode {
  background: #0f172a;
  color: #e5e7eb;
}

/* Topbar */
body.dark-mode .topbar {
  background-color: #05141559;
  border-bottom: 1px solid #1f2937;
}

body.dark-mode .brand {
  color: #67e8f9;
}

/* Inputs */
body.dark-mode #searchbox {
  background: #1e293b;
  border: 1px solid #67e8f9;
  color: #f1f5f9;
}

/* Buttons */
body.dark-mode .btn {
  background: #1e293b;
  color: #67e8f9;
}
body.dark-mode #startSearchBtn{
  background-color: #0a1c2e;
  border: 1px solid aqua;
}
body.dark-mode #startSearchBtn:hover{
  border-color: rgb(66, 244, 149);
  color: rgb(66, 244, 149);
}

body.dark-mode .btn:hover {
  background: #334155;
  font-weight: bold;
}
body.dark-mode .user-profile .username {
  color: #67e8f9;
}
body.dark-mode .button-section .bts{
  border: 1px solid #67e3f9;
}

body.dark-mode #copybt{
  border: 1px solid #67e3f9;
}
body.dark-mode #prevBtn:hover{
  border: 1px solid #67e3f9;
}
body.dark-mode #nextBtn:hover{
  border: 1px solid #67e3f9;
}
body.dark-mode .controls-right #autoScrollToggle{
  border: 1px solid #67e3f9;
}
body.dark-mode #dropdownUsername{
  color: #1a2332;
}
body.dark-mode #logoutBtn:hover{
  border: 1px solid #67e3f9;
  background-color: rgb(236, 43, 43);
  color: #1a2332;
  font-weight: 1000;
  transition: 0.3s ease;
}

/* Player card */
body.dark-mode .player-card {
  background: #1e293b;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

body.dark-mode .player-meta h2 {
  color: #f1f5f9;
}

body.dark-mode .muted {
  color: #94a3b8;
}
body.dark-mode .menu-button{
    background-color: #369daab0;
}
body.dark-mode .menu-button:hover{
    background-color: #2cbec9;
}
body.dark-mode .bts:focus-visible,
body.dark-mode .btn:focus-visible,
body.dark-mode .menu-button:focus-visible,
body.dark-mode .user-profile:focus-visible {
  outline-color: #67e8f9;
}
body.dark-mode .player-meta a{
  color: #67e8f9;
}

/* Lyrics card */
body.dark-mode .lyrics-card {
  background: #1e293b;
}

body.dark-mode .lyrics-container {
  background: linear-gradient(180deg,#1e293b,#111827);
  border: 1px solid #334155;
}

body.dark-mode .lyrics-text {
  color: #e2e8f0;
}

/* Search results */
body.dark-mode .search-result {
  background: #1e293b;
  border: 1px solid #334155;
}

body.dark-mode .search-result p {
  color: #94a3b8;
}

/* Menu panel */
body.dark-mode .menu-panel {
  background-color: #181f2fc0;
  box-shadow: 0 5px 15px rgba(158, 147, 147, 0.6);
}

/* Icon buttons */
body.dark-mode .icon-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
}

/* Spinner overlay */
body.dark-mode .spinner {
  background: rgba(0,0,0,0.6);
}

/* Smooth transition */
body, 
.topbar, 
.player-card, 
.lyrics-card, 
.search-result, 
.menu-panel, 
.btn, 
.icon-btn, 
#searchbox {
  transition: background 0.3s ease, color 0.3s ease, border 0.3s ease;
}

body.dark-mode .welcome-screen{
  background: linear-gradient(135deg, #314565, #111827);  
}
body.dark-mode .welcome-inner{
  background: rgba(0, 0, 0, 0.068);
  border: 1.5px solid rgba(0, 255, 255, 0.281);
  box-shadow: 0 12px 34px rgba(15, 41, 62, 0.3);
  color: rgba(0, 255, 255, 0.756);
  
}
body.dark-mode .footer { 
  background-color: #181f2fc0;
  color:aqua; 
  border: 1px solid #0f172a;
}

/* Base theme button transition */
.theme-btn {
  transition: all 0.3s ease;
}

/* When DARK MODE is active → highlight Dark button */
body.dark-mode .theme-btn.dark-active {
  background: linear-gradient(135deg, #22d3ee, #0ea5e9);
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.6);
}

body.dark-mode .theme-btn.dark-active img {
  background: rgba(255,255,255,0.2);
}

/* When LIGHT MODE is active → highlight Light button */
body:not(.dark-mode) .theme-btn.light-active {
  background: linear-gradient(135deg, #2bdab7, #2bdab7);
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}

body:not(.dark-mode) .theme-btn.light-active img {
  background: rgba(255,255,255,0.4);
}
    