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

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f4f4f5;
  --bg-elevated: #ffffff;
  --text-primary: #18181b;
  --text-secondary: #71717a;
  --accent-color: #000000; /* Minimalist Black Accent */
  --accent-hover: #333333;
  --border-color: #e4e4e7;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --transition-speed: 0.2s;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-speed);
}

/* Header */
header {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.05em;
  display: flex;
  align-items: center;
}

.logo span {
    color: var(--text-primary); /* Keep it monochrome for clean look */
}

.nav-links {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0;
    margin-left: auto; /* Push nav and subsequent profile to right */
    justify-content: flex-end; /* Align items to end */
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    margin-left: 2rem;
    white-space: nowrap;
}
.auth-btn {
    background-color: transparent;
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 2rem;
    transition: all 0.2s;
}
.auth-btn:hover {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}
.auth-btn.signed-in {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

/* Mobile Nav */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    margin-right: 1rem;
    z-index: 102;
    order: 1; /* Left side on mobile */
}
.menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 2px;
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
        flex-wrap: wrap; /* Allow wrapping for menu content */
        justify-content: space-between; /* Space out items */
        align-items: center;
    }
    
    .menu-toggle {
        display: flex; /* Show hamburger */
        order: 1;
        margin-right: 1rem;
    }

    .logo {
        order: 2;
        margin-right: auto; /* Push remaining items to the right */
        margin-left: 0;
    }

    /* Profile Pic / Auth Btn Position on Mobile */
    #header-profile-container, .profile-pic-header {
        order: 3; /* Right side */
        margin-left: 0; /* Already pushed by logo */
        display: flex;
        align-items: center;
    }

    .nav-links {
        display: none; /* Hidden by default */
        flex-direction: column;
        width: 100%;
        order: 4; /* Below everything */
        padding: 1rem 0;
        background-color: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        margin-top: 1rem;
    }

    .nav-links.active {
        display: flex; /* Show when active */
    }

    .nav-links a {
        margin: 0;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        text-align: left;
    }

    .nav-links #auth-btn {
        margin: 1rem;
        width: auto;
        display: inline-block; /* revert if caught in global rule */
    }
}

/* Home Grid */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 5%;
}

.hero-section {
    padding: 4rem 0;
    margin-bottom: 2rem;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr; /* Stack on very small screens */
        gap: 1.5rem;
    }
    .hero-title {
        font-size: 2.5rem;
    }
}

/* Cards */
.card {
  background-color: var(--bg-elevated);
  border-radius: var(--border-radius-md);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  /* Simplified for clean UI - no borders, just layout */
}

.card:hover {
  transform: translateY(-4px);
}

.card-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 1rem;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-speed);
}
.card:hover .card-img-container {
    box-shadow: var(--shadow-md);
}

.card-img-real {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-img-placeholder {
    display: none; /* Replaced by image */
}

.card-play-btn {
    position: absolute;
    bottom: 50%;
    right: 50%;
    transform: translate(50%, 50%) scale(0.8);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #ffffff; /* White button */
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 3;
}

.card:hover .card-play-btn {
    opacity: 1;
    transform: translate(50%, 50%) scale(1);
}

.card-badge {
    position: absolute;
    padding: 4px 8px;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    z-index: 2;
}

.card-type-badge {
    display: none; /* Removed from image */
}

.card-likes-badge {
    bottom: 8px;
    left: 8px;
    display: flex;
    align-items: center;
}

.card-duration-badge {
    bottom: 8px;
    right: 8px;
}

/* On mobile, play button always visible or just hidden until tap? 
   Let's keep hover for desktop, tap works on mobile anyway. */
@media (hover: none) {
    .card-play-btn {
        opacity: 1;
        transform: translateY(0);
        width: 40px;
        height: 40px;
    }
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
  color: var(--text-primary);
  margin-top: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-type-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-likes {
    font-size: 0.85rem; /* No longer used here, moved to badge */
    display: none;
}

.card-author {
  display: none; /* Hidden as per request */
}

/* Detail Page */
.detail-view-wrapper {
    background-color: var(--bg-primary);
    min-height: calc(100vh - 80px);
}

.detail-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 2rem;
  padding-bottom: 2rem;
  max-width: 800px; 
  margin: 0 auto;
  text-align: center;
}

.detail-cover-container {
    position: relative;
    margin-bottom: 2rem;
}

.detail-cover {
  width: 280px;
  height: 280px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 700;
  color: #fff;
  z-index: 1;
}

/* Playing Animation */
.playing-animation {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 24px;
    display: none;
}
.playing-animation.active {
    display: flex;
}
.playing-animation span {
    width: 6px;
    background-color: white;
    border-radius: 99px;
    animation: bounce 1s infinite ease-in-out;
}
.playing-animation span:nth-child(1) { animation-delay: 0s; height: 40%; }
.playing-animation span:nth-child(2) { animation-delay: 0.2s; height: 100%; }
.playing-animation span:nth-child(3) { animation-delay: 0.4s; height: 60%; }

@keyframes bounce {
    0%, 100% { height: 30%; }
    50% { height: 100%; }
}

.detail-info {
    width: 100%;
}

.detail-type {
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.detail-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.detail-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.detail-likes-container {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.1s;
}
.detail-likes-container:active {
    transform: scale(0.95);
}
.heart-icon {
     transition: 0.2s;
}

.action-bar {
    padding: 0 2rem 2rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.feature-play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--text-primary); /* Black button */
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.feature-play-btn:hover {
    transform: scale(1.05);
    background-color: #333;
}
.feature-play-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
    margin-left: 2px; /* Visual center adjustment */
}

/* Secondary actions */
.icon-btn {
    width: 50px;
    height: 64px; /* Match height align */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    transition: color 0.2s;
}
.icon-btn:hover {
    color: var(--text-primary);
}

.detail-desc-section {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 2rem 4rem 2rem;
}

.audio-player-wrapper {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

/* Notification Popup */
.notification-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    width: 320px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    border: 1px solid var(--border-color);
}
.notification-popup.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.notification-content {
    text-align: center;
}
.notification-content p {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}
.notification-actions {
    display: flex;
    gap: 1rem;
}
.notification-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}
.btn-allow {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}
.btn-later {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

audio {
    width: 100%;
    height: 40px;
    filter: none; /* Removed the invert hack */
}

.detail-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  margin: 1.5rem 0 0 5%;
}
.back-link:hover {
  color: var(--text-primary);
}

/* Mobile Adjustments for Detail Layout */
@media (max-width: 600px) {
    .detail-container {
        padding: 2rem 1.5rem;
    }
    .detail-cover {
        width: 200px;
        height: 200px;
    }
    .detail-title {
        font-size: 2rem;
    }
    .hero-title {
        font-size: 2.2rem;
    }
}

