/* ---- Profile Pill ---- */
.profile-pill {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-dropdown);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
    user-select: none;
    animation: pillSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes pillSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-pill:hover {
    background: var(--color-bg-card-hover);
    border-color: var(--color-accent-primary);
    box-shadow: var(--shadow-glow-primary);
}

.profile-pill-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent-primary), #a29bfe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
}

.profile-pill-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-pill svg {
    color: var(--color-text-muted);
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

/* ---- Profile Dropdown ---- */
.profile-dropdown {
    position: fixed;
    top: 68px;
    right: 20px;
    z-index: var(--z-dropdown);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    overflow: hidden;
    animation: dropdownIn 0.2s ease forwards;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-dropdown-preview {
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--color-bg-secondary), var(--color-bg-card));
}

.profile-big-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent-primary), #a29bfe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.4rem;
    color: white;
    margin: 0 auto 12px;
    box-shadow: var(--shadow-glow-primary);
}

.profile-dropdown-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.profile-dropdown-username {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.profile-dropdown-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0;
}

/* ---- Avatar Picker ---- */
.avatar-picker-section {
    padding: 14px 16px 10px;
}

.avatar-picker-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.avatar-picker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.avatar-option {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: transparent;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.avatar-option:hover {
    background: var(--color-bg-card-hover);
    border-color: var(--color-border);
}

.avatar-option.selected {
    background: rgba(108, 92, 231, 0.15);
    border-color: var(--color-accent-primary);
}

.profile-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.profile-dropdown-btn:hover {
    background: var(--color-bg-card-hover);
    color: var(--color-text-primary);
}

/* ---- Landing page ---- */
.landing-page {
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-spotify));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.logo-subtitle {
    color: var(--color-text-secondary);
    font-size: 1rem;
    margin-bottom: 40px;
}

/* ---- Username step ---- */
.username-section {
    margin-bottom: 40px;
}

.username-input-row {
    display: flex;
    gap: 10px;
    max-width: 360px;
    margin: 0 auto;
}

.username-input-row .input {
    flex: 1;
    text-align: center;
    font-size: 1.05rem;
    padding: 14px 18px;
}

.btn-confirm {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.username-hint {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--color-danger);
}

/* ---- Main menu step ---- */
.main-actions {
    margin-bottom: 32px;
}

.btn-action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px 24px;
    background: var(--color-bg-card);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: left;
    color: var(--color-text-primary);
}

.btn-action-card:hover {
    border-color: var(--color-accent-primary);
    background: var(--color-bg-card-hover);
    box-shadow: var(--shadow-glow-primary);
    transform: translateY(-2px);
}

.action-card-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.action-card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.action-card-title {
    font-size: 1rem;
    font-weight: 700;
}

.action-card-desc {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}

.btn-action-card svg {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

/* ---- Join section ---- */
.join-section {
    padding-top: 20px;
}

.join-section .divider {
    margin-bottom: 20px;
}

.join-form {
    display: flex;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.join-form .input {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 700;
    font-size: 1.1rem;
    flex: 1;
}

/* ---- Modal back button ---- */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    padding: 6px 10px;
}

.back-btn:hover {
    color: var(--color-text-primary);
    background: transparent;
}

/* ---- Platform cards (in modal) ---- */
.platform-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 8px;
}

.platform-card {
    padding: 28px 16px;
    border-radius: var(--radius-lg);
    background: var(--color-bg-card);
    border: 2px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.platform-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.platform-card.spotify:hover {
    border-color: var(--color-accent-spotify);
    box-shadow: var(--shadow-glow-spotify);
}

.platform-card.youtube:hover {
    border-color: var(--color-accent-youtube);
    box-shadow: var(--shadow-glow-youtube);
}

.platform-icon {
    width: 56px;
    height: 56px;
}

.platform-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.platform-desc {
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    text-align: center;
}

/* ---- Auth options ---- */
.spotify-auth-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.spotify-auth-option {
    padding: 18px 20px;
    border-radius: var(--radius-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
}

.spotify-auth-option:hover {
    border-color: var(--color-accent-primary);
    background: var(--color-bg-card-hover);
}

.spotify-auth-option h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--color-text-primary);
}

.spotify-auth-option p {
    color: var(--color-text-secondary);
    font-size: 0.82rem;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .profile-pill {
        top: 12px;
        right: 12px;
    }

    .profile-dropdown {
        top: 60px;
        right: 12px;
        left: 12px;
        min-width: unset;
    }

    .logo {
        font-size: 2rem;
    }

    .platform-cards {
        grid-template-columns: 1fr;
    }

    .platform-card {
        padding: 20px 16px;
        flex-direction: row;
        gap: 16px;
    }

    .platform-icon {
        width: 40px;
        height: 40px;
    }

    .join-form {
        flex-direction: column;
    }

    .btn-action-card {
        max-width: 100%;
    }
}

/* ---- Photo Upload Button ---- */
.avatar-upload-btn {
    background: var(--color-bg-card) !important;
    border: 1.5px dashed var(--color-border-light) !important;
    color: var(--color-text-muted);
    transition: all 0.2s ease !important;
}

.avatar-upload-btn:hover {
    background: rgba(108, 92, 231, 0.1) !important;
    border-color: var(--color-accent-primary) !important;
    color: var(--color-accent-primary) !important;
    transform: scale(1.12) !important;
}

.avatar-upload-btn.selected {
    background: rgba(108, 92, 231, 0.15) !important;
    border-color: var(--color-accent-primary) !important;
    border-style: solid !important;
}

/* ---- Photo Editor ---- */
.photo-editor-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.photo-editor-modal {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 320px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.photo-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.photo-editor-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.photo-editor-canvas-wrap {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 0 2px var(--color-accent-primary);
    cursor: grab;
}

.photo-editor-canvas-wrap:active {
    cursor: grabbing;
}

#photo-editor-canvas {
    display: block;
    touch-action: none;
}

.photo-editor-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.zoom-control {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
}

.zoom-control input[type="range"] {
    flex: 1;
    height: 4px;
    accent-color: var(--color-accent-primary);
}

.photo-editor-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.photo-editor-actions .btn {
    flex: 1;
}
