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

:root {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --subtext-color: #999999;
    --accent-color: #1db954;
    --progress-bg: #333333;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: transparent;
    overflow: hidden;
    /* Prevent scrolling in the body */
}

/* Light Theme Overrides */
body.light-theme {
    --bg-color: #ffffff;
    --text-color: #111111;
    --subtext-color: #6b6b6b;
    --progress-bg: #e0e0e0;
}

/* Landing Page Specific Styles */
body.landing-page {
    background-color: #0a0a0a;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    overflow-y: auto;
    /* Allow scrolling for landing page */
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(45deg, #1db954, #1ed760);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-nav {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 40px;
    gap: 40px;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.2rem;
    color: #aaa;
    margin-bottom: 30px;
    max-width: 500px;
}

.subtext {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
    margin-bottom: 0;
}

.btn-primary {
    background: #1db954;
    color: #000;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(29, 185, 84, 0.3);
    background: #1ed760;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

.widget-preview {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 16px;
    width: 350px;
    display: flex;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.lp-record-preview {
    width: 80px;
    height: 80px;
    background: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    animation: spin 5s linear infinite;
}

.album-cover-preview {
    width: 30px;
    height: 30px;
    background-color: #333;
    border-radius: 50%;
    background-image: url('https://i.scdn.co/image/ab67616d0000b273297b2c53224bd1d1df3c57f7');
    /* Example cover */
    background-size: cover;
}

.track-info-preview h3 {
    margin: 0;
    font-size: 1rem;
}

.track-info-preview p {
    margin: 0;
    font-size: 0.8rem;
    color: #aaa;
}

.progress-bar-container-preview {
    margin-top: 8px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    width: 100%;
    position: relative;
}

.progress-bar-preview {
    width: 60%;
    height: 100%;
    background: #1db954;
    border-radius: 2px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 40px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.feature-card h3 {
    color: #1db954;
    margin-bottom: 10px;
}

.feature-card p {
    color: #aaa;
    line-height: 1.5;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.snippet-content {
    max-width: 600px;
    text-align: left;
}

.snippet-content h2 {
    margin-top: 0;
    color: #fff;
}

.customization-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.control-group label {
    font-size: 0.8rem;
    color: #aaa;
    font-weight: 600;
}

.theme-toggle {
    display: flex;
    background: #333;
    border-radius: 6px;
    padding: 2px;
}

.btn-theme {
    background: transparent;
    border: none;
    color: #aaa;
    padding: 5px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-theme.active {
    background: #555;
    color: #fff;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 40px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    background: none;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 1px solid #555;
    border-radius: 4px;
}

.code-block-container {
    background: #000;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    position: relative;
    border: 1px solid #333;
}

.code-block-container pre {
    margin: 0;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #a5d6ff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    padding-bottom: 40px;
    /* Space for button */
}

.btn-copy {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: #444;
}

.preview-link {
    font-size: 0.9rem;
    color: #888;
    text-align: center;
}

.preview-link a {
    color: #1db954;
    text-decoration: none;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}

.payment-form input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: #333;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    box-sizing: border-box;
    /* Fix padding issue */
}

.payment-form .row {
    display: flex;
    gap: 10px;
}

.btn-spotify {
    display: inline-block;
    background: #1db954;
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 20px;
    transition: background 0.3s;
}

.btn-spotify:hover {
    background: #1ed760;
}

.hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Config page
   -------------------------------------------------------------------------- */

.config-page {
    max-width: 800px;
    margin: 60px auto 100px;
    padding: 0 40px;
}

.config-page h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.config-notice {
    margin: 80px auto;
}

.config-layout {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.config-controls {
    flex: 1;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.control-group--full {
    width: 100%;
}

.variant-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.variant-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-option:hover {
    background: rgba(255, 255, 255, 0.06);
}

.variant-option.active {
    border-color: var(--accent-color, #1db954);
    background: rgba(29, 185, 84, 0.08);
}

.variant-option__name {
    font-weight: 600;
    font-size: 0.95rem;
}

.variant-option__desc {
    font-size: 0.8rem;
    color: #999;
}

.config-preview {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-preview label,
.config-controls label {
    font-size: 0.8rem;
    color: #aaa;
    font-weight: 600;
}

.preview-frame {
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.preview-frame iframe {
    max-width: 100%;
}

/* Original Widget Styles (Preserved) */
.player-container {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: 10px;
    color: var(--text-color);
    max-width: 600px;
    margin: auto;
    overflow: visible;
    /* Allow content to grow */
}

.player-link {
    text-decoration: none;
    color: inherit;
}

.lp-record {
    background: black;
    width: 140px;
    height: 140px;
    /* Set height to the same as width */
    aspect-ratio: 1 / 1;
    /* Ensures it's a perfect square */
    border-radius: 50%;
    animation: spin 5s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

.album-cover {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-size: cover;
    /* Ensures the entire cover is displayed */
    background-position: center;
    /* Centers the cover */
    background-repeat: no-repeat;
    /* Prevents any tiling of the image */
}

.track-info {
    display: flex;
    flex-direction: column;
    width: 100%;
    font-family: 'Inter', sans-serif;
    /* Apply Inter font here */
    gap: 4px;
}

.live-indicator {
    display: flex;
    align-items: center;
}

.live-text {
    font-size: 0.9em;
    color: var(--accent-color);
    margin-left: 8px;
    /* Space between dot and text */
    font-family: 'Inter', sans-serif;
    /* Apply Inter font here */
}

.live-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.track-info h3,
.track-info p {
    line-height: normal;
    margin: 0;
    /* Remove margin to keep text aligned */
}

.progress-bar-container {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 8px;
    /* Add some space above the progress bar */
}

.progress-time,
.track-duration {
    width: 32px;
    text-align: center;
    font-size: 0.9em;
    color: var(--text-color);
}

.progress-bar-wrapper {
    flex: 1;
    background-color: var(--progress-bg);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin: 0 10px;
    position: relative;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    width: 0;
}

.loading {
    display: none;
    font-size: 18px;
    color: #666;
}

#last-played {
    font-size: 0.85em;
    color: var(--subtext-color);
    text-align: center;
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Variants
   -------------------------------------------------------------------------- */

/* Compact: same layout as the card, just trimmed down */
body.variant-compact .player-container {
    padding: 10px 14px;
}

body.variant-compact .lp-record {
    width: 48px;
    height: 48px;
    margin-right: 12px;
}

body.variant-compact .live-indicator,
body.variant-compact .progress-bar-container {
    display: none;
}

body.variant-compact .track-info h3 {
    font-size: 0.95em;
}

/* Minimal: a single line of text, no card, no artwork. Styled to sit
   directly on a page rather than float above it — modeled on the
   now-playing column on ericjacobson.se (Geist Mono, uppercase, muted
   artist, a small pulsing dot standing in for the "live" indicator). */
.player-minimal {
    display: none;
    align-items: center;
    gap: 8px;
    font-family: 'Geist Mono', 'Courier New', monospace;
    font-size: 13px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.variant-minimal .player-container {
    display: none;
}

body.variant-minimal .player-minimal {
    display: inline-flex;
}

.minimal-dot {
    position: relative;
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-color);
}

.minimal-dot::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--accent-color);
    animation: minimal-ping 3s cubic-bezier(.16, 1, .3, 1) infinite;
}

.minimal-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.minimal-sep {
    margin: 0 8px;
    opacity: 0.4;
}

#minimal-artist {
    color: var(--subtext-color);
}

@keyframes minimal-ping {
    0% {
        transform: scale(1);
        opacity: 0.55;
    }

    70%,
    100% {
        transform: scale(3.4);
        opacity: 0;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}