@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Inter:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html.preload *,
html.preload *::before,
html.preload *::after {
  transition: none !important;
  animation: none !important;
}

body {
  font-family: "Inter", "Figtree", sans-serif;
  background-color: #0e0e0e; 
  color: #f1f1f1;
  transition: background-color 1s ease, color 1s ease;
  overflow-x: hidden;
  min-height: 100vh;
}

body.menu-open {
  overflow: hidden !important;
}

body.light-theme {
  background: #f8f8f8;
  color: #181a20;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 70px;
  height: 100vh;
  background: #0e0e0e;
  display: flex;
  align-items: center;
  z-index: 20;
  transition: background 0.45s;
}

body.light-theme .sidebar {
  background: #f8f8f8;
}

.sidebar-bar {
  position: absolute;
  left: 55px;
  top: 5vh;
  height: 90vh;
  width: 1px;
  background: #fff;
  border-radius: 1px;
  transition: background 0.45s;
}

body.light-theme .sidebar-bar {
  background: #111;
}

.sidebar-icons {
  position: absolute;
  left: 0;
  top: calc(5vh + 20px);
  width: 55px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.icon-link {
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  outline: none;
  width: 38px;
  height: 38px;
  transition: background 0.2s;
  border-radius: 50%;
}

.icon-link:active,
.icon-link:focus {
  background: rgba(255,255,255,0.09);
}

.icon {
  width: 28px;
  height: 28px;
  transition: filter 0.17s, opacity 0.45s;
  filter: invert(1);
  opacity: 1;
}

body.light-theme .icon {
  filter: none;
}

.icon-link:hover .icon,
.icon-link:focus .icon {
  filter: brightness(2.2) invert(1);
  opacity: 0.85;
}

body.light-theme .icon-link:hover .icon,
body.light-theme .icon-link:focus .icon {
  filter: brightness(0.6);
  opacity: 0.85;
}

.header {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 0 40px 0; 
}

.header-logo {
  width: 250px;
  height: auto;
  transition: all 0.5s ease;
}

body.light-theme .header-logo {
  content: url('../assets/playlistconverter-logo-b.png');
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1002;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.hamburger-line {
  width: 28px;
  height: 3px;
  background-color: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
  display: block;
}

body.light-theme .hamburger-line {
  background-color: #0e0e0e;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #0e0e0e 0%, #1a1a1a 100%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

body.light-theme .mobile-menu-overlay {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
}

.mobile-menu-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  width: 100%;
  padding: 0 20px;
  transform: translateY(20px);
  transition: transform 0.4s ease;
}

.mobile-menu-overlay.active .mobile-menu-content {
  transform: translateY(0);
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  text-decoration: none;
  color: #f1f1f1;
  font-size: 1.2rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  width: 100%;
  max-width: 350px;
}

body.light-theme .mobile-menu-item {
  background: rgba(0, 0, 0, 0.05);
  color: #0e0e0e;
  border-color: rgba(0,0,0,0.1);
}

.mobile-menu-item img {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

body.light-theme .mobile-menu-item img {
  filter: brightness(0) invert(0);
}

.main-content {
  margin-left: 70px;
  width: calc(100% - 70px);
  padding: 40px 40px 80px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.linked-header-section {
    text-align: center;
    margin-bottom: 60px;
    max-width: 600px;
}

.linked-header-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(90deg, #fff, #bbb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .linked-header-section h1 {
    background: linear-gradient(90deg, #111, #444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.linked-header-section p {
    color: #888;
    font-size: 1.1rem;
    line-height: 1.5;
}

body.light-theme .linked-header-section p {
    color: #555;
}

.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    width: 100%;
    max-width: 1100px;
}

.service-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 24px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 280px;
    flex-shrink: 0;
}

body.light-theme .service-card {
    background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.05));
    border: 1px solid rgba(0,0,0,0.08);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.15);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
}

body.light-theme .service-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.15);
    background: linear-gradient(180deg, rgba(0,0,0,0.04), rgba(0,0,0,0.06));
}

.service-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

body.light-theme .service-icon-wrapper {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.service-icon-wrapper img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.spotify-bg { background: rgba(29, 185, 84, 0.1); }
.youtube-bg { background: rgba(255, 0, 0, 0.1); }
.apple-bg { background: rgba(255, 255, 255, 0.1); }
.deezer-bg { background: rgba(162, 56, 255, 0.1); }
.soundcloud-bg { background: rgba(255, 85, 0, 0.12); }
.tidal-bg { background: linear-gradient(145deg, #111111, #000000); border-color: #333}

body.light-theme .apple-bg { background: rgba(0, 0, 0, 0.05);}

.service-details {
    margin-bottom: 25px;
}

.service-details h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
}

body.light-theme .service-details h3 {
    color: #111;
}

.service-details p {
    font-size: 0.9rem;
    color: #666;
}

.ac-btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 10px 28px;
  border-radius: 99px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  width: 100%;
}

body.light-theme .ac-btn-outline {
  border-color: rgba(0,0,0,0.2);
  color: #333;
}

.ac-btn-outline:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}

body.light-theme .ac-btn-outline:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}

.ac-btn-outline:disabled,
.linked-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255,255,255,0.05) !important;
    color: #aaa !important;
    border-color: transparent !important;
}

body.light-theme .ac-btn-outline:disabled,
body.light-theme .linked-disabled {
    background: rgba(0,0,0,0.05) !important;
    color: #888 !important;
}

.service-btn-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.service-btn-row .ac-btn-outline {
    flex: 1;
}

.info-icon-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #ccc;
    font-family: 'Figtree', sans-serif;
    font-style: italic;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

body.light-theme .info-icon-btn {
    background: rgba(0,0,0,0.1);
    color: #555;
}

.info-icon-btn:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

body.light-theme .info-icon-btn:hover {
    background: rgba(0,0,0,0.2);
    color: #000;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
    overflow: hidden;
}

body.light-theme .modal-overlay {
    background: rgba(255, 255, 255, 0.88);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 32px;
    border-radius: 20px;
    width: 100%;
    max-width: 460px;
    transform: scale(0.92);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

body.light-theme .modal-content {
    background: linear-gradient(135deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.02) 100%);
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

body.light-theme .modal-header h3 {
    color: #111;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

body.light-theme .close-modal-btn:hover {
    color: #000;
    background: rgba(0,0,0,0.08);
}

.modal-content p {
    color: #bbb;
    line-height: 1.65;
    font-size: 0.95rem;
}

body.light-theme .modal-content p {
    color: #555;
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-menu-btn { display: flex; }
  
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 40px 20px;
  }

  .header {
    width: 100%;
    margin-left: 0;
    padding: 20px 0;
  }

  .header-logo {
    width: 200px;
  }

  .linked-header-section h1 { font-size: 2rem; }
  
  .service-card {
    width: 100%;
    max-width: 400px;
  }
}